Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18821] Parity: RGBA warns on iOS and is not supported on Android

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionDuplicate
Resolution Date2016-04-22T05:23:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid, iOS
Labelsparity
ReporterRene Pot
AssigneeSrikanth Sombhatla
Created2015-04-10T15:53:13.000+0000
Updated2016-04-22T05:23:24.000+0000

Description

Currently RGBA is supported on iOS, although it does give a warning. (Hex color passed looks invalid: rgba(30,30,30,0.5)). However, currently on Android it doesn't work. However, Android itself actually does support RGBA, but the other way around (ARGB). So support for it could be build properly so it works cross platform: http://developer.android.com/guide/topics/resources/more-resources.html#Color

Comments

  1. Michael Gangolf 2016-04-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/7955
  2. Chee Kiat Ng 2016-04-20

    Thanks for the PR [~michael]. [~ssombhatla] can you review? and make sure the older ARGB is deprecated not removed?
  3. Srikanth Sombhatla 2016-04-21

    [~michael] Do you have a sample app.js I can refer to verify functionality? That will be helpful.
  4. Michael Gangolf 2016-04-21

       var win = $.UI.create("Window", {
           backgroundColor: "#000"
       });
       
       var view_all = $.UI.create("View", {
           layout: "horizontal"
       });
       
       var view_bg = $.UI.create("View", {
           height: 2,
           left: 0,
           right: 0,
           top: 20,
           backgroundColor: "white"
       });
       
       var view1 = $.UI.create("View", {
           backgroundColor: "#f00",
           width: 50,
           height: 50
       });
       
       var view1 = $.UI.create("View", {
           backgroundColor: "rgb(0,    255,    0)",
           width: 50,
           height: 50
       });
       
       var view2 = $.UI.create("View", {
           backgroundColor: "rgba(0, 0 ,255, 128)",
           width: 50,
           height: 50
       });
       
       var view3 = $.UI.create("View", {
           backgroundColor: "rgba(0,0 ,255 , 0.3 )",
           width: 50,
           height: 50
       });
       
       var view4 = $.UI.create("View", {
           backgroundColor: "rgba(0,235,255,128)",
           width: 50,
           height: 50
       });
       var view5 = $.UI.create("View", {
           backgroundColor: "rgba(0.4,0.4,0.4,0.4)",
           width: 50,
           height: 50
       });
       
       win.add(view_bg);
       win.add(view_all);
       view_all.add(view1);
       view_all.add(view2);
       view_all.add(view3);
       view_all.add(view4);
       view_all.add(view5);
       
       win.open();
       
    !http://migaweb.de/rgba.png!
  5. Srikanth Sombhatla 2016-04-22

JSON Source