Android Question [Solved] Can I translate the MadeWithLove and have a link in B4X word?

asales

Expert
Licensed User
Longtime User
I think that to my language is more understandable using this phrase:
Feito comusando B4X

and have a highlight clickable in the "B4X" word redirect to B4X site.
 

DonManfred

Expert
Licensed User
Longtime User
Isn´t it a b4xlib?
you can extract the source and change it
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4A_YBb3K2ineo.png


B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Main")
    ChangeTextAndMakeClickable(MadeWithLove1)
End Sub

Sub ChangeTextAndMakeClickable (love As MadeWithLove)
    Dim cs As CSBuilder
    cs.Initialize.Append("Feito com ").Typeface(Typeface.FONTAWESOME).Color(xui.Color_Red).Append(Chr(0xF004)).Pop.Pop _
        .Append(" usando ").Clickable("cs", "").Underline.Color(xui.Color_Blue).Append("B4X").PopAll
    Dim lbl As Label = love.mBase.GetView(0)
    cs.EnableClickEvents(lbl)
    lbl.Text = cs
End Sub

Sub cs_Click (Tag As Object)
    Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.b4x.com")
    StartActivity(i)
End Sub
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Trying to get some love in a CustomListView.

MadeWithLove1 is hidden out of sight in a loaded layout.
B4X:
    Private MadeWithLove1 As MadeWithLove
...

    ChangeTextAndMakeClickable(MadeWithLove1)
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, MadeWithLove1.mBase.Width, MadeWithLove1.mBase.Height)
    
    'Dim obj as B4XView = MadeWithLove1        '    types do not match
    'Dim obj As View = MadeWithLove1        '    squig
    Dim obj As Object = MadeWithLove1        '    no squiggly, but BOOM
    
    p.AddView(obj, 0, 0, p.Width, p.Height)
    xlvText.Add(p, 100)

...

Private Sub ChangeTextAndMakeClickable (love As MadeWithLove)
    Dim cs As CSBuilder
    cs.Initialize.Append("Feito com ").Typeface(Typeface.FONTAWESOME).Color(xui.Color_Red).Append(Chr(0xF004)).Pop.Pop _
        .Append(" usando ").Clickable("cs", "").Underline.Color(xui.Color_Blue).Append("B4X").PopAll
    
    Dim lbl As Label = love.mBase.GetView(0)
    cs.EnableClickEvents(lbl)
    lbl.Text = cs 
End Sub

Private Sub cs_Click (Tag As Object)
    Dim i As Intent
    i.Initialize(i.ACTION_VIEW, "https://www.b4x.com")
    StartActivity(i)
End Sub

B4X:
Error occurred on line: 504 (B4XMainPage)
java.lang.ClassCastException: com.marcsmart.aboutme.madewithlove cannot be cast to android.view.View
    at com.marcsmart.aboutme.b4xmainpage$ResumableSub_WhatIsHere.resume(b4xmainpage.java:1757)
    at com.marcsmart.aboutme.b4xmainpage._whatishere(b4xmainpage.java:1605)
    at com.marcsmart.aboutme.b4xmainpage._mclvside_itemclick(b4xmainpage.java:2240)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1085)
    at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1048)
    at b4a.example3.customlistview$ResumableSub_PanelClickHandler.resume(customlistview.java:805)
    at b4a.example3.customlistview._panelclickhandler(customlistview.java:748)
    at b4a.example3.customlistview._panel_click(customlistview.java:735)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
    at android.view.View.performClick(View.java:7448)
    at android.view.View.performClickInternal(View.java:7425)
    at android.view.View.access$3600(View.java:810)
    at android.view.View$PerformClick.run(View.java:28305)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
 
Upvote 0
Top