Пример #1
0
        private void UpdateColourSelection()
        {
            if (_accentButtons == null)
            {
                _accentButtons = new List <ImageButton>()
                {
                    SettingsPageGeneralColorOrange,
                    SettingsPageGeneralColorPurple,
                    SettingsPageGeneralColorBlue,
                    SettingsPageGeneralColorLime,
                    SettingsPageGeneralColorPink,
                };
            }
            foreach (var accentButton in _accentButtons)
            {
                accentButton.SetImageResource(Resource.Color.Transparent);
            }
            switch (AndroidColourThemeHelper.CurrentTheme)
            {
            case AndroidColorThemes.Orange:
                SettingsPageGeneralColorOrange.SetImageResource(Resource.Drawable.icon_ok);
                break;

            case AndroidColorThemes.Purple:
                SettingsPageGeneralColorPurple.SetImageResource(Resource.Drawable.icon_ok);
                break;

            case AndroidColorThemes.Blue:
                SettingsPageGeneralColorBlue.SetImageResource(Resource.Drawable.icon_ok);
                break;

            case AndroidColorThemes.Lime:
                SettingsPageGeneralColorLime.SetImageResource(Resource.Drawable.icon_ok);
                break;

            case AndroidColorThemes.Pink:
                SettingsPageGeneralColorPink.SetImageResource(Resource.Drawable.icon_ok);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            SettingsPageGeneralThemeChangeApply.Visibility =
                Converters.BoolToVisibility(Settings.SelectedTheme != MainActivity.CurrentTheme ||
                                            AndroidColourThemeHelper.CurrentTheme != MainActivity.CurrentAccent ||
                                            Settings.DarkThemeAmoled != MainActivity.IsAmoledApplied);
        }