Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6931] Android: JSS not working in new opened window

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-17T14:29:31.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-02, Release 2.0.0, Release 1.8.1
ComponentsAndroid
Labelsmodule_window, qe-testadded, regression
ReporterJick Steen
AssigneeAllen Yeung
Created2011-12-29T12:50:24.000+0000
Updated2012-02-03T15:49:26.000+0000

Description

Expected Behavior

The label should be displayed with a black color and positioned in the top left corner.

Actual Behavior

The definitions from bootstrap.jss are not applied - the label is gray and centered. I get the expected behavior with the Titanium 1.7.6 release on Android. It works as expected on iOS with 1.7.6 and 1.8.0.1

Test case

Ti.UI.setBackgroundColor('#ffffff');
var options = {url: 'bootstrap.js',
               className: 'mainwindow'};
var win     = Ti.UI.createWindow(options);
win.open();
.mainwindow {
    backgroundColor: '#ffffff';
    navBarHidden: true;
    fullscreen: false;
}
var message = Ti.UI.createLabel({text: 'Hello World', className:'messageLabel'});
Ti.UI.currentWindow.add(message);
.messageLabel {
    color: '#000000';
    top: '6dp';
    left: '10dp';
}

Community Discussion

[Android: JSS not working with 1.8.0.1 release (v8 and rhino) - Regression](http://developer.appcelerator.com/question/129819/android-jss-not-working-with-1801-release-v8-and-rhino---regression)

Comments

  1. Paul Dowsett 2011-12-29

    Jick I need to investigate which properties are officially supported, and to document them accordingly. See TIMOB-6930 that aims to address this. Hence, would you try the following to see if there is any improvement?
       .mainwindow {
           background-color: '#ffffff';
       }
       
    Thanks
  2. Jick Steen 2011-12-29

    Hi Paul, have tried it, but there is no improvement.
  3. Paul Dowsett 2011-12-29

    Thank you, Jick. Actually, I made a mistake with my last request. The message label text of bootstrap.js should be black, regardless. I have escalated this issue now. Thanks for reporting it, and for being so conscientious with the information you included. Much appreciated!
  4. Romain 2012-01-11

    Hi Paul, May I suggest you to change the priority of this task? Because my app has become unusable: I can't click on my links (which are stacked), my texts become unreadable (misplaced, stacked, wrong color). Until this issue is fixed, I won't be able to use Titanium 1.8.0.1 for android (whereas it works like a charm for iOS). Thanks in advance, Romain
  5. Chad 2012-01-11

    Hi Paul, This is super important for our app as well. Android runs but is useless because it has no styling. We were never able to release with a prior SDK because of the performance issues with Rhino. Thanks, Chad
  6. Wilson Luu 2012-01-17

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120117143134 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201131907 OS: Mac OS X Lion (10.7.1) Device: Droid 3 (2.3.4)
  7. Jick Steen 2012-01-19

    It still doesn't work if I copy the content of bootstrap.js to a file named "test.js" and if I replace the content of the file "bootstrap.js" with "require('test');". This works on iOS. Is this as expected?
     
       require('test');
       
       var message = Ti.UI.createLabel({text: 'Hello World', className:'messageLabel'});
       Ti.UI.currentWindow.add(message); 
       

JSON Source