Esempio n. 1
0
        protected override IMvxAndroidViewPresenter CreateViewPresenter()
        {
            var presenter             = base.CreateViewPresenter();
            var claimsHomeViewHandler = new BackStackHandler(ApplicationContext, typeof(MainView));

            presenter.AddPresentationHintHandler <HomeNavigationHint>(hint => claimsHomeViewHandler.HandleClearBackstackHint(hint));
            return(presenter);
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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();
            }
        }