Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15353] iOS7: Window moves incorrectly when in-call/hotspot/etc. status bar is showing

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-11-14T23:23:19.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API, Release 3.2.0
ComponentsiOS
Labelsin-call, ios7, position, statusbar, triage
Reporterkosso
AssigneeVishal Duggal
Created2013-09-26T00:31:58.000+0000
Updated2015-05-30T13:09:20.000+0000

Description

Problem Description

When the "in-call status" bar is showing, new windows and then the root window change their top position incorrectly. Try this test which opens subsequent windows in a NavigationWindow (with random colors).

Steps to reproduce

In the simulator, open some windows, then in the simulator menu, go to Hardware > Toggle In-Call Status Bar. The window moves down, as expected at first. Now open some more windows, and you should see the windows showing incorrectly, despite being set at fullscreen:false Now go back to the root window and see that it's wrong too. If your app can re-orientate in tiapp.xml, it seems to reset after being upside down. Also try turning the bar off and on again.

Test Case

/* 
 
 Fun with NavigationWindow!
 
 creates random coloured windows which create buttons which create random coloured windows which create buttons which...
 you get the picture ;)
 
 Required : Titanium SDK 3.1.3 or higher.
 
 Kosso
 
*/
 
 
function randomColor(){
  return '#'+(function lol(m,s,c){return s[m.floor(m.random() * s.length)] + (c && lol(m,s,c-1));})(Math,'0123456789ABCDEF',4);
}
 
// Works with Release 3.1.3 and later
var rootWin = Ti.UI.createWindow({
		backgroundColor:randomColor(),
		fullscreen:false,
		barColor:randomColor(),
		navTintColor:randomColor(),
		translucent:false
	});
 
 
 
var b1 = Ti.UI.createButton(
	{
		title:'NEW',
		borderColor:'black',
		borderWidth:2,
		width:200,
		height:60,
		borderRadius:30,
		tintColor:'red',
		backgroundColor:'white'
	});
	
b1.addEventListener('click',function(){ 
	navWin.openWindow(buildNewWindow({
		backgroundColor:randomColor(),
		fullscreen:false,
		barColor:randomColor(),
		navTintColor:randomColor(),
		translucent:true		
	})); 
});
 
rootWin.add(b1);
 
var navWin = Ti.UI.iOS.createNavigationWindow({window:rootWin});
 
 
function buildNewWindow(args){
	
	var _self = Ti.UI.createWindow(args);
	var btn_new = Ti.UI.createButton(
	{
		title:'NEW',
		top:20,
		borderColor:'black',
		borderWidth:2,
		width:200,
		height:60,
		borderRadius:30,
		tintColor:'red',
		backgroundColor:'white'
	});	
	_self.add(btn_new);
	
	btn_new.addEventListener('click', function(){
		navWin.openWindow(buildNewWindow({
								backgroundColor:randomColor(),
								fullscreen:false,
								barColor:randomColor(),
								navTintColor:randomColor(),
								translucent:true
							}
						)
					); 
	});
 
	var btn_back = Ti.UI.createButton(
	{
		title:'< BACK',
		bottom:40,
		borderColor:'white',
		borderWidth:2,
		width:200,
		height:60,
		borderRadius:30,
		tintColor:'white',
		backgroundColor:'#333'
	});	
	_self.add(btn_back);
	
	btn_back.addEventListener('click', function(){
		navWin.closeWindow(_self);
	});	
	
	return _self;
	
}
 
 
navWin.open();


Attachments

FileDateSize
NatigationBarIncomingPhoneCall.zip2013-10-25T17:55:37.000+000075967

Comments

  1. kosso 2013-09-27

    I think this should be marked as urgent. Many of my testers use their devices as hotspots and are having to deal with this issue. It seems to reset if the device is re-oriented.
  2. Ingo Muschenetz 2013-09-27

    [~kosso] We'll investigate. All--is there a reason no severity was attached?
  3. kosso 2013-10-01

    No reason other than I missed the option to set one. This is urgent for me and my apps. I'm still waiting for a fix. I see it's now set to 'High' severity.
  4. kosso 2013-10-06

    Here's also a simpler test which shows that something VERY wrong is going on with the positioning of the root window/navWindow/(also tabGroup behaves the same) when the device is re-oriented (as well as when opening windows) WHEN the In-Call status bar is showing. Be sure to allow for orientation changes in the tiapp.xml Simply run this app.js code, activate the In-Call status bar and turn your device upside down and back upright again. app.js
       
       var rootWin = Ti.UI.createWindow({
               backgroundColor:'#ff9900',
               fullscreen:false,
               title:'test window',
               barColor:'blue',
               navTintColor:'#111',
               translucent:false
           });
       
       var top_marker = Ti.UI.createLabel({
       	text:'this is the top',
       	top:0,
       	borderWidth:4,
       	borderColor:'#000',
       	left:0,
       	width:200,
       	height:Ti.UI.SIZE
       });   
         
       rootWin.add(top_marker);
       
       var navWin = Ti.UI.iOS.createNavigationWindow({window:rootWin});
       
       navWin.open();
       
       
       
  5. kosso 2013-10-14

    Any idea when this is going to be resolved. It's pretty serious imho, since every iOS7 app will be affected by the broken window positioning when the In-call status bar is showing. I've had people waiting for an update for a couple weeks now - which does't look good for anyone. Sorry for urgency, but it seems pretty crucial to everyone.
  6. kosso 2013-10-22

    Is this going to get fixed for 3.1.3 at all? I really do NOT want to have to wait for 3.2.0 to have this fixed. Surely it's an 'easy' fix? It seems like something simple has not been taken into account when adjusting the window frame. I'm now one month late with an app update for iOS7 due to this serious bug.
  7. Ingo Muschenetz 2013-10-22

    [~kosso] We don't plan on having another official 3.1.X release, but if we fix this in the CI builds of 3.1.X, would you be able to grab the fix from there?
  8. kosso 2013-10-22

    Absolutely! :) And 'Yes Please!'
  9. Pedro Enrique 2013-10-24

    We can only reproduce this on upside down mode. Tested with native app and reproduced the same issue. This seems to be an Apple bug. Marking as not our bug.
  10. kosso 2013-10-25

    If you use either of the test codes above, with the phone the right way up and open and close new windows with the in-call status bar showing, our new window is incorrectly placed. Turning it upside down and back again seems to be the only way to fix it (until the next window is opened). Be sure to also try this with the in-call bar showing then close the app completely and re-open it. Also, the second test code will show that when the in-call status is toggled on, our app window is hidden behind it, instead of being pushed down, as it should. As you say, you might see it OK and not the right way up, but try this : While showing the bar on the device (ie: turn your hotspot on if you can) go and close the app totally and re-open it. You will see the our app window behind the hotspot status bar. Again, inverting the device and back again will fix it. Which version/branch/hash Titanium SDK are you testing this against? Since the Ti CLI 3.2.0 does not yet correctly work with detecting the Android SDKs (bug filed), I can't possibly use Titanium 3.2.0 yet.
  11. kosso 2013-10-25

  12. Ingo Muschenetz 2013-10-25

    [~kosso] I think the suggestion was that it may be a bug, but that the bug was reproducible identically in a native application, so it's an Apple bug we can't do much about until they fix it.
  13. kosso 2013-10-25

    Which 'native apps' were tested? I've just tried most of Apple's own apps with the status bar showing and all work fine as expected (try ones which allow for full-reorientation eg: iMovie) You can see the top of the window re-adjust itself in the 'native' apps I tried. Our implementation is quite simply, broken. I'd say it's 'our' bug : imho.
  14. Ingo Muschenetz 2013-10-25

    [~penrique] Can you post the native application we used to test so [~kosso] can try for himself? [~kosso], what's an example native app you used?
  15. kosso 2013-10-25

    I tried: Mail (allows portrait and landscape) Maps (allows portrait and landscape) Contacts (allows portrait and landscape) iMovie (allows all orientations) iTunes (portrait only) Facebook. + others which are portrait only. .. all work as expected. Also, if you try the first test case app.js but edit tiapp.xml to ONLY allow Ti.UI.PORTRAIT you will find the app open with the window placed incorrectly and n amount of re-orientation will fix it.
  16. Pedro Enrique 2013-10-25

    Kosso, we could only reproduce this on upside down orientation. I have a attached the native simple app I created which shows what we think is an apple bug. Can you upload you simple Titanium project? (without the build folder). I want to make sure we're testing the same exact thing.
  17. kosso 2013-10-25

    The code I'm testing is the same Test Case app.js code at the top of this bug report. Just use that with a fresh app project. It might be worth testing if it's different with a TabGroup too, as opposed to my test code which uses the new NavigationWindow.
  18. kosso 2013-10-25

    Try this test app project : https://dl.dropboxusercontent.com/u/60353877/testing.zip
  19. kosso 2013-11-08

    btw: I have noticed that the behaviour changes depending on the setting of 'UIViewControllerBasedStatusBarAppearance' which I have needed to use in tiapp.xml for on e of my apps.
                        <key>UIViewControllerBasedStatusBarAppearance</key>
                        <false/>
        
    It seems to have less issues (and more like how you described it, in that the bug appears only when upside down) when this is set to true.
  20. Ingo Muschenetz 2013-11-12

    [~kosso] Is there a reason you have to set it to false?
  21. kosso 2013-11-12

    To try and deal with this issue. It seems to mitigate the original issue down to only occurring when upside down.
  22. Ingo Muschenetz 2013-11-12

    Wait--so you have _less_ issues when you set it to _false_ or to _true_? From above it sounded as if there were less issues for you when it was set to true.
  23. kosso 2013-11-12

    When set to false (or omitted), the issues are worse and happen when the device is upright. If the hotspot/in-call bar is showing: When false: - the navbar is not positioned correctly on launch - it requires turning upside down and back again. - the navbar then slips up again when opening a new window from a TabGroup OR a NavigationWindow (tested both) When set to true: - The navbar positioning only fails when upside down (as Pedro found) - and corrects itself when put upright again. BUT.. when this is set to true I can't get the LIGHT_CONTENT status bar to work correctly - ie: show white text on dark background.
  24. Vishal Duggal 2013-11-14

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4976
  25. Pedro Enrique 2013-11-14

    Merged into master!
  26. kosso 2013-11-14

    This is such good news. Which SDK version can I now find this in? The latest master 3.2.0 CI? Or will it get rolled into 3.1.x?
  27. Vishal Duggal 2013-11-14

    3.2.0 CI. Should be available later today
  28. kosso 2013-11-14

    Thanks Vishal. Much appreciated. Hopefully Studio and CLI will play nicely too. ;)
  29. Samuel Dowse 2013-11-27

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311262027 Titanium SDK, build: 3.2.0.v20131127114913 CLI: 3.2.0-beta Alloy: 3.2.0-beta iOS Simulator: 7.0.3 Application window moves correctly when in-call. Closing
  30. erez pilosof 2014-04-13

    still happening ... not closed !
  31. erez pilosof 2014-04-14

    ok it was because of: UIViewControllerBasedStatusBarAppearance a quick hack to enable hiding status bar while not using UIViewControllerBasedStatusBarAppearance: TiWindowProxy.m: -(void)setStatusBarHide:(id)hide { hidesStatusBar=[TiUtils boolValue:hide def:YES]; if(focussed) { TiThreadPerformOnMainThread(^{ [[[TiApp app] controller] updateStatusBar]; }, YES); } }
  32. kosso 2015-05-30

    This appears to have returned since updating to Appcelerator Studio and SDK 4.0.0.GA Try the same test code above and the window is incorrectly placed when the hotspot area is visible, *after* turning the device upside down and back again. !https://mobods.com/test/hotspot_bug.png|width=400!
  33. kosso 2015-05-30

    This also happens on the simulator. Use the menu Hardware > Toggle In-call Status bar to test. Making sure to add the required orientation ability in tiapp.xml Rotating the device causes the window to _slip_ up.

JSON Source