"i'm using google's material date picker 'com.google.android.material:material:1.1.0-alpha10' version,and i want to disable the input method through keyboard,is there a way to disable/hide the edit method"
you can use custom style as workaround to disable calendar input mode toggle. This toggle uses style attribute materialCalendarHeaderToggleButton, so:
<style name="Widget.AppTheme.MaterialDatePicker" parent="ThemeOverlay.MaterialComponents.MaterialCalendar">
<item name="materialCalendarHeaderToggleButton">@style/Widget.AppTheme.MaterialCalendar.HeaderToggleButton</item>
<style name="Widget.AppTheme.MaterialCalendar.HeaderToggleButton" parent="Widget.MaterialComponents.MaterialCalendar.HeaderToggleButton">
<item name="android:visibility">gone</item>
And after that apply theme with:
MaterialDatePicker.Builder.dateRangePicker()
.setTheme(R.style.Widget_AppTheme_MaterialDatePicker)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With