示例#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
 public ThemeSupport getThemeSupport()
 {
     if (themeSupport == null)
     {
         themeSupport = new ThemeSupport(this);
     }
     return(themeSupport);
 }
示例#3
0
        protected override void OnStart()
        {
            base.OnStart();

            if (!currentActivityTheme.Equals(ThemeSupport.getCurrentGlobalTheme()))
            {
                // Reapply global theme if it has been changed.
                this.Recreate();
            }
        }
示例#4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            themeSupport = new ThemeSupport(this);
            if (savedInstanceState != null)
            {
                currentActivityTheme = savedInstanceState.GetString(STATE_ACTIVITY_THEME, ThemeSupport.THEME_UNDEFINED);
            }

            // MUST BE SET BEFORE setContentView
            themeSupport.updateActivityTheme();

            self = this;
        }