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

iOS: 'masterIsOverlayed' not working when app is in Split View Mode & Landscape

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 8.0.0
    • Component/s: iOS
    • Labels:
      None
    • Sprint:
      2018 Sprint 26, 2019 Sprint 1

      Description

      See code below.
      iPad 12.9 inch 2nd generation v12.1
      Ti SDK 7.4.1GA

      Scenario A
      Launch App and leave in full screen.

      • in Landscape - everything is fine. MasterView (on left) and DetailView (on right) are both what you'd expect.
      • in Portrait - everything is fine. The MasterView (on left) is truly 'overlayed' as defined in my .xml. You can press my Label, 'Toggle Master View', and as expected the MasterView is truly on top and when toggle off you can see the DetailView behind it.

      Scenario B
      Launch App and then go into Split View (by dragging up the dock and opening any other app beside it) and divide the 2 apps 50/50 on the screen.
      - in Landscape - THIS is where the issue exists. When you toggle, you can see the Ti.Gesture 'orientationchange' detects correctly that the view is "Portrait" (due to split screen). This is expected (even though the device is really in landscape - it operates as Portrait as defined by the SplitWindow). HOWEVER, the Master/Detail 'SplitWindow' are not behaving correctly. Try to toggle the MasterView and you'll notice that the DetailView is not behind it. The MasterView is NOT being overlayed as defined.

      • in Portrait - everything is fine. The MasterView (on left) is truly 'overlayed' as expected and again you can press that toggle label to show the DetailView behind it.

      XML:

      <Alloy>
      	<SplitWindow backgroundColor="white" showMasterInPortrait="true" masterIsOverlayed="true" platform="ios" onOpen="onFirstLaunch">
      		<!--MASTER View-->
      		<NavigationWindow id="masterNavigationWindow" platform="ios">
      			<Window title="Menu" barColor="#e4e4e4" backgroundColor="#e4e4e4" tintColor="#0069aa" class="container" layout="vertical">
      				<Label text="Label Here" />
      			</Window>
      		</NavigationWindow>
      		
      		<!--DETAIL View-->
      		<NavigationWindow id="detailNavigationWindow" platform="ios">
      			<Window title="SplitView Example" barColor="#ffffff" tintColor="#0069aa" class="container" layout="vertical" backgroundColor="#ff0000" >
      				<Label text="Toggle Master View" onClick="toggleMasterView" top="100" />
      			</Window>
      		</NavigationWindow>
      	</SplitWindow>
      </Alloy>
      

      JAVASCRIPT

      function toggleMasterView(){
      	$.masterNavigationWindow.visible = !$.masterNavigationWindow.visible;
      }
      function onFirstLaunch(){
      	setTimeout(function() {
      		updateSplitViewUI(Ti.Gesture.portrait, Ti.Gesture.landscape);
      	}, 200);
      }
      /**
       * 
       * @param {Bool} isPortrait
       * @param {Bool} isLandscape
       */
      function updateSplitViewUI(isPortrait, isLandscape){		//Ti.API.info("updateSplitView: (isPortrait:" + isPortrait + ",isLandscape:" + isLandscape + ")");
          if (isLandscape) {							//force show the Master Window in Landscape Mode
          		$.masterNavigationWindow.visible = true;
          } 
      }
      Ti.App.addEventListener('resumed', function(){
      	Ti.API.info("App Resumed");
      	Ti.Gesture.fireEvent('orientationchange');
      });
       
      Ti.App.addEventListener('paused', function(){
      	Ti.API.info("App Paused");
      });
       
      Ti.Gesture.addEventListener('orientationchange',function(e) {
      	updateSplitViewUI(e.source.portrait, e.source.landscape);
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vijaysingh Vijay Singh
                Reporter:
                amwinsauto Adam Armstrong
                Reviewer:
                Jan Vennemann
                Tester:
                Keerthi Mahalingam (Inactive)
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code