Cherish: Cleanup RGB Gradient Picker

Revert "Cherish:Introduce RGB Gradient Picker [2/2]"

This reverts commit b6057bf285.

Revert "Cherish: Introduce RGB Accenter [2/2]"

This reverts commit 22b278cc53.

Revert "Revert "Cherish:Add a toggle for the new QS tint [2/2]""

This reverts commit f1acece8c1.
This commit is contained in:
Hưng Phan
2020-05-29 21:45:42 +07:00
committed by Hung Phan
parent 316e1eda31
commit fb845ece3b
6 changed files with 12 additions and 92 deletions

View File

@@ -44,18 +44,12 @@ public class ThemeSettings extends SettingsPreferenceFragment implements
OnPreferenceChangeListener {
private static final String PREF_THEME_SWITCH = "theme_switch";
private static final String ACCENT_COLOR = "accent_color";
private static final String ACCENT_COLOR_PROP = "persist.sys.theme.accentcolor";
private static final String GRADIENT_COLOR = "gradient_color";
private static final String GRADIENT_COLOR_PROP = "persist.sys.theme.gradientcolor";
private static final String SYSUI_ROUNDED_SIZE = "sysui_rounded_size";
private static final String SYSUI_ROUNDED_CONTENT_PADDING = "sysui_rounded_content_padding";
private static final String SYSUI_STATUS_BAR_PADDING = "sysui_status_bar_padding";
private static final String SYSUI_ROUNDED_FWVALS = "sysui_rounded_fwvals";
private static final String SWITCH_STYLE = "switch_style";
private ColorPickerPreference mThemeColor;
private ColorPickerPreference mGradientColor;
private UiModeManager mUiModeManager;
private IOverlayManager mOverlayService;
private ListPreference mThemeSwitch;
@@ -128,8 +122,6 @@ public class ThemeSettings extends SettingsPreferenceFragment implements
.asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE));
mUiModeManager = getContext().getSystemService(UiModeManager.class);
setupThemeSwitchPref();
setupAccentPref();
setupGradientPref();
}
@Override
@@ -204,26 +196,6 @@ public class ThemeSettings extends SettingsPreferenceFragment implements
handleBackgrounds(true, context, UiModeManager.MODE_NIGHT_YES, ThemesUtils.MATERIAL_OCEAN);
break;
}
try {
mOverlayService.reloadAndroidAssets(UserHandle.USER_CURRENT);
mOverlayService.reloadAssets("com.android.settings", UserHandle.USER_CURRENT);
mOverlayService.reloadAssets("com.android.systemui", UserHandle.USER_CURRENT);
} catch (RemoteException ignored) {
}
}else if (preference == mThemeColor) {
int color = (Integer) objValue;
String hexColor = String.format("%08X", (0xFFFFFFFF & color));
SystemProperties.set(ACCENT_COLOR_PROP, hexColor);
try {
mOverlayService.reloadAndroidAssets(UserHandle.USER_CURRENT);
mOverlayService.reloadAssets("com.android.settings", UserHandle.USER_CURRENT);
mOverlayService.reloadAssets("com.android.systemui", UserHandle.USER_CURRENT);
} catch (RemoteException ignored) {
}
} else if (preference == mGradientColor) {
int color = (Integer) objValue;
String hexColor = String.format("%08X", (0xFFFFFFFF & color));
SystemProperties.set(GRADIENT_COLOR_PROP, hexColor);
try {
mOverlayService.reloadAndroidAssets(UserHandle.USER_CURRENT);
mOverlayService.reloadAssets("com.android.settings", UserHandle.USER_CURRENT);
@@ -286,26 +258,6 @@ public class ThemeSettings extends SettingsPreferenceFragment implements
}
}
}
private void setupAccentPref() {
mThemeColor = (ColorPickerPreference) findPreference(ACCENT_COLOR);
String colorVal = SystemProperties.get(ACCENT_COLOR_PROP, "-1");
int color = "-1".equals(colorVal)
? Color.WHITE
: Color.parseColor("#" + colorVal);
mThemeColor.setNewPreviewColor(color);
mThemeColor.setOnPreferenceChangeListener(this);
}
private void setupGradientPref() {
mGradientColor = (ColorPickerPreference) findPreference(GRADIENT_COLOR);
String colorVal = SystemProperties.get(GRADIENT_COLOR_PROP, "-1");
int color = "-1".equals(colorVal)
? Color.WHITE
: Color.parseColor("#" + colorVal);
mGradientColor.setNewPreviewColor(color);
mGradientColor.setOnPreferenceChangeListener(this);
}
private void restoreCorners() {
Resources res = null;