[TIMOB-28351] Android: Update ProgressBars/ActivityIndicators to use material theme
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2021-03-05T15:56:50.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 10.0.0 |
| Components | Android |
| Labels | ActivityIndicator, ProgressIndicator, android, breaking-change, material-theme, progressbar |
| Reporter | Joshua Quick |
| Assignee | Joshua Quick |
| Created | 2021-02-12T02:53:08.000+0000 |
| Updated | 2021-03-11T02:19:44.000+0000 |
Description
*Summary:*
We should replace our usage of the native Java [ProgressBar](https://developer.android.com/reference/android/widget/ProgressBar) with the material [LinearProgressIndicator](https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicator) and [CircularProgressIndicator](https://developer.android.com/reference/com/google/android/material/progressindicator/CircularProgressIndicator) classes.
This effects the following Titanium APIs:
* [Ti.UI.ActivityIndicator](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ActivityIndicator)
* [Ti.UI.ProgressBar](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ProgressBar)
*Note:*
The material progress indicators are colored and sized differently compared to the older widgets.
https://material.io/components/progress-indicators#linear-progress-indicators
*Activity Indicator Test:*
This can be tested with the attached [^ActivityIndicatorTest.js], which will display what's shown below.
!ActivityIndicator-Android-Light.png|thumbnail! !ActivityIndicator-Android-Dark.png|thumbnail!
*Progress Bar Test:*
This can be tested with the attached [^ProgressBarTest.js], which will display what's shown below.
!ProgressBar-Android-Light.png|thumbnail! !ProgressBar-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
| File | Date | Size |
|---|---|---|
| ActivityIndicator-Android-Dark.png | 2021-02-24T02:38:49.000+0000 | 416722 |
| ActivityIndicator-Android-Light.png | 2021-02-24T02:38:47.000+0000 | 418830 |
| ActivityIndicatorTest.js | 2021-02-24T02:33:55.000+0000 | 763 |
| ProgressBar-Android-Dark.png | 2021-02-24T03:42:58.000+0000 | 412150 |
| ProgressBar-Android-Light.png | 2021-02-24T03:42:59.000+0000 | 413526 |
| ProgressBarTest.js | 2021-02-24T03:41:17.000+0000 | 787 |
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12353
FR Passed
merged to master and 10_0_X for 10.0.0 release target.