Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4551] iOS: window.open with transition on 1.7.0/1.8.0

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-01-20T16:21:51.000+0000
Affected Version/sRelease 1.7.1
Fix Version/sSprint 2012-02, Release 2.0.0, Release 1.8.1
ComponentsiOS
Labelsregression
ReporterAdriano Paladini
AssigneeStephen Tramer
Created2011-06-01T13:20:41.000+0000
Updated2012-01-23T09:26:59.000+0000

Description

Open a new window with an transition, then close this opened window to return on first window. The first window will show a black screen. This work correctly in 1.5.2 and 1.6.2 sample code for reproduce:
Ti.UI.setBackgroundColor('#000');

var win1 = Ti.UI.createWindow({
  backgroundColor: 'white'
});
var btn1 = Ti.UI.createButton({
  title: 'Goto 2 - without animation (no error)',
  width:300,
  height:100,
  top:100
});
var btn2 = Ti.UI.createButton({
  title: 'Goto 2 - with animation (with error)',
  width:300,
  height:100,
  top:220
});

btn1.addEventListener('click', function(e){
  var win2 = Ti.UI.createWindow({
    backgroundColor: 'blue'
  });
  win2.open();

  var btn3 = Ti.UI.createButton({
    title: 'Go back',
    width:300,
    height:100
  });

  btn3.addEventListener('click', function(e){
    win2.close();
  });

  win2.add(btn3);
});

btn2.addEventListener('click', function(e){
  var win2 = Ti.UI.createWindow({
    backgroundColor: 'blue'
  });
  win2.open({transition:Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT});

  var btn3 = Ti.UI.createButton({
    title: 'Go back',
    width:300,
    height:100
  });

  btn3.addEventListener('click', function(e){
    win2.close();
  });

  win2.add(btn3);
});

win1.add(btn1);
win1.add(btn2);
win1.open();

Comments

  1. Paul Dowsett 2011-06-13

    In order to progress this ticket, please provide the following information: * Titanium SDK version + build date + build hash * iOS version Note that environment information should be entered to the environment field. Thanks
  2. Paul Dowsett 2011-06-13

    Further to this, your code does not work. Please correct, and I will take another look. Thanks
  3. Adriano Paladini 2011-06-14

    Hi Paul, I tested today with last version of 1.7.1 and 1.8.0 again from http://builds.appcelerator.com.s3.amazonaws.com/index.html This error persists, and the code provide work. create a new project and paste this code on app.js.
  4. Kieran Black 2011-07-03

    I also noted this error on upgrading to 1.7.0.RC1 https://gist.github.com/1062247
  5. Paul Dowsett 2011-07-05

    Adriano Your code was not a proper usecase - it did not run successfully, not least because it was missing the win2 creation code. Please see Kieran's usecase, which is a very good example. Thanks
  6. Stephen Tramer 2011-11-23

    Should be postponed until after freeze. This bug requires extensive fixes to how we manage views on the root controller when animating windows in/out and could introduce regressions in the fix.
  7. Stephen Tramer 2011-11-29

    Likely a duplicate of another bug that I worked on recently; will be linked in additional triage.
  8. Stephen Tramer 2011-12-29

    Re-validated, 1.9.0.46d2d6f.
  9. Stephen Tramer 2012-01-19

    Updated reproduction sample code:
       // --- Win1 ---
       var win1 = Ti.UI.createWindow({
           backgroundColor:'red'
       });
       var btn1 = Ti.UI.createButton({
           title:'Open win2',
           height:40,
           width:100
       })
       btn1.addEventListener('click', function(){
           win2.open({
               transition : Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
           });
       });
       win1.add(btn1);
       
       // --- Win2 ---
       var win2 = Ti.UI.createWindow({
           backgroundColor:'#369'
       });
       var btn2 = Ti.UI.createButton({
           title:'Close win2',
           top:100,
           height:40,
           width:100    
       })
       btn2.addEventListener('click', function(){
           win2.close({
           	transition: Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT
           });
       });
       win2.add(btn2);
       
       var btn3 = Ti.UI.createButton({
       	title:'Open win3',
       	top:160,
       	height:40,
       	width:100
       });
       btn3.addEventListener('click', function(){
       	win3.open({
       		transition: Ti.UI.iPhone.AnimationStyle.CURL_UP,
       	});
       });
       win2.add(btn3);
       
       // --- Win3 ---
       win3 = Ti.UI.createWindow({
       	backgroundColor:'green'
       });
       var btn4 = Ti.UI.createButton({
       	title:'Close win3',
       	height:40,
       	width:100
       });
       btn4.addEventListener('click', function() {
       	win3.close({
       		transition: Ti.UI.iPhone.AnimationStyle.CURL_DOWN,
       	});
       });
       win3.add(btn4);
       
       win1.open();
       
  10. Wilson Luu 2012-01-23

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120121223134 Titanium Studio, build: 1.0.8.201201210622 Xcode: 4.2 OS: Mac OS X Lion (10.7.2) Device: iPhone 4S Verizon (5.0.1)

JSON Source