Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25795] Hyperloop: Android - Expose all missing Android R resource types to Ti.Android.R

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-05-23T19:38:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.3.0
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterHans Knöchel
AssigneeHans Knöchel
Created2018-02-21T20:46:43.000+0000
Updated2018-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

Comments

  1. Hans Knöchel 2018-02-21

    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

       Ti.API.info(Titanium.App.Android.R.menu.tabs);
       
    Expected behavior: No crash, no undefined values!
  2. Josh Longton 2018-07-12

    *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);

JSON Source