Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8443] Android: setting orientationModes on a Ti.UI.TabGroup does not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-13 API, Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19
ComponentsAndroid
Labelsapi, module_tabgroup, parity, qe-testadded
ReporterOpie Cyrus
AssigneeHieu Pham
Created2012-03-30T09:39:39.000+0000
Updated2018-09-28T15:06:27.000+0000

Description

Setting orientationModes on a tab group proxy seems to have no effect. This can be observed in the tab layout in KS by trying to force orientationModes. A work around is to set the orientation in the tiapp.xml via: "" A fix should be investigated though to allow for setting the orientation modes in a programmatic way. In addition, it appears that setting the orientation modes for a window on a tab have no effect either.

TabGroup orientationMode example

1. Run the code bellow in an application. 2. Initially the orientations of the group should be locked in both left and right landscape. 3. Click the 'Toggle orientationModes' button. 4. You should now be able to orientate the group in all modes (ex: landscape, portrait). 5. Click the toggle button again. Should lock the group back into landscape only mode. 6. Repeat until you are satisfied.

var modes = [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT];
var modesEnabled = true;

var tabGroup = Ti.UI.createTabGroup({
  orientationModes: modes
});

var tabWindow = Ti.UI.createWindow();
tabGroup.addTab(Ti.UI.createTab({window: tabWindow, title: 'Lonely tab'}));

var toggleModesButton = Ti.UI.createButton({
  title: 'Toggle orientationModes'
});
toggleModesButton.addEventListener('click', function() {
  tabGroup.orientationModes = modesEnabled ? [ ] : modes;
  modesEnabled = !modesEnabled;
});
tabWindow.add(toggleModesButton);

tabGroup.open();

Comments

  1. Josh Roesslein 2012-06-06

    On hold until we can have a parity discussion on supporting setting orientation modes per a tab.
  2. Josh Roesslein 2012-07-11

    This ticket will only focus on fixing orientation modes on the group. This will NOT fix setting orientation modes per a tab window. Another ticket should be opened to address that issue.
  3. Josh Roesslein 2012-07-11

    Created [PR #2543](https://github.com/appcelerator/titanium_mobile/pull/2543) to resolve issue.
  4. Olga Romero 2012-08-09

    Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.2.0 HTC EVO 4.0.3
  5. Olga Romero 2012-08-09

    reopened to correct comment
  6. Shyam Bhadauria 2012-08-10

    Re-opening to edit label
  7. Shyam Bhadauria 2012-08-21

    Occurs on: Titanium SDK: 2.1.2.v20120816171609 Titanium  Studio: 2.1.2.201208192014 Device: Samsung GALAXY Note (2.3.6) Fixed with: SDK version: 2.2.0
  8. Bill Dawson 2012-09-10

    Re-opening due to regression seen in a newer PR: https://github.com/appcelerator/titanium_mobile/pull/2794#issuecomment-8430975 ...but not caused by that newer PR. Namely: If you set targetSdkVersion to 14 and run this fail case, app crashes right away with: https://gist.github.com/64ba7b65be6e668b4fb6 I'll put it in Sprint 19, but of course feel free to move it won't make it.
  9. Hieu Pham 2012-09-19

  10. Anshu Mittal 2013-09-17

    Tested with: SDK: 3.1.3.v20130916153052 Appcelertaor Studio: 3.1.3.201309132456 OS: OSX 10.8.4 Device: iPod touch2(iOS7) Xcode: 5.0 GM seed alloy@1.2.2-cr CLI version : 3.1.2 Clicking the 'toggle orientation mode' does not make the app support Portrait orientation mode.
  11. Paras Mishra 2013-11-22

    Clicking the 'toggle orientation mode does not make the app stay on Portrait only mode then it can be changed to any any orientation.

JSON Source