I Need to show keyboard entry by default to select 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 ?
Any help with this will be appreciated. I know question is already here. Someone asked this before.
Here is my time picker dialog code
var startHour = 0
var startMinute = 0
val c = Calendar.getInstance()
startHour = c.get(Calendar.HOUR_OF_DAY)
startMinute = c.get(Calendar.MINUTE)
val timepickerdialog =
TimePickerDialog(
this,
R.style.DialogThemeTimePicker,
TimePickerDialog.OnTimeSetListener { _, hour, minute ->
val pickedDateTime = Calendar.getInstance()
val simpleDateFormat = SimpleDateFormat(DATE_TIME_FORMAT)
val simpleDateFormat2 = SimpleDateFormat(TIME_FORMAT)
simpleDateFormat.format(pickedDateTime.getTime())
val newTime = Calendar.getInstance()
newTime[Calendar.HOUR_OF_DAY] = hour
newTime[Calendar.MINUTE] = minute
var formattedtime=simpleDateFormat2.format(newTime.getTime()).toUpperCase()
filterPostTimeVal = formattedtime
},
startHour,
startMinute,
false
)
timepickerdialog.show()
And here is the theme used
<style name="DialogThemeTimePicker" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/ColorGreen</item>
</style>