question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MaterialDatePicker OK button is not visible

See original GitHub issue

This BUG appears only on the specific devices, the “OK” button is not visible.

Current behavior:

Huawei P30 61597040133

Expected behavior:

Pixel 3: 71597040166

Source code:

 val datePicker =
                MaterialDatePicker.Builder.datePicker().setCalendarConstraints(
                    CalendarConstraints.Builder().setEnd(Date().time).build()
                ).build()
       
   datePicker.addOnPositiveButtonClickListener { newDateInMillis ->
              // do something
            }
   datePicker.showNow(supportFragmentManager!!, "datePicker")

Android API version: - 29

Material Library version: 1.1.0

Device: :Huawei P30

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wcshicommented, Aug 17, 2020

@huize could you please help verify

  1. value of @android:string/ok in that English locale, maybe try overriding mtrl_picker_confirm https://github.com/material-components/material-components-android/blob/90f041d5e737cf4facd664183f58931438e77d7f/lib/java/com/google/android/material/datepicker/res/values/strings.xml#L26
  2. Try TimePicker and let us know if the OK button is similarly cut off
0reactions
richanshahcommented, Oct 8, 2021

@wcshi thanks , its working

Read more comments on GitHub >

github_iconTop Results From Across the Web

"OK" button not showing properly in MaterialDatePicker
"OK" Button not showing in MaterialDatePicker MaterialDatePicker<Long> picker = builder.build(); picker.addOnPositiveButtonClickListener(new ...
Read more >
DatePicker OK/Cancel buttons not visible on Android
So the OK/Cancel buttons were not visible. ... it was highlighted in white and this made the selected date not visible either.
Read more >
MaterialDatePicker - Android Developers
Used to create MaterialDatePicker instances with default and overridden ... It is not called when the user clicks the cancel button.
Read more >
Datepicker - Angular Material
The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar. It is made...
Read more >
showDatePicker function - material library - Dart API
When the date picker is first displayed, it will show the month of initialDate , with initialDate selected. ... confirmText , label on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found