A Time Picker in mobile UI design allows users to select a specific time.
Examples
Example - Default
class Main extends App
{
onStart()
{
this.main = ui.addLayout( "main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton( this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
}
showTimePicker()
{
ui.showTimePicker( this.onSelect )
}
onSelect( value )
{
ui.showPopup( value );
}
}
class Main extends App
onStart()
this.main = ui.addLayout( "main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton( this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
showTimePicker()
ui.showTimePicker( this.onSelect )
onSelect( value )
ui.showPopup( value )
Example - With initial value, options and theme color
class Main extends App
{
onStart()
{
ui.setThemeColor( "#673ab7" )
this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton(this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
}
showTimePicker()
{
ui.showTimePicker("08:24", "Portrait", this.onSelect)
}
onSelect( value )
{
ui.showPopup( value );
}
}
class Main extends App
onStart()
ui.setThemeColor( "#673ab7" )
this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton(this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
showTimePicker()
ui.showTimePicker("08:24", "Portrait", this.onSelect)
onSelect( value )
ui.showPopup( value )
Example - Dark mode
class Main extends App
{
onStart()
{
ui.setTheme( "dark" )
this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton(this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
}
showTimePicker()
{
ui.showTimePicker("08:24", "Portrait", this.onSelect)
}
onSelect( value )
{
ui.showPopup( value );
}
}
class Main extends App
onStart()
ui.setTheme( "dark" )
this.main = ui.addLayout("main", "Linear", "VCenter,FillXY")
this.btn = ui.addButton(this.main, "Show Time Picker")
this.btn.setOnTouch( this.showTimePicker )
showTimePicker()
ui.showTimePicker("08:24", "Portrait", this.onSelect)
onSelect( value )
ui.showPopup( value )