Ejemplo n.º 1
0
 public override void OnBackPressed()
 {
     if (CurrentHostFragment == null || !CurrentHostFragment.HandleBackPressed(SupportFragmentManager))
     {
         base.OnBackPressed();
     }
 }
Ejemplo n.º 2
0
        public override void OnBackPressed()
        {
            if (CurrentHostFragment?.ChildFragmentManager?.Fragments.Count > 0)
            {
                if (CurrentHostFragment.ChildFragmentManager.Fragments?[CurrentHostFragment.ChildFragmentManager.Fragments.Count - 1] is BaseFragment currentFragment &&
                    (currentFragment.OnBackPressed() || CurrentHostFragment.HandleBackPressed(SupportFragmentManager)))
                {
                    return;
                }
            }

            base.OnBackPressed();
        }
Ejemplo n.º 3
0
        public override void OnBackPressed()
        {
            var fragments = CurrentHostFragment?.ChildFragmentManager?.Fragments;

            if (fragments?.Count > 0)
            {
                if (fragments.Last() is BaseFragment currentFragment &&
                    (currentFragment.OnBackPressed() || CurrentHostFragment.HandleBackPressed(SupportFragmentManager)))
                {
                    return;
                }
            }

            base.OnBackPressed();
        }
Ejemplo n.º 4
0
        public override void OnBackPressed()
        {
            CurrentHostFragment = _adapter.GetItem(_viewPager.CurrentItem) as HostFragment;
            var fragments = CurrentHostFragment?.ChildFragmentManager?.Fragments;

            if (fragments?.Count > 0)
            {
                var lastFragment = fragments.Last();
                if (lastFragment is ICanOpenPost openPostFrg && openPostFrg.ClosePost() ||
                    lastFragment is BaseFragment baseFrg && baseFrg.OnBackPressed())
                {
                    return;
                }
            }

            if (CurrentHostFragment == null || !CurrentHostFragment.HandleBackPressed(SupportFragmentManager))
            {
                MinimizeApp();
            }
        }