From 0b00bfbb9fbe1ad9f7972a576e670d9087880545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C6=B0ng=20Phan?= Date: Fri, 13 Jan 2023 13:42:33 +0700 Subject: [PATCH] Revert "Cherish:add edge light customizations[2/2]" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c54c2eb6c2a11db69fe17e6448c06094ef3c2498. Revert "Cherish:update edge light preferences" This reverts commit b88457ea22bf6162163fd28c72f8adfc4622729f. Signed-off-by: Hưng Phan --- res/values/cherish_arrays.xml | 15 --- res/values/cherish_strings.xml | 16 ---- res/xml/cherish_settings_edge_light.xml | 52 ----------- res/xml/cherish_settings_lockscreen.xml | 6 -- ...dgeLightColorPickerPreferenceController.kt | 92 ------------------- .../settings/lockscreen/EdgeLightSettings.kt | 87 ------------------ 6 files changed, 268 deletions(-) delete mode 100644 res/xml/cherish_settings_edge_light.xml delete mode 100644 src/com/cherish/settings/lockscreen/EdgeLightColorPickerPreferenceController.kt delete mode 100644 src/com/cherish/settings/lockscreen/EdgeLightSettings.kt diff --git a/res/values/cherish_arrays.xml b/res/values/cherish_arrays.xml index 8a56813..b4fb303 100644 --- a/res/values/cherish_arrays.xml +++ b/res/values/cherish_arrays.xml @@ -498,21 +498,6 @@ 1800000 - - - @string/accent_color - @string/notification_color - @string/wallpaper_color - @string/custom_color - - - - 0 - 1 - 2 - 3 - - 12 diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index fa7b276..1a60931 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -681,22 +681,6 @@ Replace heads-up notification with slim and less invasive version of redesigned ticker Use app colored background Replace reTicker background color using notification app main color - - - Edge light - Enable Edge Light - Display an animation along the edges of the screen when pulsing - Always trigger on pulse - Whether to show edge light whenever ambient display is shown and not just for notifications - Repeat animation - Repeat until timeout - Show only once - Edge light color mode - Accent color (Default) - Notification color - Wallpaper color - Custom color - Custom color Power/reboot menu opacity diff --git a/res/xml/cherish_settings_edge_light.xml b/res/xml/cherish_settings_edge_light.xml deleted file mode 100644 index ffd3a1c..0000000 --- a/res/xml/cherish_settings_edge_light.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/res/xml/cherish_settings_lockscreen.xml b/res/xml/cherish_settings_lockscreen.xml index 9173bda..3907698 100644 --- a/res/xml/cherish_settings_lockscreen.xml +++ b/res/xml/cherish_settings_lockscreen.xml @@ -33,12 +33,6 @@ android:entries="@array/torch_power_button_gesture_entries" android:entryValues="@array/torch_power_button_gesture_values" /> - - (MAIN_SWITCH_KEY)?.also { - updatePreferences(it.isChecked) - it.addOnSwitchChangeListener(this) - } - } - - override protected fun getPreferenceScreenResId() = R.xml.cherish_settings_edge_light - - override protected fun getLogTag() = TAG - - override protected fun createPreferenceControllers( - context: Context - ): List = buildPreferenceControllers(context, settingsLifecycle) - - override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) { - updatePreferences(isChecked) - } - - private fun updatePreferences(isChecked: Boolean) { - preferenceScreen.forEachIndexed { _, preference -> - if (preference !is MainSwitchPreference && - preference !is TopIntroPreference - ) preference.isVisible = isChecked - } - } - - companion object { - private const val TAG = "EdgeLightSettingsFragment" - - private const val MAIN_SWITCH_KEY = "edge_light_enabled" - private const val CUSTOM_COLOR_PREFERENCE_KEY = "edge_light_custom_color" - - private fun buildPreferenceControllers( - context: Context, - lifecycle: Lifecycle?, - ): List = listOf( - EdgeLightColorPickerPreferenceController(context, CUSTOM_COLOR_PREFERENCE_KEY, lifecycle) - ) - - @JvmField - val SEARCH_INDEX_DATA_PROVIDER = object : BaseSearchIndexProvider(R.xml.cherish_settings_edge_light) { - override fun createPreferenceControllers( - context: Context - ): List = buildPreferenceControllers( - context, null /* lifecycle */) - } - } -} \ No newline at end of file