[TIMOB-5002] Android: setting android:screenOrientation for an activity in AndroidManifest.xml does not work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2012-02-10T00:33:26.000+0000 |
Affected Version/s | Release 1.7.2, Release 1.8.0.1 |
Fix Version/s | n/a |
Components | Android |
Labels | qe-testadded, regression |
Reporter | Jon Alter |
Assignee | Opie Cyrus |
Created | 2011-08-15T08:49:10.000+0000 |
Updated | 2012-02-10T00:33:26.000+0000 |
Description
setting android:screenOrientation for an activity in AndroidManifest.xml does not work with 1.7.2 but it does with 1.6.2
Step 1: run the code below
Step 2: use a custom AndroidManifest.xml (documented in the wiki)
Step 3: add android:screenOrientation="portrait" to the TiTabActivity in the AndroidManifest.xml
<activity android:name="ti.modules.titanium.ui.TiTabActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation" />
Step 4: launch the app
Step 5: rotate the device
Step 6: notice that the tabGroup does not rotate if you run this in 1.6.2 but it does rotate in 1.7.2
var tabGroup = Titanium.UI.createTabGroup();
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);
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
Workaround
Use the orientationModes property of window
win2.orientationModes = [
Titanium.UI.PORTRAIT
];
Associated Helpdesk Ticket
http://appc.me/c/APP-688371Attachments
File | Date | Size |
---|---|---|
TiTest.zip | 2011-09-07T12:37:47.000+0000 | 7935433 |
Tried removing android:configChanges="keyboardHidden|orientation" from the tag. It had no affect on the rotation not working.
Attaching test app that shows overriding the orientation mode in the tiapp.xml
Reopening bug. Bug persists on: SDK build: 1.8.0.1.RC3 Runtime: V8, Rhino Titanium Studio, build: 1.0.7.201112152014 Device: Android Emulator 2.2, Nexus One (2.2.2) OS: Mac OS X Lion Note: To test the custom AndroidManifest: 1. Create a *platform* folder at the same level as Resource 2. Create an *android* folder in the *platform* folder 3. Add the AndroidManifest.xml to the *android* folder
Unable to reproduce the issue against 1.9.0 with the following AndroidManifest.xml put in the platform/android location.
This works with 1.9.0 but not 1.7.5 Just tested with your AndroidManifest.xml Opie.
closing as we are not able to reproduce using master (1.9.0 Feb 9 2012 09:46 rd47ce8a4). fix will not be seen in 1.7.X branches