protected override IMvxAndroidViewPresenter CreateViewPresenter() { var presenter = base.CreateViewPresenter(); var claimsHomeViewHandler = new BackStackHandler(ApplicationContext, typeof(MainView)); presenter.AddPresentationHintHandler <HomeNavigationHint>(hint => claimsHomeViewHandler.HandleClearBackstackHint(hint)); return(presenter); }
public static void SetStatusBarTitle(this Activity source, string title) { if (source is AppCompatActivity appCompatActivity) { var currentTitle = appCompatActivity.SupportActionBar.Title; BackStackHandler.Add(() => appCompatActivity.SupportActionBar.Title = currentTitle); appCompatActivity.SupportActionBar.Title = title; } }
public override void OnBackPressed() { if (BackStackHandler.PopCall()) { base.OnBackPressed(); return; } DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); if (drawer.IsDrawerOpen(GravityCompat.Start)) { drawer.CloseDrawer(GravityCompat.Start); } else { base.OnBackPressed(); } }