Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28086] Android: Update "Toolbar" to support material theme

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-03-05T15:57:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labels2020-Q4, android, breaking-change, material-theme, theme, toolbar
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-08-17T23:21:48.000+0000
Updated2021-03-05T15:57:21.000+0000

Description

*Summary:* Our [Ti.UI.Toolbar](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Toolbar) is currently using the Java [androidx.appcompat.widget.Toolbar](https://developer.android.com/reference/androidx/appcompat/widget/Toolbar) class. It should be updated to use the newer [MaterialToolbar](https://developer.android.com/reference/com/google/android/material/appbar/MaterialToolbar) class. The newer class supports the material theme. In the future, it can also be used by an [AppBarLayout](https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout) as described by ticket [TIMOB-26825] which allows the top to be hidden within a ScrollView while scrolling. *To-Do:* We must replace our usage below... * [TiToolbar.java](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiToolbar.java) * [titanium_ui_drawer_layout.xml](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/res/layout/titanium_ui_drawer_layout.xml) * [titanium_ui_toolbar.xml](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/res/layout/titanium_ui_toolbar.xml) *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.

Comments

  1. Joshua Quick 2020-12-19

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12353
  2. Samir Mohammed 2021-03-04

    FR Passed, waiting on Jenkins build and backport
  3. Christopher Williams 2021-03-05

    merged to master and 10_0_X for 10.0.0 release target.

JSON Source