Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-8443

Android: setting orientationModes on a Ti.UI.TabGroup does not work

    Details

      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:

      "<activity
      android:configChanges="keyboardHidden|orientation"
      android:name="ti.modules.titanium.ui.TiTabActivity"
      android:screenOrientation="landscape"
      />"

      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();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                opiecyrus Opie Cyrus
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-12777
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code