[MaterialDatePicker] Set different text values for different calendars
See original GitHub issueIs your feature request related to a problem? Please describe. It is only possible to override strings globally.
Describe the solution you’d like I want to be able to set different text values for different date pickers.
Describe alternatives you’ve considered I’ve overridden the strings globally, but I want to set different text values for different calendars. I have not been able to find a way to do this. Is it possible?
<string name="mtrl_picker_cancel" description="Placeholders for two dates separated by a dash representing a range [CHAR_LIMIT=60]" tools:override="true">Overridden value</string>
I have tried creating an attribute with the same name and overriding it in my theme, but it has no effect.
<attr name="mtrl_picker_cancel" />
<style name="MaterialComponentsThemeBlueAvailableDates" parent="MaterialComponentsTheme">
<item name="materialCalendarTheme">@style/OurMaterialCalendar</item>
<item name="mtrl_picker_cancel">Overridden value</item>
</style>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to set texts on MaterialDatePicker? - Stack Overflow
You can use the builder.setSelection method: val builder = MaterialDatePicker.Builder.dateRangePicker() val selection = Pair(startDate ...
Read more >Date pickers - Material Design
Calendar date pickers can be used to select dates in the near future or past, when it's useful to see them in a...
Read more >MaterialDatePicker - Android Developers
Date picker will start with calendar view. int, INPUT_MODE_TEXT. Date picker will start with input text view.
Read more >Date Picker - Android Studio Tutorial - YouTube
Hello World,Welcome to another MDC tutorial.This tutorial will cover implementing Date Pickers.
Read more >More Functionalities of Material Design Date Picker in Android
set the validator point forward from june ... material date picker Calendar constraints ... now update selected date preview text.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think thats currently not possible. I’m waiting at this issue https://github.com/material-components/material-components-android/issues/1268 . As soon as we are able to customize our selectors we can also customize titles, names and other things on the datepicker (for example disabling text input).
Other tags for changing date range picker texts.
<string tools:override="true" name="mtrl_picker_save">Kaydet</string> <string tools:override="true" name="mtrl_picker_range_header_title">Tarih Aralığı Seçiniz</string> <string tools:override="true" name="mtrl_picker_input_range_start">Başlangıç</string> <string tools:override="true" name="mtrl_picker_range_header_only_end_selected">Başlangıç – %1$s</string> <string tools:override="true" name="mtrl_picker_range_header_only_start_selected">%1$s – Bitiş</string> <string tools:override="true" name="mtrl_picker_range_header_selected">%1$s – %2$s</string> <string tools:override="true" name="mtrl_picker_range_header_unselected">Başlangıç – Bitiş</string> <string tools:override="true" name="mtrl_picker_text_input_date_hint">Tarih</string> <string tools:override="true" name="mtrl_picker_text_input_date_range_end_hint">Bitiş Tarihi</string> <string tools:override="true" name="mtrl_picker_text_input_date_range_start_hint">Başlangıç Tarihi</string> <string tools:override="true" name="mtrl_picker_text_input_day_abbr">g</string> <string tools:override="true" name="mtrl_picker_text_input_month_abbr">a</string> <string tools:override="true" name="mtrl_picker_text_input_year_abbr">y</string> <string tools:override="true" name="mtrl_picker_invalid_format">Hatalı format.</string> <string tools:override="true" name="mtrl_picker_invalid_format_example">Örnek: %1$s</string> <string tools:override="true" name="mtrl_picker_invalid_format_use">Format: %1$s</string> <string tools:override="true" name="mtrl_picker_invalid_range">Hatalı aralık.</string>