[SQUASHED] Cherish: Add ambient pulse and aod notifications [2/2]

@/SKULSHADY - Clean up and adapted for A11

SDB: improvise the enabling/disabling of colorpicker preference to avoid fc

Co-authored-by: maxwen <max.weninger@gmail.com>
Co-authored-by: Ido Ben-Hur <idoybh2@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
maxwen
2021-05-18 13:19:07 +05:30
committed by Hưng Phan
parent 10b4dbc806
commit 2f720296ae
4 changed files with 235 additions and 16 deletions

View File

@@ -542,4 +542,53 @@
<item>7</item>
<item>8</item>
</string-array>
<!-- Ambient light -->
<string-array name="pulse_ambient_light_color_mode_entries">
<item>@string/pulse_ambient_light_color_mode_notification</item>
<item>@string/pulse_ambient_light_color_mode_wall</item>
<item>@string/pulse_ambient_light_color_mode_accent</item>
<item>@string/pulse_ambient_light_color_mode_custom</item>
</string-array>
<string-array name="pulse_ambient_light_color_mode_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="pulse_ambient_light_layout_entries">
<item>@string/pulse_ambient_light_layout_faded</item>
<item>@string/pulse_ambient_light_layout_solid</item>
</string-array>
<string-array name="pulse_ambient_light_layout_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="pulse_ambient_light_repeat_direction_entries">
<item>@string/pulse_ambient_light_repeat_direction_restart</item>
<item>@string/pulse_ambient_light_repeat_direction_reverse</item>
</string-array>
<string-array name="pulse_ambient_light_repeat_direction_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>
<!-- Edge lightning timeout -->
<string-array name="ambient_notification_light_timeout_entries" translatable="false">
<item>@string/ambient_notification_light_timeout_forever</item>
<item>@string/ambient_notification_light_timeout_half_minute</item>
<item>@string/ambient_notification_light_timeout_minute</item>
<item>@string/ambient_notification_light_timeout_three_minutes</item>
<item>@string/ambient_notification_light_timeout_five_minutes</item>
<item>@string/ambient_notification_light_timeout_ten_minutes</item>
</string-array>
<string-array name="ambient_notification_light_timeout_values" translatable="false">
<item>0</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>300</item>
<item>600</item>
</string-array>
</resources>

View File

@@ -799,4 +799,36 @@
<string name="smart_pixels_percent">Percent of pixels to disable</string>
<string name="smart_pixels_shift_title">Burn-in protection</string>
<string name="smart_pixels_shift_summary">Prevents burn-in on OLED devices by shifting pixels every so often</string>
<!-- Ambient edge lighting -->
<string name="pulse_ambient_light_category">Screen edge lighting</string>
<string name="pulse_ambient_light_title">Edge lighting</string>
<string name="pulse_ambient_light_summary">Light up the side edges of the screen on notification pulse</string>
<string name="pulse_ambient_light_color_title">Custom color</string>
<string name="pulse_ambient_light_color_mode_title">Light color</string>
<string name="pulse_ambient_light_color_mode_notification">Automatic (Notification Based)</string>
<string name="pulse_ambient_light_color_mode_wall">Automatic (Wallpaper Based)</string>
<string name="pulse_ambient_light_color_mode_accent">Accent</string>
<string name="pulse_ambient_light_color_mode_custom">Custom</string>
<string name="pulse_ambient_light_duration_title">Light duration</string>
<string name="pulse_ambient_light_repeat_count_title">Light repeat count</string>
<string name="pulse_ambient_light_show_always_title">Show always</string>
<string name="pulse_ambient_light_show_always_summary">Show lights for all doze events and not just notifications</string>
<string name="pulse_ambient_light_repeat_direction_title">Light repeat mode</string>
<string name="pulse_ambient_light_repeat_direction_restart">Restart</string>
<string name="pulse_ambient_light_repeat_direction_reverse">Reverse</string>
<string name="pulse_ambient_light_layout_title">Light view</string>
<string name="pulse_ambient_light_layout_solid">Solid</string>
<string name="pulse_ambient_light_layout_faded">Faded</string>
<string name="ambient_notification_light_enabled_title">Show on AOD</string>
<string name="ambient_notification_light_enabled_summary">Show lights on Always On Display</string>
<string name="ambient_notification_light_hide_aod_title">Hide AOD content</string>
<string name="ambient_notification_light_hide_aod_summary">Hide AOD content when lights are showing</string>
<string name="ambient_notification_light_timeout_title">Timeout</string>
<string name="ambient_notification_light_timeout_forever">Forever</string>
<string name="ambient_notification_light_timeout_half_minute">30 seconds</string>
<string name="ambient_notification_light_timeout_minute">1 minute</string>
<string name="ambient_notification_light_timeout_three_minutes">3 minutes</string>
<string name="ambient_notification_light_timeout_five_minutes">5 minutes</string>
<string name="ambient_notification_light_timeout_ten_minutes">10 minutes</string>
</resources>

View File

@@ -18,29 +18,88 @@
android:title="@string/notifications_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<!-- <PreferenceCategory
android:key="incall_vib_options"
android:title="@string/incall_vibration_category">
<PreferenceCategory
android:key="pulse_ambient_light_category"
android:title="@string/pulse_ambient_light_category" >
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="vibrate_on_connect"
android:icon="@drawable/ic_vibrate"
android:title="@string/incall_vibrate_connect_title"
android:defaultValue="true" />
android:key="pulse_ambient_light"
android:title="@string/pulse_ambient_light_title"
android:summary="@string/pulse_ambient_light_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="vibrate_on_callwaiting"
android:icon="@drawable/ic_vibrate"
android:title="@string/incall_vibrate_call_wait_title"
android:defaultValue="true" />
android:key="ambient_light_pulse_for_all"
android:title="@string/pulse_ambient_light_show_always_title"
android:summary="@string/pulse_ambient_light_show_always_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="vibrate_on_disconnect"
android:icon="@drawable/ic_vibrate"
android:title="@string/incall_vibrate_disconnect_title"
android:defaultValue="true" />
android:key="ambient_notification_light_enabled"
android:title="@string/ambient_notification_light_enabled_title"
android:summary="@string/ambient_notification_light_enabled_summary"
android:defaultValue="false" />
</PreferenceCategory> -->
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="ambient_notification_light_hide_aod"
android:title="@string/ambient_notification_light_hide_aod_title"
android:summary="@string/ambient_notification_light_hide_aod_summary"
android:defaultValue="false"
android:dependency="ambient_notification_light_enabled" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="ambient_notification_color_mode"
android:title="@string/pulse_ambient_light_color_mode_title"
android:entries="@array/pulse_ambient_light_color_mode_entries"
android:entryValues="@array/pulse_ambient_light_color_mode_values"
android:summary="%s"
android:defaultValue="0" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="ambient_notification_light_color"
android:title="@string/pulse_ambient_light_color_title"
android:defaultValue="0xFFFFFFFF" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="ambient_light_layout"
android:title="@string/pulse_ambient_light_layout_title"
android:entries="@array/pulse_ambient_light_layout_entries"
android:entryValues="@array/pulse_ambient_light_layout_values"
android:summary="%s"
android:defaultValue="1" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="ambient_notification_light_duration"
android:title="@string/pulse_ambient_light_duration_title"
android:max="5"
settings:min="1"
settings:defaultValue="2"
settings:units="sec" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="ambient_notification_light_repeats"
android:title="@string/pulse_ambient_light_repeat_count_title"
android:max="10"
settings:min="0"
settings:defaultValue="0" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="ambient_light_repeat_direction"
android:title="@string/pulse_ambient_light_repeat_direction_title"
android:entries="@array/pulse_ambient_light_repeat_direction_entries"
android:entryValues="@array/pulse_ambient_light_repeat_direction_values"
android:summary="%s"
android:defaultValue="0" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="ambient_notification_light_timeout"
android:title="@string/ambient_notification_light_timeout_title"
android:entries="@array/ambient_notification_light_timeout_entries"
android:entryValues="@array/ambient_notification_light_timeout_values"
android:summary="%s"
android:defaultValue="0" />
</PreferenceCategory>
<Preference
android:key="charging_light"