示例#1
0
        protected override void OnStart()
        {
            base.OnStart();

            bt_showLocation = FindViewById(Resource.Id.bt_show_location);
            bt_showLocation.SetBackgroundColor(themeSupport.getThemeBackgroundColor());
            bt_showLocation.Click += Bt_showLocation_Click;

            toolbarApp = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            if (toolbarApp != null)
            {
                toolbarApp.Click += (sender, e) =>
                {
                    if (ThemeSupport.getCurrentGlobalTheme() == ThemeSupport.THEME_BLUE_GRAY)
                    {
                        ThemeSupport.setGlobalTheme(self, ThemeSupport.THEME_TEAL);
                    }
                    else if (ThemeSupport.getCurrentGlobalTheme() == ThemeSupport.THEME_TEAL)
                    {
                        ThemeSupport.setGlobalTheme(self, ThemeSupport.THEME_ORANGE);
                    }
                    else if (ThemeSupport.getCurrentGlobalTheme() == ThemeSupport.THEME_ORANGE)
                    {
                        ThemeSupport.setGlobalTheme(self, ThemeSupport.THEME_DEEP_PURPLE);
                    }
                    else
                    {
                        ThemeSupport.setGlobalTheme(self, ThemeSupport.THEME_BLUE_GRAY);
                    }
                };
            }
        }
示例#2
0
        protected override void OnStart()
        {
            base.OnStart();

            if (!currentActivityTheme.Equals(ThemeSupport.getCurrentGlobalTheme()))
            {
                // Reapply global theme if it has been changed.
                this.Recreate();
            }
        }