Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19859] Android: Deprecate Ti.Android.R.drawable

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-06T08:53:11.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid
Labelsn/a
ReporterChee Kiat Ng
AssigneeSrikanth Sombhatla
Created2015-11-04T06:59:26.000+0000
Updated2016-06-28T20:05:24.000+0000

Description

Related to TIMOB-8453, deprecating drawables since this is considered a bad practice by Google.

Comments

  1. Srikanth Sombhatla 2015-11-04

    PR https://github.com/appcelerator/titanium_mobile/pull/7399 To test use the following code. This should write a warning to console.
       var win = Ti.UI.createWindow();
       var image = Ti.UI.createImageView({
         image:Ti.Android.R.drawable.ic_menu_add
       });
       win.add(image);
       win.open()
       
  2. Srikanth Sombhatla 2015-11-06

    [~msamah] Updated PR. Please review.
  3. Ashraf Abu 2015-11-06

    PR merged.
  4. Lokesh Choudhary 2016-06-28

    Verified the fix. We see warning as below if Ti.Android.R.drawable is used:
       [WARN] :   TiRHelper: (main) [65,65] Using android.R.drawable is not recommended since they are changed/removed across Android versions. Instead copy images to res folder.
       
    Closing. Environment: Appc Studio : 4.7.0.201606150733 Ti SDK : 5.4.0.v20160617074028 Ti CLI : 5.0.9 Alloy : 1.9.0 MAC El Capitan : 10.11.4 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-20 Node: 4.4.4 Nexus 6 - Android 6.0.1

JSON Source