Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14914] Android: SDK 3.1.2.GA breaks ActionBar

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-28T22:12:45.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 18, 2013 Sprint 18 API, Release 3.1.3, Release 3.2.0
ComponentsAndroid
Labels3.1.2, actionbar, android, qe-closed-3.1.3, qe-testadded, regression, triage
ReporterMark Mokryn
AssigneePing Wang
Created2013-08-18T21:50:50.000+0000
Updated2013-09-04T06:36:10.000+0000

Description

*Problem* See attached image - a blue line runs across the action bar, and if you look closely at the logo, you can see that above it is the original Alloy icon, which refuses to go away. *Note* This behavior seems to be device dependent - on some devices it happens more than on others. *Steps to reproduce* Project is attached - click on the label in the first window to open the second window. On my device the bug happens about one in three tries - just keep closing the second window, and reopen until it occurs. May reproduce differently on different devices, based on what I saw over the last two days, but this never occurred with earlier SDKs.

Attachments

FileDateSize
actionbarbug.zip2013-08-18T21:58:37.000+00006241869
Screenshot_2013-08-19-00-24-55.png2013-08-18T21:50:50.000+000021789

Comments

  1. Ben Bahrenburg 2013-08-19

    Also happens on none Alloy projects. I am experiencing the same behavior on the S3 and Nexus 4.
  2. Ping Wang 2013-08-22

    Test case:
       function homeIconClicked() {
       	alert('clicked');
       }
       
       var win = Ti.UI.createWindow({
       	backgroundColor: 'yellow',
       	navBarHidden: false
       });
       
       win.addEventListener('focus', function(){
       	Ti.API.info("*************************** win focus");
       });
       
       win.addEventListener('blur', function(){
       	Ti.API.info("*************************** win blur");
       });
       
       win.addEventListener('open', function(){
       	Ti.API.info("*************************** win open");
               var activity = win.getActivity();
       	if (!activity){
       			alert('no activity for this window');
       			return;
       	}
       	var actionBar = activity.actionBar;
       	if (actionBar){
       			actionBar.backgroundImage = 'blackbar.png';
       			actionBar.logo = 'kitten.jpg';
       			actionBar.title = 'Window 1';
       			actionBar.displayHomeAsUp = true;
       			actionBar.onHomeIconItemSelected = homeIconClicked;
       	} else {
       			alert('no action bar');
       	}
       });
       
       win.addEventListener('click', function(){
       	
       	var win2 = Ti.UI.createWindow({
       		backgroundColor : 'blue',
       		navBarHidden : false
       	});
       
       	win2.addEventListener('focus', function(){
       		Ti.API.info("*************************** win2 focus");
       	});
       
       	win2.addEventListener('blur', function(){
       		Ti.API.info("*************************** win2 blur");
       	});
       
       	win2.addEventListener('open', function() {
       		Ti.API.info("*************************** win2 open");
                       var activity = win2.getActivity();
       		if (!activity) {
       			alert('no activity for this window');
       			return;
       		}
       		var actionBar = activity.actionBar;
       		if (actionBar) {
       			actionBar.backgroundImage = 'blackbar.png';
       			actionBar.logo = 'kitten.jpg';
       			actionBar.title = 'Window 2';
       			actionBar.displayHomeAsUp = true;
       			actionBar.onHomeIconItemSelected = homeIconClicked;
       		} else {
       			alert('no action bar');
       		}
       	}); 
       	
       	win2.open();
       })
       
       win.open();
       
  3. Ping Wang 2013-08-22

    PR: https://github.com/appcelerator/titanium_mobile/pull/4598 For FR: 1. Run the above test case on a few different devices. Check the log should see the "open" and "focus" events are fired in the correct order. 2. Click the yellow window. Should see the blue window opens and the action bar shows correctly. 3. Click the BACK button to close the blue window. 4. Repeat step 2-3 several times to make sure the action bar always shows correctly. 5. Run KS as a sanity check. 6. Run Anvil. Should be 370 passed / 36 failed. 7. Please also test TC-2796. It seems like a duplicate.
  4. Mark Mokryn 2013-08-22

  5. Mark Mokryn 2013-08-25

  6. Ping Wang 2013-08-28

    3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4621
  7. Paras Mishra 2013-08-29

    I was able to reproduce the issue on android 4.1.2 Device and 4.0.4 Device with 3.1.2.GA sdk. ActionBar is not getting broken with the 3.1.3 SDK build. How ever I could not test on 3.2.0 sdk build as I am not able to build the project with 3.2.0 sdk build. Bug is logged as TIMOB-14893 regarding build error. Verified fixed on: Device : Google Nexus 7, Android Version: 4.1, Device : Google Nexus 3, Android Version: 4.0.4, SDK: 3.1.3.v20130828171413 CLI version : 3.1.2 OS : MAC OSX 10.8.4 Alloy : 1.2.1 Appcelerator Studio, build: 3.1.3.201308252005 XCode : 5.0
  8. Lokesh Choudhary 2013-08-29

    Verified the fix & the action bar no longer breaks. Thus closing. Environment: Appcel Studio : 3.1.3.201308252005 Ti SDK : 3.1.3.v20130828171413 Mac OSX : 10.8.4 Android Devices : 4.0.4 ,4.1.2, 4.3

JSON Source