material-components / material-components/material-components-android
[MaterialTimePicker] Hour incorrectly restored in 24 hour time format after process death
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:** When triggering process death with a MaterialTimePicker dialog opened, with 24 hour time format, the dialog is incorrectly recreated. If the time "8:00" was selected, "20:00" will be shown instead after recreation. Weirdly enough, "8" is still selected on the hour wheel. This only happens if the time was set before 12 AM.
Video:
[demo.zip](https://github.com/material-components/material-components-android/files/10314955/demo.zip)
**Expected behavior:** Update the hour display correctly after process death.
**Source code:** Open any MaterialTimePicker with time format set to 24h, then trigger process death. Only library code runs on recreation, none of mine.
**Android API version:** 33
**Material Library version:** 1.7.0
**Device:** emulator
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided demo.zip using MaterialTimePicker in 24-hour mode, then inspect the picker’s process-death recreation and state-restoration path. Done means that a pre-12 AM selection such as 8:00 is displayed as 8:00, with the hour wheel and display remaining consistent after recreation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100