Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1124] Android: Add support for backgroundGradient on views

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-06T23:49:55.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 API
ComponentsAndroid
Labelsapi, parity, qe-testadded
ReporterDon Thorp
AssigneeJosh Roesslein
Created2011-04-15T02:44:40.000+0000
Updated2013-11-07T05:38:30.000+0000

Description

Implement backgroundGradient support on Android. Note: Only linear gradient is supported. A future task will be created to implement radial support.

Linear Gradient Test Case

var win = Ti.UI.createWindow({backgroundColor: 'black'});

var linearGradient = Ti.UI.createView({
    top: 10,
    width: 100,
    height: 100,
    backgroundGradient: {
        type: 'linear',
        startPoint: { x: '0%', y: '50%' },
        endPoint: { x: '100%', y: '50%' },
        colors: [ { color: 'red', offset: 0.0}, { color: 'blue', offset: 0.25 }, { color: 'red', offset: 1.0 } ]
    }
});
win.add(linearGradient);

win.open();
Compare rendering against iOS & MobileWeb to verify correct behavior.

Attachments

FileDateSize
android.png2012-06-11T15:34:11.000+000016889
iOS.png2012-06-11T15:34:11.000+0000119521

Comments

  1. Dawson Toth 2011-04-15

    klist'd

  2. Josh Roesslein 2012-06-04

    TIMOB-9366 is the task for implementing radial gradient support.
  3. Josh Roesslein 2012-06-04

    Pull request [#2313](https://github.com/appcelerator/titanium_mobile/pull/2313) ready.
  4. Dustin Hyde 2012-06-11

    Closing as Fixed. Attaching screenshots of fixed android and current ios behavior. SDK: 2.1.0.v20120608174150 Studio: 2.1.0.201206081630 OS: Snow Leopard Android Runtimes: V8 Devices Tested: Nexus One 2.2.2, Galaxy Nexus 4.0.3
  5. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4887

JSON Source