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 fully visible (3 dots)

See original GitHub issue

This BUG appears only on the specific devices, the “OK” button is not fully visible, and it displays as a “3 dots”.

Current behavior: Nokia 7 Plus 85e24d84-ab07-44ea-a83f-576edfa8f8a9

Expected behavior: Pixel 3: IMAGE 2020-05-29 20:04:36

Source code: Extension function:

fun AppCompatActivity.datePicker(
    titleId: Int? = null,
    minusYears: Int = 0,
    minusDay: Int = 0,
    startDate: Long? = null,
    datePattern: String = DMY,
    dateChosen: (String, Long) -> Unit
) {
    val endDate = LocalDate().minusYears(minusYears).minusDays(minusDay)
    MaterialDatePicker.Builder.datePicker().apply {
        titleId?.let { setTitleText(it) }
        setCalendarConstraints(CalendarConstraints.Builder().apply {
            startDate?.let { setStart(it) }
            setEnd(endDate.toDate().time)
        }.build())
    }.build().run {
        addOnPositiveButtonClickListener {
            dateChosen.invoke(DateTime(it).toLocalDate().toString(datePattern), it)
        }
        show(supportFragmentManager, toString())
    }
}

On the place of call:

datePicker(
                R.string.some_str,
                PAST_18_YEARS,
                PAST_1_DAY
            ) { date, timestamp ->
                espUser.birthDate = timestamp.mlsToSeconds()
            }

Android API version: - 29

Material Library version: 1.2.0-alpha06

Device: : Nokia 7 Plus

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
matecheck27commented, Apr 7, 2021

Hello, I just want to update this thread, we’ve fixed this bug by overriding the string resource used by material design.

just put this in your string xml <“string name=“mtrl_picker_confirm” description=“Button text to indicate that the widget will save the user’s selection [CHAR_LIMIT=16]”>OKAY</string”>

by the way, we’re using, 1.4.0-alpha02 version.

note: remove the (“” double quote) inside “<”

1reaction
HariniAndroidcommented, Jan 20, 2021

Team is there any Update regarding this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"OK" button not showing properly in MaterialDatePicker
When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on ......
Read more >
Material datepicker dialog in android studio | Date picker
In this video we are going to learn how to create material date picker in android studioIf you have any questions or queries...
Read more >
DatePicker OK/Cancel buttons not visible on Android
I added DatePicker in my app. However, when I tested it, I found that on Android the calendar's OK/Cancel buttons were colored white...
Read more >
B4A Library AppCompat - Make Material Design apps ... - B4X
The ACActionMenu is a complete View you can add to your layout. It can have action items like an ActionBar or just the...
Read more >
Visual Feedback: Dialogs, Snackbars and Toasts
Providing visual feedback to the user is very important. In this tutorial, you'll learn about ... Underneath the cards are three buttons.
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