Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28353] Android: Update Date/Time picker dialogs to use material theme

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-03-05T15:56:43.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsAndroid
LabelsDatePicker, android, breaking-change, dialog, material-theme, picker
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-02-13T03:17:12.000+0000
Updated2021-03-05T15:56:43.000+0000

Description

*Summary:* We should replace our usage of the native Java [DatePickerDialog](https://developer.android.com/reference/android/app/DatePickerDialog) and [TimePickerDialog](https://developer.android.com/reference/android/app/TimePickerDialog) with the material [MaterialDatePicker](https://developer.android.com/reference/com/google/android/material/datepicker/MaterialDatePicker) and [MaterialTimePicker](https://developer.android.com/reference/com/google/android/material/timepicker/MaterialTimePicker) respectively. https://material.io/components/date-pickers https://material.io/components/time-pickers This effects the following Titanium APIs: * [Ti.UI.Picker.showDatePickerDialog()](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker-method-showDatePickerDialog) * [Ti.UI.Picker.showTimePickerDialog()](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker-method-showTimePickerDialog) *Date Dialog Test:* The date dialog can be tested with the [^DateDialogTest.js], which will display what's shown below. !DateDialog-Android-Light.png|thumbnail! !DateDialog-Android-Dark.png|thumbnail! *Time Dialog Test:* The time dialog can be tested with the [^TimeDialogTest.js], which will display what's shown below. !TimeDialog-Android-Light.png|thumbnail! !TimeDialog-Android-Dark.png|thumbnail! *Breaking-Change:* The app must use a "Theme.MaterialComponents" based theme or else an exception will occur. So, app's using a custom theme based from "Theme.AppCompat" or similar will crash. This is normal and the exception will state that the theme will need to change.

Attachments

FileDateSize
DateDialog-Android-Dark.png2021-02-23T02:56:47.000+0000456185
DateDialog-Android-Light.png2021-02-23T02:56:47.000+0000461739
DateDialogTest.js2021-02-23T02:56:25.000+0000918
TimeDialog-Android-Dark.png2021-02-23T03:01:03.000+0000452494
TimeDialog-Android-Light.png2021-02-23T03:01:06.000+0000460698
TimeDialogTest.js2021-02-23T03:01:35.000+0000624

Comments

  1. Joshua Quick 2021-02-13

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12353
  2. Satyam Sekhri 2021-03-02

    FR Passed
  3. Christopher Williams 2021-03-05

    merged to master and 10_0_X for 10.0.0 release target.

JSON Source