Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9960] Android: Window: V8 - Background color doesn't change color after each tap on some tablets

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-testadded
ReporterKanat Asanbekov
AssigneeUnknown
Created2012-07-12T18:03:49.000+0000
Updated2018-02-28T20:03:20.000+0000

Description

Description Run the attached code and note that the color does not always change to the color shown in the label, it stays black (or alternates with the color shown before rotation). Rotating the device forces the color update generally. This is not a regression, this occurs with 2.1.0GA as well. :
var _window= Ti.UI.createWindow();

// Android does not currently support: brown. The color yellow is used when a name is not recognised.

var webcolor = [
  'black', 'gray', 'darkgray', 'lightgray', 'white', 'red', 'green', 'blue', 'cyan', 'yellow',
  'magenta', 'orange', 'purple', 'brown', 'transparent',
  'aqua', 'fuchsia', 'lime', 'maroon', 'pink', 'navy', 'silver', 'olive', 'teal'];
 
var webcolorPointer = 0;
 

  _window.backgroundColor= webcolor[webcolorPointer];

  _window.fullscreen= false;
  _window.layout= 'vertical';
  _window.title= 'Webcolor Demo';
 
var label = Ti.UI.createLabel({
  backgroundColor: 'white',
  text: webcolor[webcolorPointer]
});
webcolorPointer++;
 
_window.add(label);
 
// click window to iterate through color array
_window.addEventListener('click', function(e){
  e.source.backgroundColor = webcolor[webcolorPointer];
  label.text = webcolor[webcolorPointer];
  webcolorPointer++;
  if(webcolorPointer === webcolor.length){
    webcolorPointer = 0;
  }
});

_window.open();

Steps to reproduce: 1) create new studio project with attached code and run on device 2) tap the screen Actual result: In each tap, the color of the window is black, and some "color name" label appears at the top of the screen. Expected Result: The window changes color on each tap. In each case, the color of the window should match the color name label shown at the top

Comments

  1. Shameer Jan 2013-03-01

    The problem reproduces with release 3.0.2 and master release 3.1.0 tested on: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK version: 3.1.0 (01/03/2013) Titanium SDK version: 3.0.2 (01/03/2013) Device: Samsung galaxy s duos Android version: 4.0.4 But Window changes color on each tap except in the case of "Brown" and "Transparent".It shows "Yellow" and "Black" background in response of "Brown" and "Transparent" in RELEASE 3.0.2 , "black" for both in MASTER RELEASE 3.1.0.

JSON Source