Ejemplo n.º 1
0
        void Start()
        {
            appMenu    = appCanvas.GetComponentInChildren <AppMenu>(includeInactive: true);
            appScreens = appCanvas.GetComponentsInChildren <AppScreen>(includeInactive: true);

            currentScreen = splashScreen;

            appMenu?.SetUpAnimations();
            backHeaderAnimation?.SetUp();
            appHeaderAnimation?.SetUp();
            appFooterAnimation?.SetUp();

            foreach (AppScreen appScreen in appScreens)
            {
                appScreen.SetUpAnimations();
                if (appScreen != splashScreen)
                {
                    appScreen.Deactivate();
                }
            }

            splashScreen.Show();
            navigationHistory.Push(currentScreen);

            CheckAppMenuAvailability();
        }
Ejemplo n.º 2
0
        public void ReturnToPreviousScreen()
        {
            if (isTransitioningScreens || !previousScreen || (appMenu && appMenu.BeganValidDrag) || previousScreen == splashScreen)
            {
                return;
            }

            isTransitioningScreens = true;

            backButton.ResetColor();

            Sequence hideSequence = currentScreen.HideReversed();
            Sequence showSequence = previousScreen.Show();

            navigationHistory.Pop();
            currentScreen = navigationHistory.Peek();
            navigationHistory.Pop();
            previousScreen = navigationHistory.Peek();
            navigationHistory.Push(currentScreen);

            showSequence.OnComplete(() => { isTransitioningScreens = false; });

            CheckAppMenuAvailability(hideSequence);
            CheckBackHeaderAvailability(showSequence, hideSequence);
            CheckAppHeaderAvailability(showSequence, hideSequence);
            CheckAppFooterAvailability(showSequence, hideSequence);
        }
Ejemplo n.º 3
0
        void MoveToScreen(AppScreen nextScreen, bool resetCurrentOnTransitionEnd)
        {
            if (isTransitioningScreens || nextScreen == currentScreen || (appMenu && appMenu.BeganValidDrag))
            {
                return;
            }

            isTransitioningScreens = true;

            navigationHistory.Push(nextScreen);

            Sequence hideSequence = currentScreen.Hide();
            Sequence showSequence = nextScreen.Show();

            previousScreen = currentScreen;
            currentScreen  = nextScreen;

            Action <bool> onCompleteAction = (resetScreen) =>
            {
                isTransitioningScreens = false;
                if (resetScreen)
                {
                    previousScreen.ResetAnimations();
                }
            };

            showSequence.OnComplete(() => onCompleteAction(resetCurrentOnTransitionEnd));

            CheckAppMenuAvailability(hideSequence);
            CheckBackHeaderAvailability(showSequence, hideSequence);
            CheckAppHeaderAvailability(showSequence, hideSequence);
            CheckAppFooterAvailability(showSequence, hideSequence);
        }
Ejemplo n.º 4
0
 public void MoveToAppButtonLinkedScreen(AppScreen nextScreen)
 {
     MoveToScreen(nextScreen, resetCurrentOnTransitionEnd: true);
 }
Ejemplo n.º 5
0
 public void MoveToScreen(AppScreen nextScreen)
 {
     MoveToScreen(nextScreen, resetCurrentOnTransitionEnd: false);
 }