Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9819] Android: backgroundGradient on heavyweight window force-closes app

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-06-29T22:01:02.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 3.2.0
ComponentsAndroid
Labelscore, exalture, insight, module_window, qe-closed-3.3.0, qe-testadded
ReporterTim Poulsen
AssigneeSunila
Created2012-06-27T11:36:21.000+0000
Updated2014-04-29T09:52:15.000+0000

Description

Expected results

Per the changes in TIMOB-1124, I should be able to set a backgroundGradient on a heavyweight Android window (i.e. in a tab group or purposely set)

Actual results

Causes force-close. Works as expected on lightweight window.
// comment out navBarHidden and the following will work
var win = Titanium.UI.createWindow({  
    title:'Gradients',
    navBarHidden: false,
    backgroundGradient: {
        type: 'linear',
        startPoint: { x: '0%', y: '0%' },
        endPoint: { x: '100%', y: '100%' },
        colors: [ { color: '#fff', offset: 0.0}, { color: '#444', offset: 0.5 }, { color: '#fff', offset: 1.0 } ]
    }
});
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();

Comments

  1. Sunila 2013-02-25

    I fixed the crash but gradient won't be applied. nativeView is never set in TiUIView in the case of heavyweight window. https://github.com/appcelerator/titanium_mobile/pull/3906
  2. Sunila 2013-05-06

    Pull request updated to fix the gradient issue
  3. Paras Mishra 2014-04-28

    Application is not getting force closed while using backgroundGradient on heavyweight window. Verified fix on: Device : Google Nexus 4, Android Version: 4.1.1 SDK: 3.3.0.v20140425191906 CLI version : 3.3.0-dev OS : MAC OSX 10.9.2 Alloy: 1.4.0-dev ACS: 1.0.14 npm:1.3.2 Appcelerator Studio, build: 3.3.0.201404251359 titanium-code-processor: 1.1.1-alpha XCode : 5.1.1

JSON Source