Android Question Which library is used for setting the time like the picture?

Theera

Well-Known Member
Licensed User
Longtime User
I'm looking thesetting time library.
 

Attachments

  • Screenshot_20210117_192801.jpg
    Screenshot_20210117_192801.jpg
    2.7 KB · Views: 182

agraham

Expert
Licensed User
Longtime User
 
Upvote 0

Albert Kallal

Active Member
Licensed User
Those dialogs are rather nice. They are lightweight, and work rather well.

So, you need to place:
B4X:
Dialogs2.xml
Dialogs2.jar

Into your libraries path. Then in windows->Libraries Manger, add this:

1610935336673.png

And thus your code is now:

B4X:
    Dim MyTimePop As TimeDialog
   
    MyTimePop.TimeTicks = DateTime.Now
    Dim MyDialog  As Object = MyTimePop.ShowAsync("", "Pick The Time", "Ok", "Cancel", "", Null, True)

    Wait For (MyDialog) Dialog_Result(ret As Int)
   
    If ret = DialogResponse.POSITIVE Then
        ToastMessageShow("Time selected = " & MyTimePop.Hour & ":" & MyTimePop.Minute,True)
    End If

And you see this:

1610935357831.png


I don’t know if “wait for” can be used here (edit: yes, of course it can!!!)

But, as a library that uses “standard” android widgets that is easy, lightweight and works well? I like this choice.

Often the problem with B4A? Well, you have SO MANY choices - the trick is to find some approach and then stick with it until such time one finds a better alternative.

Regards,
Albert D. Kallal
Edmonton, Alberta Canada
 
Last edited:
Upvote 0

agraham

Expert
Licensed User
Longtime User
I don’t know if “wait for” can be used here.
Yes you can. That's the reason for the update from the original Dialogs library. Look at the demo. There are sync and async versions of each Dialog. Using the sync versions is not recommended with present and future versions of Android
 
Upvote 0

Albert Kallal

Active Member
Licensed User
There are sync and async versions of each Dialog. Using the sync versions is not recommended with present and future versions of Android

I updated my code to reflect this (best to encourage the good road here).
In fact, I looked at the download I have from last year - and it MOST certainly did/does have the wait/for.

And even my "test" of that dialog in the same folder also used wait for.

Regardless - I have updated my post here to reflect that.

And I still dare say that the simple use, the simple code and how it produces the "standard" Android date picker, and also the time picker make this library choice near tops in IMHO.

Thank you for the follow up.

Regards,
Albert D. Kallal
Edmonton, Alberta Canada
 
Upvote 0
Top