public override void OnBackPressed() { if (CurrentHostFragment == null || !CurrentHostFragment.HandleBackPressed(SupportFragmentManager)) { base.OnBackPressed(); } }
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(); }
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(); }
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(); } }