Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17272] Android: Unable to toggle the background image of a window when background color is null

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsqe-3.3.0
ReporterVisalakshi Chidambaram
AssigneeUnknown
Created2014-07-04T10:06:47.000+0000
Updated2018-02-28T20:03:46.000+0000

Description

Toggling the background image when the background color is set to null does not remove the background image. This is not a regression as it also occurs on 3.2.3. GA Steps to reproduce: Install and run the code at the bottom 1.Click on the ‘TOGGLEBGIMAGE’ button 2.Click on the ‘TOGGLEBGCOLOR’ button 3.Click on the ‘TOGGLEBGCOLOR’ button the second time 4. Click on the ‘TOGGLEBGIMAGE’ button Expected result: 1.The background image should appear 2. The background color should change to orange 3. The background color should be removed 4. The background image should be removed Actual result: 1.The image appears on the first click 2.The background color changes to orange 3.The background color is removed 4.The background image is not removed.

var _window = Titanium.UI.createWindow({  
    title:'ToggleBG',
    backgroundColor: 'white'
});

_window.modal = false ;
		_window.exitOnClose = false ;
		    
		var btn1 = Ti.UI.createButton({
		    top:10,
		    title:'TOGGLE BGIMAGE'
		});
		var btn2 = Ti.UI.createButton({
		     
		    title:'TOGGLE BGCOLOR'
		});
		 
		_window.add(btn1);
		_window.add(btn2);		 

		 
		var hasImage = false;
		var hasColor = false;
		 
		btn1.addEventListener('click',function(){
		    if(hasImage == false) {
		        _window.backgroundImage = 'KS_nav_views.png';
		    }
		    else {
		        _window.backgroundImage = null;
		    }
		    hasImage = !hasImage;
		});
		btn2.addEventListener('click',function(){
		    if(hasColor == false) {
		        _window.backgroundColor = 'orange';
		    }
		    else {
		        _window.backgroundColor = null;
		    }
		    hasColor = !hasColor;
		});
_window.open();

Comments

  1. jithinpv 2014-08-22

    Issue reproduces Titanium SDK version 3.4.0 master, 3.3.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4

JSON Source