Material-components-android: [MaterialDatePicker] Disable InputModes

Created on 4 Jun 2020  路  2Comments  路  Source: material-components/material-components-android

Currently, using setInputMode we can set the default Input mode, e.q. INPUT_MODE_CALENDAR or INPUT_MODE_TEXT.

What I would like is to disable INPUT_MODE_TEXT at all, so just show the INPUT_MODE_CALENDAR mode, without an option to toggle between the two modes.

The API that I can think of is something like:

MaterialDatePicker.Builder.datePicker()
            .setDefaultInputMode(INPUT_MODE_TEXT)
            .setInputModes(listOf(INPUT_MODE_CALENDAR, INPUT_MODE_TEXT))
            .build()

So, renaming the setInputMode to setDefaultInputMode, and allow a list of inputModes to be set as possibilities. If there's only one option, don't show the toggle.

feature request

Most helpful comment

One of the main purposes of the input mode toggle and text input mode is to give an alternative mode of entering the date for accessibility users who may not be able to use the calendar view. For that reason we will not be making it easier to disable the mode.

All 2 comments

One of the main purposes of the input mode toggle and text input mode is to give an alternative mode of entering the date for accessibility users who may not be able to use the calendar view. For that reason we will not be making it easier to disable the mode.

Text Input mode is working for English language only. For other languages its not working properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gabrielemariotti picture gabrielemariotti  路  3Comments

mnayef95 picture mnayef95  路  3Comments

JavierSegoviaCordoba picture JavierSegoviaCordoba  路  3Comments

aarontwf picture aarontwf  路  3Comments

sepehr-alipour picture sepehr-alipour  路  3Comments