Android Question [SOLVED] B4XDialog picture

makis_best

Well-Known Member
Licensed User
Longtime User
Hello good people....

I want to ask if it is possible to show a picture using B4XDialog

Thank you
 

Mahares

Expert
Licensed User
Longtime User
I want to ask if it is possible to show a picture using B4XDialog
Are you looking for something like this using B4XDialog Dialog.ShowCustom. See snapshot. Can you clarify your question.
 

Attachments

  • makis_best.png
    makis_best.png
    13.9 KB · Views: 227
Upvote 0

Mahares

Expert
Licensed User
Longtime User
How you set the text fields above the image?
Here is the full code makis. Add your picture to Assets. I also included the layout after you load the main layout that has button1
Using the classic project. You can use B4XPages of course
B4X:
Sub Button1_Click
    Dialog.Initialize(Activity)
   
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 500dip, 500dip)
    p.LoadLayout("MyDialog3")   'has 1 label 3 B4XFloatTextField B4Xviews and one B4XImageView
   
    Dim l3 As B4XView= txtFirstName.TextField   'txtFirstName is a B4XFloatTextField
    Dim f As B4XFont= xui.CreateFont(Typeface.CreateNew(Typeface.DEFAULT, Typeface.STYLE_ITALIC), 24)
    l3.Font =f
   
    Dim l2 As B4XView= txtLastName.TextField
    Dim f As B4XFont= xui.CreateFont(Typeface.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 34)
    l2.Font =f

    Label1.SetColorAndBorder(xui.Color_Cyan,4dip,xui.Color_White,4dip)
    Label1.TextColor=xui.Color_Black
    Label1.SetTextAlignment("CENTER", "CENTER")
    Dim et As EditText=age.TextField
    et.InputType= et.INPUT_TYPE_DECIMAL_NUMBERS
   
    Dialog.PutAtTop = True
    Dim rs As ResumableSub = Dialog.ShowCustom(p, "OK", "", "CANCEL")
   
    B4XImageView1.Bitmap = LoadBitmap(File.DirAssets,"gr.png")
       
    Wait For (rs) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Dialog.Show($"Hello ${txtFirstName.Text} ${txtLastName.Text}  ${age.Text}"$, "OK", "", "")
    End If

End Sub
 

Attachments

  • mydialog3.bal
    4.3 KB · Views: 204
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
Ohhh.. Now I get it just set the order by what you set first and what last
I thought it was an index somehow or something.

Thank you.
 
Upvote 0
Top