Cherish:Add ambient edge lightning settings

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
idoybh
2021-12-11 01:05:07 +00:00
committed by Hưng Phan
parent 39d8d998eb
commit fb5f6fa3ca
6 changed files with 321 additions and 0 deletions

View File

@@ -293,4 +293,38 @@
<item>2</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>
<!-- Edge lightning color mode -->
<string-array name="ambient_notification_color_mode_entries" translatable="false">
<item>@string/ambient_notification_color_mode_accent</item>
<item>@string/ambient_notification_color_mode_wall</item>
<item>@string/ambient_notification_color_mode_notification</item>
<item>@string/ambient_notification_color_mode_custom</item>
</string-array>
<string-array name="ambient_notification_color_mode_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
</resources>

View File

@@ -14,6 +14,9 @@
<!-- App Title -->
<string name="cherish_settings_title">Cherish Settings</string>
<!-- Units -->
<string name="unit_seconds">seconds</string>
<!-- Categories -->
<string name="button_title">Buttons</string>
<string name="button_summary">Hardware keys, Navigation bar</string>
@@ -402,4 +405,30 @@
<string name="always_on_display_schedule_mixed_sunset">Turns on from sunset till a time</string>
<string name="always_on_display_schedule_mixed_sunrise">Turns on from a time till sunrise</string>
<!-- Pulse notifications lightning -->
<string name="pulse_ambient_light_title">Ambient edge lightning</string>
<string name="pulse_ambient_light_summary">Light ambient edges for pulsing notifications</string>
<string name="ambient_notification_light_enabled_title">Show on AOD</string>
<string name="ambient_notification_light_enabled_summary">Keep showing edge lightning on AOD</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 edges are lighted</string>
<string name="ambient_notification_light_duration_title">Duration</string>
<string name="ambient_notification_light_duration_summary">Time it takes for each animation to complete</string>
<string name="ambient_notification_light_repeats_title">Repeats</string>
<string name="ambient_notification_light_repeats_summary">Amount of times the animation should show\n0 for infinite</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>
<string name="set_to_zero">Set repeats to 0 to enable</string>
<string name="ambient_notification_color_mode_title">Color mode</string>
<string name="ambient_notification_color_mode_accent">Accent color</string>
<string name="ambient_notification_color_mode_wall">Wallpaper dominant color</string>
<string name="ambient_notification_color_mode_notification">Notification icon color</string>
<string name="ambient_notification_color_mode_custom">@string/ambient_notification_light_color_title</string>
<string name="ambient_notification_light_color_title">Custom color</string>
</resources>

View File

@@ -83,6 +83,14 @@
android:key="charging_light"
android:fragment="com.cherish.settings.fragments.BatteryLightSettings"
android:title="@string/battery_light_settings" />
<!-- Pulse notifications lightning -->
<com.cherish.settings.preferences.SystemSettingMasterSwitchPreference
android:key="pulse_ambient_light"
android:title="@string/pulse_ambient_light_title"
android:summary="@string/pulse_ambient_light_summary"
android:fragment="com.cherish.settings.fragments.EdgeLightningSettings"
android:defaultValue="false" />
<PreferenceCategory
android:key="headsup_notifications_category"

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2020 Yet Another AOSP Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/pulse_ambient_light_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.cherish.settings.preferences.SystemSettingSwitchPreference
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" />
<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.CustomSeekBarPreference
android:key="ambient_notification_light_duration"
android:title="@string/ambient_notification_light_duration_title"
android:summary="@string/ambient_notification_light_duration_summary"
android:max="5"
settings:min="1"
settings:defaultValue="2"
settings:units="@string/unit_seconds" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="ambient_notification_light_repeats"
android:title="@string/ambient_notification_light_repeats_title"
android:summary="@string/ambient_notification_light_repeats_summary"
android:max="10"
settings:min="0"
settings: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:defaultValue="0" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="ambient_notification_color_mode"
android:title="@string/ambient_notification_color_mode_title"
android:entries="@array/ambient_notification_color_mode_entries"
android:entryValues="@array/ambient_notification_color_mode_values"
android:defaultValue="0" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="ambient_notification_light_color"
android:title="@string/ambient_notification_light_color_title" />
</PreferenceScreen>