4

Time picker dialog shows circular timings by default to select date and time. Instead of it Need to show keyboard entry by default to select date and time. While showing time picker dialog in circular style, it has keyboard icon to change circular style to manual entry style. This feature is available from Android Oreo OS devices. How to show Time picker dialog with manual(keyboard) entry by default in supporting devices ?

Time picker dialog with manual(keyboard) entry

Krishna
  • 1,556
  • 13
  • 21

2 Answers2

2

The time picker can be started in text input mode with:

MaterialTimePicker.Builder().setInputMode(INPUT_MODE_KEYBOARD)

For example:

val picker =
    MaterialTimePicker.Builder()
        .setTitleText(R.string.Set_time)
        .setTimeFormat(TimeFormat.CLOCK_12H)
        .setHour(12)
        .setMinute(30)
        .setInputMode(MaterialTimePicker.INPUT_MODE_KEYBOARD)
        .build()

picker.show(supportFragmentManager, "TimePicker")

Source: https://material.io/components/time-pickers/android#using-time-pickers

biinui
  • 73
  • 2
  • 6
0

In your showTimePicker() function you can set the initialEntryMode. By default it's TimePickerEntryMode.dial but you can change it to TimePickerEntryMode.input.

Just add: initialEntryMode: TimePickerEntryMode.input,