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.

[MaterialTimePicker] broken layout if reusing MaterialTimePicker

See original GitHub issue

Description: I am creating a MaterialTimePicker Instance and showing it in an DatePicker.addOnPositiveButtonClickListener method. The problem is that the layout is broken if I try to show that TimePicker instance again after closing the first one. Screenshot_20201127-150152

Expected behavior: If the MaterialTimePicker is called a second time, the layout should be shown as usual.

Source code:

    MaterialDatePicker.Builder.datePicker()
        val builder = MaterialDatePicker.Builder.datePicker()
        val pickerDialog = builder.build()
        val timePicker =
            MaterialTimePicker.Builder().setInputMode(MaterialTimePicker.INPUT_MODE_CLOCK)
                .setTimeFormat(TimeFormat.CLOCK_24H).build()

        pickerDialog.addOnPositiveButtonClickListener {
            timePicker.show(childFragmentManager, pickerDialog.tag)
        }
        timePicker.addOnPositiveButtonClickListener {

        }

        view.findViewById<Button>(R.id.button_first).setOnClickListener {
            pickerDialog.show(childFragmentManager, "")
        }

Android API version: API 30

Material Library version: 1.3.0-alpha04

Device: Google Pixel 3a

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
abd3lraoufcommented, Dec 3, 2020

Just happened to me right now

0reactions
cyb3rkocommented, Mar 2, 2021

As #1995 was closed this can also be closed because this question is just a duplicate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

setting wdullaer/MaterialTimePicker Time limit values in not ...
as expected from the documentation the time picker has a setMin/MaxTime() methods but when using it in the project none exists! android ...
Read more >
MaterialTimePicker - Styling Android
At the start of this article, I mentioned that there is currently a gotcha which can break the layout of MaterialTimePicker .
Read more >
MaterialTimePicker - Android Developers
Used to create MaterialTimePicker instances. ... The supplied listener is called when the user cancels the picker via back button or a touch ......
Read more >
jetc.dev Newsletter Issue #125
Compose Compiler now has a 1.3.0-beta01 , independent of the other ... and MaterialTimePicker from the Material Components for Android, ...
Read more >
Google rolling out Material time picker redesign on Android
The time picker UI across Google's Android apps are getting updated to a new, more touch-friendly design. Ahead of the Material You...
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