Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            /*( Set our view from the "main" layout resource                 */
            ViewModelLocator
            .RegisterCustomDialogService(new CustomProgressDialog(this));

            if (ThemeSwitcher.GetTheme("THEME") == null)
            {
                ThemeSwitcher.SaveTheme("THEME", "ModAppCompatLightTheme");
            }

            //Check pref theme, and set that theme
            if (ThemeSwitcher.GetTheme("THEME") == "ModAppCompatLightTheme")
            {
                SetTheme(Resource.Style.ModAppCompatLightTheme);
            }
            else
            {
                SetTheme(Resource.Style.ModAppCompatDarkTheme);
            }

            SetContentView(Resource.Layout.BottomNavLayout);

            InitializeNavigation();

            BottomNavigationMenu.Menu.GetItem(0).SetChecked(true);
        }
Ejemplo n.º 2
0
        private void Toolbar_MenuItemClick(object sender, Toolbar.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.email_button:
                StartActivity(new Intent(Intent.ActionView, Uri.Parse("https://students.pcci.edu/owa/")));
                break;

            case Resource.Id.logout_menu:
            {
                App.Locator.Main.Purge();

                File.Delete(System.Environment.GetFolderPath(
                                System.Environment.SpecialFolder.Personal) + "/" + App.DatabaseName);

                App.Locator.Main.Logout();
            }
            break;

            case Resource.Id.settings_button:
            {
                if (ThemeSwitcher.GetTheme("THEME") == "ModAppCompatLightTheme")
                {
                    ThemeSwitcher.DeleteTheme("THEME");
                    ThemeSwitcher.SaveTheme("THEME", "ModAppCompatDarkTheme");
                    Activity.SetTheme(Resource.Style.ModAppCompatDarkTheme);
                    Activity.Recreate();
                }
                else
                {
                    ThemeSwitcher.DeleteTheme("THEME");
                    ThemeSwitcher.SaveTheme("THEME", "ModAppCompatLightTheme");
                    Activity.SetTheme(Resource.Style.ModAppCompatLightTheme);
                    Activity.Recreate();
                }
            }
            break;
            }
        }