B4A Library TimePicker V1.0

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Mar 4, 2015.

  1. DonManfred

    DonManfred Expert Licensed User

    TimePicker
    Version:
    1
    • TimePicker
      Events:
      • timechanged (date as Long As )
      Methods:
      • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
      • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
      • Initialize (EventName As String)
      • IsInitialized As Boolean
      • disableTouch (disableTouch As Boolean)
      • enableTwentyFourHour (twentyFour As Boolean)
      Properties:
      • ClockColor As Int [write only]
      • Color As Int [write only]
      • DialColor As Int [write only]
      • Left As Int
      • TextColor As Int [write only]
      • Time As Long
      • Top As Int

    [​IMG]

    This library is Donationware. You can download the library, you can test the library. But if you want to USE the library in your App you need to Donate for it.
    Please click here to donate (You can donate any amount you want to donate for the library (or my work) :)
    [​IMG]
     

    Attached Files:

  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Excellent. Going to try this.
     
    NJDude likes this.
  3. Peter Simpson

    Peter Simpson Expert Licensed User

    Hiya @DonManfred.
    You habe a sub called the following
    Code:
    Sub TP_TimeChanged(date As Long)
    Surely date should be called something else that is logical, maybe SetTime, SelectedTime, AlarmTime or just anything with the word time included with it. I only mention this as date could easily be confused with Date as it says date but actually returns the time.

    It's a nice library and it works really well, cheers...
     
  4. NJDude

    NJDude Expert Licensed User

    Nice lib, just try to post larger screen shots to see better. :p
     
  5. DonManfred

    DonManfred Expert Licensed User

    I need to use my tablet then... :D
     
    migrec and Peter Simpson like this.
  6. DonManfred

    DonManfred Expert Licensed User

    You are right. It may be irritating... Will change it. The lib is a quick and dirty wrap. I made the wrapper in 20 to 30 minutes or so... ;) It was never so easy to wrap a lib like this one...
     
    Peter Simpson likes this.
  7. rboeck

    rboeck Well-Known Member Licensed User

    One idea for the timepicker: If you want to plan a date, you will most of the time use rounded values, from 5 minutes to 15 or 30 minute steps. So maybe this could be an option to make an step parameter and you get back rounded time values.
     
    SamuelP likes this.
  8. DonManfred

    DonManfred Expert Licensed User

    It is just a wrapper for this library. I dont wrote the logic. I just made a wrapper to be used in b4a.
    Maybe you find the formular in this java-file (this is ALL of the library). I did not looked for it actually. But there are some formulas to calc degrees and so

    btw: I like the idea
     
  9. rleiman

    rleiman Well-Known Member Licensed User

    Hi Everyone,

    How do I convert the time from the clock into HH:mm?

    Code:
    Sub PickedTime_timechanged(date As Long)
       
    ' strPickedTime = the hours and minutes go here.
    End Sub
    Thanks.
     
  10. DonManfred

    DonManfred Expert Licensed User

  11. rleiman

    rleiman Well-Known Member Licensed User

    Thanks.

    Here's the code I used.

    Code:
    DateTime.TimeFormat = "HH:mm"

        StrPickedTime = 
    "Time picked is: " & DateTime.Time(date)
     
    DonManfred likes this.
  12. rleiman

    rleiman Well-Known Member Licensed User


    Nice Time Picker. I can use it until a B4A KitKat version comes out.

    Is there a way to make it snap to the tick lines on the clock dial?

    It's very tricky to select a time like 17:30 because the time numbers jump around too much to get an exact time.
     
  13. DonManfred

    DonManfred Expert Licensed User

    The original library does not expose a method for this. sorry, no.

    i know. I dont like it too. That´s why i dont like this library. I just wrote the wrapper out of fun.

    I´m working on nicer ones too but sadly - till now - i just get the date-picker working but not the time-picker from the kitkat version :mad:
     
  14. rleiman

    rleiman Well-Known Member Licensed User

    I may try making something that looks and behaves something like the KitKat time picker sometime.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice