[TIMOB-25795] Hyperloop: Android - Expose all missing Android R resource types to Ti.Android.R
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-23T19:38:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android, Hyperloop |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2018-02-21T20:46:43.000+0000 |
Updated | 2018-07-12T16:52:58.000+0000 |
Description
We support a couple of Android R resources types in Titanium [already](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.R).
With having Hyperloop these days, we are able to perform powerful Android interactions like the BottomNavigationView, RecyclerView API's. It's convenient to load the views via XML and configure them via colors and strings inside the platform/android/res/ directory. For a concrete use-case, we need to load a
menu
resource for the bottom navigation view, which would be Ti.Android.R.menu.xxxx
, but the menu
namespace is not exposed. Therefore, this ticket proposes a tiny change that basically adds all (current) Android R resources types to our resource lookup map, so developers can use the official SDK API's instead of hacking it together like in the example.
Missing properties:
- animator
- bool
- fraction
- interpolator
- menu
- mipmap
- plurals
- raw
- transition
- xml
Test-case:
Create a new Titanium Alloy app
Add the attached file "tabs.xml" to app/platform/android/res/menu (needs to be created as well)
Paste the following code into the new app
Expected behavior: No crash, no undefined values!
*Closing ticket.* The fix is present in SDK: {noformat} 7.3.0.v20180711185043 {noformat} Tested using the hyperloop example app and
Ti.API.info(Titanium.App.Android.R.menu.tabs);