[TIMOB-15982] Android: Integrate v7 of appcompat libraries
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2014-01-21T23:48:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.3.0 |
Components | Android |
Labels | planning-3.3.0, q1-2014-candidate |
Reporter | Ingo Muschenetz |
Assignee | Hieu Pham |
Created | 2013-12-13T11:13:30.000+0000 |
Updated | 2017-03-21T23:03:20.000+0000 |
Description
Update our library usage to include appcompat v7:
http://developer.android.com/tools/support-library/features.html#v7-appcompat
This will allow Action Bar support on a wider range of Android devices. Currently, it is limited to API level 11 and above. There should be no discernible changes to most users except that the action bar now works on all Titanium-supported API levels. However, users with custom themes will have to alter them slightly as noted below.
Users can define custom themes in theme.xml then manually add it to the manifest via tiapp.xml. Here's an example of a custom theme:
<style name="Theme.Custom" parent="@android:style/Theme.Translucent">
<item name="android:windowIsFloating">true</item>
</style>
This defines "Theme.Custom" which extends Theme.Translucent (a native Android theme). In order for them to get this working with AppCompat, they need to convert this custom theme to something like this:
<style name="Theme.Custom" parent="@style/Theme.AppCompat">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:WindowIsFloating">true</item>
</style>
Note that this theme has 5 items while the previous has only one. This is because Theme.AppCompat is a base theme (i.e. not Theme.Translucent) so we need to add the items of Theme.Translucent (the first 4 items). This can be easily done by looking at the source code of Theme.Translucent:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml
Tasks for this ticket:
Duplicate of TIMOB-15021
Closing ticket as duplicate with reference to the above comments.