B4A Library Beautiful InputDialog

Hi again.
I use input dialog in my project that is beautiful and interest.
You set message and show dialog
Dialog have 2 button for ok and cancel that with click on OK,return result in event that you declare
I dont convert module to library because you will can develop it
example attach with module
This is small gift
2zs4ftw.png
 

Attachments

  • InputDialog.zip
    50.8 KB · Views: 1,604

ArminKH

Well-Known Member
thank u for sharing and thank u for source code;)
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
But it's can't work on release with obfusscated!
Hello,
It does work when obfuscated just by modifying the sub name and the initialization method (put an underscore)

In Main
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("f1")

    it.Initialize(Me,Activity,"Please input your name:\nAtleast 3 character for name","btn_GetName")

End Sub

and

B4X:
Sub btn_GetName(name As Object)
    Msgbox($"Thank you mr/mrs ${name}"$,"alert")
End Sub
 

Attachments

  • BeautifulDialogs.zip
    22.3 KB · Views: 577

fash866

Member
Licensed User
Longtime User
Hello,
It does work when obfuscated just by modifying the sub name and the initialization method (put an underscore)

In Main
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("f1")

    it.Initialize(Me,Activity,"Please input your name:\nAtleast 3 character for name","btn_GetName")

End Sub

and

B4X:
Sub btn_GetName(name As Object)
    Msgbox($"Thank you mr/mrs ${name}"$,"alert")
End Sub
Problem solved, thank you!
 

jchal

Active Member
Licensed User
Longtime User
hi all
i tryed the example and i have a question to raize.
i input the name eg john and i want to get the result e.g string 'john' how do i get it as string?
i tryed the following code but no lack...
B4X:
If name ="john" Then Msgbox ("ok") Else Msgbox("wrong")
 

jchal

Active Member
Licensed User
Longtime User
what i try is to use it with ImageView so i alter the code but something goes wrong
here is the altered code
B4X:
#Region  Project Attributes 
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName: 
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim it As InputTemplate
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("layout1")
    it.Initialize(Me,Activity,"Please input your name:\nAtleast 3 character for name","btn_GetName")

End Sub



Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub ImageView1_Click
    it.Show
End Sub

Sub btnGetName(name As Object)
    'Dim str1 As String
    Msgbox($"Thank you mr/mrs ${name}"$,"alert")
    'str1= $(name)
   
    'If name ="john" Then Msgbox ("ok") Else Msgbox("wrong")
End Sub




Sub Button1_Click
    it.Show
End Sub
when i clik the button it works , when i click the image view it does not why?
 

stevel05

Expert
Licensed User
Longtime User
Does Layout1 contain an ImageView called ImageView1?

It would be easier to help if you uploaded a project that showed the issue.
 

DonManfred

Expert
Licensed User
Longtime User
Top