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:
TimePicker Example
DatePicker Example
AS_BottomWheelDateTimePicker
Author: Alexander Stolte
Version: 1.00
Changelog
Have Fun
You need:
- AS_DraggableBottomCard V1.14+
- AS_WheelPicker V3.24+
- AS_WheelDateTimePicker V1.17+
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
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]
- Events:
- 1.00
- Release
Have Fun
Attachments
Last edited: