Cherish:[SQUASH]Allow scheduling always on display and Add support for mixed time & sun modes [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
7
res/drawable/ic_upset.xml
Normal file
7
res/drawable/ic_upset.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M7.5,2C5.71,3.15 4.5,5.18 4.5,7.5C4.5,9.82 5.71,11.85 7.53,13C4.46,13 2,10.54 2,7.5A5.5,5.5 0 0,1 7.5,2M19.07,3.5L20.5,4.93L4.93,20.5L3.5,19.07L19.07,3.5M12.89,5.93L11.41,5L9.97,6L10.39,4.3L9,3.24L10.75,3.12L11.33,1.47L12,3.1L13.73,3.13L12.38,4.26L12.89,5.93M9.59,9.54L8.43,8.81L7.31,9.59L7.65,8.27L6.56,7.44L7.92,7.35L8.37,6.06L8.88,7.33L10.24,7.36L9.19,8.23L9.59,9.54M19,13.5A5.5,5.5 0 0,1 13.5,19C12.28,19 11.15,18.6 10.24,17.93L17.93,10.24C18.6,11.15 19,12.28 19,13.5M14.6,20.08L17.37,18.93L17.13,22.28L14.6,20.08M18.93,17.38L20.08,14.61L22.28,17.15L18.93,17.38M20.08,12.42L18.94,9.64L22.28,9.88L20.08,12.42M9.63,18.93L12.4,20.08L9.87,22.27L9.63,18.93Z" />
|
||||
</vector>
|
||||
@@ -1340,4 +1340,21 @@
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- AOD Schedule -->
|
||||
<string-array name="doze_always_on_auto_mode_entries">
|
||||
<item>@string/disabled</item>
|
||||
<item>@string/night_display_auto_mode_twilight</item>
|
||||
<item>@string/night_display_auto_mode_custom</item>
|
||||
<item>@string/always_on_display_schedule_mixed_sunset</item>
|
||||
<item>@string/always_on_display_schedule_mixed_sunrise</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="doze_always_on_auto_mode_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="default_string">Default</string>
|
||||
<string name="disabled">Disabled</string>
|
||||
|
||||
<!-- Color Picker -->
|
||||
<string name="dialog_color_picker">Color Picker</string>
|
||||
@@ -1139,4 +1140,11 @@
|
||||
<string name="navbar_purp">Purple</string>
|
||||
<string name="navbar_color_title">Navbar Colors</string>
|
||||
<string name="navbar_color_dialog_title">Select color</string>
|
||||
|
||||
<!-- AOD Schedule -->
|
||||
<string name="always_on_display_schedule_title">Always on display schedule</string>
|
||||
<string name="always_on_display_schedule_sunset">Sunset</string>
|
||||
<string name="always_on_display_schedule_sunrise">Sunrise</string>
|
||||
<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>
|
||||
</resources>
|
||||
|
||||
37
res/xml/cherish_settings_aod_schedule.xml
Normal file
37
res/xml/cherish_settings_aod_schedule.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 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/always_on_display_schedule_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="doze_always_on_auto_mode"
|
||||
android:title="@string/night_display_auto_mode_title"
|
||||
android:dialogTitle="@string/night_display_auto_mode_title"
|
||||
android:entries="@array/doze_always_on_auto_mode_entries"
|
||||
android:entryValues="@array/doze_always_on_auto_mode_values"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="doze_always_on_auto_since"
|
||||
android:title="@string/night_display_start_time_title" />
|
||||
|
||||
<Preference
|
||||
android:key="doze_always_on_auto_till"
|
||||
android:title="@string/night_display_end_time_title" />
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -53,6 +53,12 @@
|
||||
android:title="@string/fprint_error_vib_title"
|
||||
android:summary="@string/fprint_error_vib_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<Preference
|
||||
android:key="always_on_display_schedule"
|
||||
android:icon="@drawable/ic_upset"
|
||||
android:title="@string/always_on_display_schedule_title"
|
||||
android:fragment="com.cherish.settings.fragments.AODSchedule" />
|
||||
|
||||
<!-- Lock screen -->
|
||||
<PreferenceCategory
|
||||
|
||||
Reference in New Issue
Block a user