B4A Library [B4X] [XUI] AS BottomWheelDateTimePicker based on AS_WheelDateTimePicker

This view makes it easy to quickly provide a good looking date and time picker, based on the AS_WheelDateTimePicker, built into a ready to use bottom menu.

You need:
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)

IMG_0576.jpg
IMG_0574.jpg


IMG_0575.jpg
IMG_0573.jpg


TimePicker Example

B4X:
Private Sub OpenSheetTimePicker(DarkMode As Boolean)
    BottomWheelDateTimePicker.Initialize(Me,"BottomWheelDateTimePicker",Root)
  
    BottomWheelDateTimePicker.Theme = IIf(DarkMode,BottomWheelDateTimePicker.Theme_Dark,BottomWheelDateTimePicker.Theme_Light)
    BottomWheelDateTimePicker.ActionButtonVisible = True
  
    BottomWheelDateTimePicker.PickerType = BottomWheelDateTimePicker.PickerType_TimePicker
    BottomWheelDateTimePicker.TimePicker_TimeUnit = True 'Show TimePicker_HourShortText and TimePicker_MinuteShortText
    BottomWheelDateTimePicker.TimePicker_ShowAMPM = False
'    BottomWheelDateTimePicker.TimePicker_TimeDivider = True
'    BottomWheelDateTimePicker.TimePicker_ShowDate = True
'    BottomWheelDateTimePicker.TimePicker_HourShortText = "hour"
'    BottomWheelDateTimePicker.TimePicker_MinuteShortText = "min"
'    BottomWheelDateTimePicker.Hour = 13 'Only Works in Release mode
'    BottomWheelDateTimePicker.Minute = 46 'Only Works in Release mode
    BottomWheelDateTimePicker.ShowPicker
  
    BottomWheelDateTimePicker.ActionButton.Text = "Choose"
  
    Wait For BottomWheelDateTimePicker_ActionButtonClicked
  
    #If Debug
    Log($"Hour: ${BottomWheelDateTimePicker.Hour} Minute: ${BottomWheelDateTimePicker.Minute}"$)
    #Else
    xui.MsgboxAsync($"Hour: ${BottomWheelDateTimePicker.Hour} Minute: ${BottomWheelDateTimePicker.Minute}"$,"TimePicker") 
    #End If

    BottomWheelDateTimePicker.HidePicker
  
End Sub
DatePicker Example
B4X:
Private Sub OpenSheetDatePicker(DarkMode As Boolean)
    BottomWheelDateTimePicker.Initialize(Me,"BottomWheelDateTimePicker",Root)
  
    BottomWheelDateTimePicker.Theme = IIf(DarkMode,BottomWheelDateTimePicker.Theme_Dark,BottomWheelDateTimePicker.Theme_Light)
    BottomWheelDateTimePicker.ActionButtonVisible = True
  
    BottomWheelDateTimePicker.PickerType = BottomWheelDateTimePicker.PickerType_DatePicker
'    BottomWheelDateTimePicker.DatePicker_MaxDate = DateTime.Now
'    BottomWheelDateTimePicker.Date = DateUtils.SetDate(2025,1,4)
    BottomWheelDateTimePicker.ShowPicker
  
    BottomWheelDateTimePicker.ActionButton.Text = "Choose"
  
    Wait For BottomWheelDateTimePicker_ActionButtonClicked
  
    #If Debug
    Log(DateUtils.TicksToString(BottomWheelDateTimePicker.Date))
    #Else
    xui.MsgboxAsync(DateUtils.TicksToString(BottomWheelDateTimePicker.Date),"DatePicker") 
    #End If

    BottomWheelDateTimePicker.HidePicker
End Sub

AS_BottomWheelDateTimePicker
Author: Alexander Stolte
Version: 1.00
  • AS_BottomWheelDateTimePicker
    • Events:
      • ActionButtonClicked
      • Close
    • Fields:
      • Tag As Object
    • Functions:
      • HidePicker
      • Initialize (Callback As Object, EventName As String, Parent As B4XView)
        Initializes the object. You can add parameters to this method if needed.
      • ShowPicker
    • Properties:
      • ActionButton As B4XView [read only]
      • ActionButtonVisible As Boolean
      • Color As Int
      • Date As Long
        Set it after you set the PickerType
      • DatePicker_MaxDate As Long
      • DatePicker_MinDate As Long
      • DragIndicatorColor As Int
      • Hour As Int
      • Minute As Int
      • PickerType As String
      • PickerType_DatePicker As String [read only]
      • PickerType_TimePicker As String [read only]
      • SheetWidth As Float
        Set the value to greater than 0 to set a custom width
        Set the value to 0 to use the full screen width
        Default: 0
      • TextColor As Int [write only]
      • Theme As AS_BottomWheelDateTimePicker_Theme [write only]
      • Theme_Dark As AS_BottomWheelDateTimePicker_Theme [read only]
      • Theme_Light As AS_BottomWheelDateTimePicker_Theme [read only]
      • ThemeChangeTransition_Fade As String [read only]
      • ThemeChangeTransition_None As String [read only]
      • TimePicker_HourShortText As String
      • TimePicker_MinuteShortText As String
      • TimePicker_MinuteSteps As Int
      • TimePicker_ShowAMPM As Boolean
        Show the AM and PM column
      • TimePicker_ShowDate As Boolean
        Show the date column in the TimePicker
      • TimePicker_TimeDivider As Boolean
        The separator between hour and minute is usually a colon ( : )
      • TimePicker_TimeUnit As Boolean
        Display time unit (12hour 05 min) can be changed with the HourShort and MinuteShort property
      • WheelDateTimePicker As AS_WheelDateTimePicker [read only]
Changelog
  • 1.00
    • Release
Github: github.com/StolteX/AS_BottomWheelDateTimePicker
Have Fun :)
 

Attachments

  • AS BottomWheelDateTimePicker Example.zip
    175.8 KB · Views: 14
  • AS_BottomWheelDateTimePicker.b4xlib
    5.8 KB · Views: 23
Last edited:
Top