Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7773] iOS: Back/close animation broken when a NavigationGroup is in a TabGroup

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-06T05:24:42.000+0000
Affected Version/sRelease 2.0.0, Release 1.8.1
Fix Version/sRelease 2.1.0, Sprint 2012-11 API
ComponentsiOS
Labelsapi, module_animation, qe-testadded
ReporterJannis H
AssigneeVishal Duggal
Created2012-02-04T10:40:40.000+0000
Updated2013-01-18T22:55:33.000+0000

Description

Problem Description

When opening a window in a NavigationGroup and then closing it again with the provided "back" button, the back animation is broken (window doesn't slide out, but just disappears). Interestingly, this does not happen, when you select another tab before you do this. If you set the debug level to trace, you see this error message in the console: "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."

Actual results

The animation is broken, and gets an error message saying: "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."

Expected results

The animation working as expected

Test Case

0) Copy-paste the included code into a new mobile project. 1) start app 2) tap "poke me to get to next window" 3) tap "My App" (back button) 4) You will see the broken animation.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win1.add(label1);

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff',
  	navBarHidden: true
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});


//Here's the first window...
var first = Ti.UI.createWindow({
  backgroundColor:"#fff",
  title:"My App"
});
var label = Ti.UI.createLabel({ text: "poke me to open the next window" });
first.add(label);

//Here's the nav group that will hold them both...
var navGroup = Ti.UI.iPhone.createNavigationGroup({
  window:first
});

//Here's a window we want to push onto the stack...
var second = Ti.UI.createWindow({
  background:"#fff",
  title:"Child Window"
});
second.add(Ti.UI.createLabel({
	top: 10,
	left: 10,
	width: 300,
	text:"If you did not select tab 1 yet, the back animation will be buggy. If you select tab 1 and come back here, the back animation works."
}));

//When the label on the first window receives a touch, open the second
label.addEventListener("click", function(e) {
  navGroup.open(second);
});

win2.add(navGroup);


//
//  add tabs
//  
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.setActiveTab(1);

// open tab group
tabGroup.open();

Extra info

If you do the following steps, the animation will work as expected. 1) start app 2) select tab 1 3) select tab 2 4) tap "poke me to get to next window" 5) tap "My App" (back button) the animation works.

Attachments

FileDateSize
app.js2012-02-04T10:40:41.000+00001866

Comments

  1. Nikolai Derzhak 2012-02-06

    This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.
  2. Jannis H 2012-02-06

    Hi Nikolai, I didn't quite understand you :-) Are you saying I should monitor the issue here because I won't get email notifications?
  3. Jannis H 2012-02-13

    Hello [~nderzhak], is there anything I can do? This is blocking a release for us at the moment, so it would be great to hear something about this, at least if it is assigned, planned to work on, etc.
  4. Jannis H 2012-02-22

    Hello? [~shossain]? [~nderzhak]? This issue is rather frustrating. Is there anything I can do to help you guys?
  5. Dmitry K 2012-05-22

    Dear Appcelerator team, can you please reply to this issue ASAP? ==> Apple has rejected my app because they didn't like broken navigation transition caused by this very bug!!! <=== I've tried just about anything for the past 2 days to create a workaround but haven't been successful. This is a show stopper for my company to continue using appcelerator! Can you please help ... or at least reply!?
  6. Dmitry K 2012-05-22

    you should also up the severity of this bug since its causing app rejections!
  7. Neeraj Gupta 2012-05-22

    @Dmitry - I have escalated this issue and bumped up the priority.
  8. Dmitry K 2012-05-22

    Thanks Neeraj -- I really appreciate it!
  9. Jannis H 2012-05-23

    The workaround we're using is to programatically switch tabs when the app starts, hidden behind an image view that looks like the app's start screen. Sucks, because it takes time. So yay! After almost 4 months since I reported it, this bug finally gets a little attention.
  10. Dmitry K 2012-05-23

    Jannis, can you please post code for your tab workaround magic? This would really help me get unblocked and I am sure it will help Neeraj with repro/fix. Thanks!
  11. Jannis H 2012-05-24

    Well, I just initially display a window that looks exactly like the splash screen. It sits on top of my normal window, which has opacity 0. Then, I add event listeners to my tabs. Each event listener listens to the 'focus' event: when it gets focused, it calls setActiveTab on the tab group to change to another tab. Each tab needs to be focused and unfocused once, and then the animation is ok. Each event listener increments a counter, so that after x times 'setActiveTab' the overlay window with the splash screen is hidden and the app is displayed.
  12. Dmitry K 2012-05-24

    Hi Jannis -- I just tried your workaround but this issue is still present. I haven't tested it on a device, but on Simulator it doesn't seem to fix it. Can you please post some sample code? Did you do anything else like tweaking tiapp.xml or ?
  13. Dmitry K 2012-05-24

    I just tried it on titanium 2.0.1.ga2 and I can confirm its also reproing there
  14. Vishal Duggal 2012-05-30

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2295
  15. Tamila Smolich 2012-06-26

    Closing as fixed. Tested and verified with: Titanium Studio, build: 2.1.0.201206251749 Titanium SDK: 2.1.0.v20120626104306 Device: iPad 3 gen (5.1.1)
  16. Shyam Bhadauria 2012-07-06

    Re-opening to edit labels
  17. Dmitry K 2012-07-18

    This issue still repro's with 2.1.0 GA as well as 2.1.1.v20120718121609 on both iphone and ipad. Can you please help?
  18. Vishal Duggal 2012-07-19

    Ran the test case on IOS Sim (4.3, 5.0,5.1), iPhone 4(5.0.1) and iPAD(4.3.5) with 2.0GA, 2.1.1 and master. Can not reproduce the issue.

JSON Source