Compare commits
93 Commits
tiramisu-t
...
20/11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17f835b41a | ||
|
|
f8fb3ce9dc | ||
|
|
354af75a11 | ||
|
|
bc47fa3edb | ||
|
|
ed313aedba | ||
|
|
b2fe86fb80 | ||
|
|
c175bd76ea | ||
|
|
7695b0d745 | ||
|
|
68ff3a9cc0 | ||
|
|
124b13fc02 | ||
|
|
064a312c8c | ||
|
|
c5a0bd55ef | ||
|
|
b5888b597f | ||
|
|
31e4078afa | ||
|
|
d4c84fba3e | ||
|
|
ac8a497722 | ||
|
|
921a98fac0 | ||
|
|
4f172e6dd1 | ||
|
|
ffece25e0e | ||
|
|
98f6770955 | ||
|
|
88b2c07779 | ||
|
|
6fa7c9889b | ||
|
|
003c5d38a3 | ||
|
|
7c8e8ffe27 | ||
|
|
b86913468c | ||
|
|
524eb9b536 | ||
|
|
f547af0ea1 | ||
|
|
5442b9365a | ||
|
|
1de4422338 | ||
|
|
175ef484d5 | ||
|
|
3d90f610b2 | ||
|
|
21ee0a8e51 | ||
|
|
8a420f79c6 | ||
|
|
20f93f9748 | ||
|
|
c8f344beeb | ||
|
|
cf8f4f5a92 | ||
|
|
a94f029333 | ||
|
|
7d6755e20e | ||
|
|
d3bdfeccb1 | ||
|
|
4d7b651c13 | ||
|
|
9f425ed7e1 | ||
|
|
7b3b614829 | ||
|
|
5d1ae8a7b1 | ||
|
|
c814ee50c8 | ||
|
|
7d1f48770d | ||
|
|
368cf1992a | ||
|
|
31181403b7 | ||
|
|
6fd6e25119 | ||
|
|
bd0b95baa8 | ||
|
|
7bbc902a2e | ||
|
|
060f87564a | ||
|
|
678bd548a3 | ||
|
|
6eb30ad778 | ||
|
|
26ca910bab | ||
|
|
f6bab97f03 | ||
|
|
10762bcf05 | ||
|
|
eda2ea4ae9 | ||
|
|
a9d39862a6 | ||
|
|
4b4b2ba49c | ||
|
|
bb4d205f59 | ||
|
|
451d85b554 | ||
|
|
a7322d4cd4 | ||
|
|
e088417f38 | ||
|
|
e7cf70c08f | ||
|
|
b8407aa122 | ||
|
|
54dfae80ab | ||
|
|
d20937d5e3 | ||
|
|
d8b45d674a | ||
|
|
6afb47422d | ||
|
|
0fd0dbe361 | ||
|
|
7c02f3bf4d | ||
|
|
5112b06122 | ||
|
|
23f87707d3 | ||
|
|
3613fa0d8a | ||
|
|
1b456a242e | ||
|
|
1128b79603 | ||
|
|
0590d07893 | ||
|
|
9354fecbab | ||
|
|
e1a4c986a6 | ||
|
|
135aefde28 | ||
|
|
b6c4c176e5 | ||
|
|
3e4fb12297 | ||
|
|
699148fdb4 | ||
|
|
bf5e41b4c8 | ||
|
|
67a9aa7547 | ||
|
|
d76fdf8d23 | ||
|
|
d45e7298fa | ||
|
|
efdf6b1b60 | ||
|
|
c5ca12f04a | ||
|
|
0c45249d1e | ||
|
|
89d96ce9fb | ||
|
|
82061318b9 | ||
|
|
5a8c6f7259 |
BIN
res/drawable/activities_icon.png
Normal file
BIN
res/drawable/activities_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
4
res/drawable/fab_accent.xml
Normal file
4
res/drawable/fab_accent.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="?android:attr/colorAccent" />
|
||||
</shape>
|
||||
@@ -25,11 +25,11 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:scaleType="centerInside"
|
||||
settings:layout_constraintStart_toStartOf="parent"
|
||||
settings:layout_constraintTop_toTopOf="parent" />
|
||||
settings:layout_constraintTop_toTopOf="parent"
|
||||
settings:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
@@ -38,23 +38,26 @@
|
||||
android:layout_marginStart="@dimen/default_margin"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:maxLines="1"
|
||||
settings:layout_constraintStart_toEndOf="@id/icon"
|
||||
settings:layout_constraintEnd_toStartOf="@id/checkBox"
|
||||
settings:layout_constraintTop_toTopOf="@id/icon" />
|
||||
settings:layout_constraintEnd_toStartOf="@id/check_box"
|
||||
settings:layout_constraintTop_toTopOf="@id/icon"
|
||||
settings:layout_constraintBottom_toTopOf="@id/package_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/packageName"
|
||||
android:id="@+id/package_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:maxLines="2"
|
||||
settings:layout_constraintStart_toStartOf="@id/label"
|
||||
settings:layout_constraintEnd_toEndOf="@id/label"
|
||||
settings:layout_constraintTop_toBottomOf="@id/label"
|
||||
settings:layout_constraintBottom_toBottomOf="@id/icon" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:id="@+id/check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
|
||||
70
res/layout/custom_action_item.xml
Normal file
70
res/layout/custom_action_item.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2006 The Android Open Source 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.
|
||||
-->
|
||||
|
||||
<!-- Layout for a Preference in a PreferenceActivity. The
|
||||
Preference is able to place a specific widget for its particular
|
||||
type in the "widget_frame" layout. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/widget_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dip"
|
||||
android:padding="2dp"
|
||||
android:maxWidth="36dip"
|
||||
android:maxHeight="36dip"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dip"
|
||||
android:layout_marginEnd="6dip"
|
||||
android:layout_marginTop="6dip"
|
||||
android:layout_marginBottom="6dip"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal" />
|
||||
|
||||
<TextView android:id="@android:id/summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@android:id/title"
|
||||
android:layout_alignStart="@android:id/title"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body1"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:maxLines="2" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
788
res/values-sk-rSK/cherish_strings.xml
Normal file
788
res/values-sk-rSK/cherish_strings.xml
Normal file
@@ -0,0 +1,788 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 CherishOS
|
||||
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.
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- App Title -->
|
||||
<string name="cherish_settings_title">Cherish Settings</string>
|
||||
<!-- Categories -->
|
||||
<string name="button_title">Buttons</string>
|
||||
<string name="button_summary">Hardware keys, Navigation bar</string>
|
||||
<string name="gestures_title">Gestures</string>
|
||||
<string name="gestures_summary">Jump to camera, swipe to screenshot</string>
|
||||
<string name="lockscreen_title">Lock screen</string>
|
||||
<string name="lockscreen_summary">Music visualizer, charging animation, clock style</string>
|
||||
<string name="misc_title">Miscellaneous</string>
|
||||
<string name="misc_summary">Gaming mode, volume controls</string>
|
||||
<string name="animations_title">Animations</string>
|
||||
<string name="animations_summary">System animations</string>
|
||||
<string name="powermenu_title">Power menu</string>
|
||||
<string name="powermenu_summary">Advanced restart, power menu opacity</string>
|
||||
<string name="theme_title">Themes</string>
|
||||
<string name="theme_summary">System theme, rounded, switch theme</string>
|
||||
<string name="quicksettings_title">Quick Settings</string>
|
||||
<string name="quicksettings_summary">Tile layout, blur</string>
|
||||
<string name="recents_title">Recents apps</string>
|
||||
<string name="recents_summary">Slim recents</string>
|
||||
<string name="statusbar_title">Status bar</string>
|
||||
<string name="statusbar_summary">Clock, carrier, status icons</string>
|
||||
<string name="volume_title">Volume rockers</string>
|
||||
<string name="volume_summary">Volume rockers</string>
|
||||
<string name="notifications_title">Notifications</string>
|
||||
<string name="notifications_summary">Battery light, notifications header</string>
|
||||
<string name="about_summary">Learn more about CherishOS</string>
|
||||
<string name="device_part_title">Device features</string>
|
||||
<string name="qs_category">QS category</string>
|
||||
<string name="navbar_title">Navigation bar</string>
|
||||
<string name="volume_keys_title">Volume keys</string>
|
||||
<string name="udfps_category">UDFPS</string>
|
||||
<!-- General strings -->
|
||||
<string name="ok">OK</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="none_string">None</string>
|
||||
<string name="default_string">Default</string>
|
||||
<string name="disabled">Disabled</string>
|
||||
<!-- Color Picker -->
|
||||
<string name="dialog_color_picker">Color Picker</string>
|
||||
<string name="press_color_to_apply">Press on color below to apply</string>
|
||||
<string name="arrow_right">→</string>
|
||||
<string name="arrow_down">↓</string>
|
||||
<string name="hex">Hex:</string>
|
||||
<string name="hex_hint">#ff000000</string>
|
||||
<string name="set">Set</string>
|
||||
<string name="color_default">Default</string>
|
||||
<string name="led_color_green">Green</string>
|
||||
<string name="led_color_red">Red</string>
|
||||
<!-- Custom seekbar -->
|
||||
<string name="custom_seekbar_value">Value: <xliff:g id="v">%s</xliff:g></string>
|
||||
<string name="custom_seekbar_default_value">Default</string>
|
||||
<string name="custom_seekbar_default_value_to_set">Default value: <xliff:g id="v">%s</xliff:g>\nLong press to set</string>
|
||||
<string name="custom_seekbar_default_value_is_set">Default value is set</string>
|
||||
<string name="add_package_to_title">Add application</string>
|
||||
<string name="profile_choose_app">Choose app</string>
|
||||
<string name="dialog_delete_title">Delete</string>
|
||||
<string name="dialog_delete_message">Remove selected item?</string>
|
||||
<!-- Units -->
|
||||
<string name="unit_milliseconds">milliseconds</string>
|
||||
<string name="unit_seconds">seconds</string>
|
||||
<!-- QS settings -->
|
||||
<string name="qs_title">Quick settings</string>
|
||||
<!-- Lock screen visualizer -->
|
||||
<string name="visualizer_title">Display music visualizer</string>
|
||||
<!-- Power menu and dialogs opacity -->
|
||||
<!-- AOKP custom system animations -->
|
||||
<!-- Power menu Animations -->
|
||||
<string name="power_menu_animation">Power menu</string>
|
||||
<!-- QS header image -->
|
||||
<!-- Lockscreen -->
|
||||
<string name="lockscreen_category">Lockscreen</string>
|
||||
<!-- Themes -->
|
||||
<string name="theme_type_title">System theme</string>
|
||||
<string name="theme_type_summary">Select theme</string>
|
||||
<!--Accenter -->
|
||||
<string name="themes_hub_title">Themes</string>
|
||||
<string name="themes_hub_summary">Accents-Gradients-Themes</string>
|
||||
<string name="rgb_accent_picker_title_dark">Accent Picker</string>
|
||||
<string name="rgb_accent_picker_summary">Choose the accent color yourself</string>
|
||||
<string name="theme_option_reset_title">Reset Theme Options</string>
|
||||
<string name="theme_option_reset_message">Are you sure you want to reset themes-accent to default?</string>
|
||||
<!--ThemePicker-->
|
||||
<string name="theme_select_title">Styles and Wallpapers</string>
|
||||
<string name="theme_select_summary">Browse and select installed themes</string>
|
||||
<string name="notification_light_settings">Notifications light</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="search_apps">Search apps</string>
|
||||
<!-- Themeing -->
|
||||
<string name="dark_ui_mode_summary">Browse the dark theme options</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the settings category for theme overlays. -->
|
||||
<string name="theme_customization_category">Theming</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize the adaptive icon shape (e.g. launcher and quick settings icons). -->
|
||||
<string name="theme_customization_icon_shape_title">Icon shape</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize accent color. -->
|
||||
<string name="theme_customization_icon_shape_summary">Set system icon shape style</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize headline and body fonts. -->
|
||||
<string name="theme_customization_font_title">Headline / Body font</string>
|
||||
<string name="theme_customization_font_summary">Set system font style</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize the system wide icon pack. -->
|
||||
<string name="theme_customization_icon_pack_title">Icon pack</string>
|
||||
<string name="theme_customization_icon_pack_summary">Set custom icon pack style</string>
|
||||
<string name="theme_customization_signal_icon_title">Signal icon style</string>
|
||||
<string name="theme_customization_signal_icon_summary">Set custom signal icon style</string>
|
||||
<string name="theme_customization_wifi_icon_title">WiFi icon style</string>
|
||||
<string name="theme_customization_wifi_icon_summary">Set custom wifi icon style</string>
|
||||
<!-- Custom Signal bar icons -->
|
||||
<string name="custom_signal_bar_title">Signal</string>
|
||||
<!-- Custom Wi-Fi bar icons -->
|
||||
<string name="custom_wifi_bar_title">Wi-Fi</string>
|
||||
<!-- Battery light -->
|
||||
<string name="battery_light_settings">Battery charging light</string>
|
||||
<string name="battery_light_enable">Enable</string>
|
||||
<string name="battery_full_light_enabled">Battery light when full charged</string>
|
||||
<string name="battery_light_allow_on_dnd_title">Battery light in Do Not Disturb mode</string>
|
||||
<string name="battery_light_low_blinking_title">Blinking light on low battery</string>
|
||||
<string name="battery_light_cat">Battery light color when charging</string>
|
||||
<string name="battery_light_low_color">Low battery</string>
|
||||
<string name="battery_light_medium_color">Medium battery</string>
|
||||
<string name="battery_light_full_color">Almost full battery</string>
|
||||
<string name="battery_light_reallyfull_color">Full (100) battery</string>
|
||||
<string name="status_bar_quick_qs_pulldown">Quick QS pulldown</string>
|
||||
<string name="quick_pulldown_none">Disabled</string>
|
||||
<string name="quick_pulldown_right">Pulldown status bar from right side</string>
|
||||
<string name="quick_pulldown_left">Pulldown status bar from left side</string>
|
||||
<string name="quick_pulldown_always">Always show quick settings on status bar pull down</string>
|
||||
<!-- Statusbar double tap to sleep -->
|
||||
<string name="double_tap_to_sleep_title">Status bar double tap to sleep</string>
|
||||
<string name="double_tap_to_sleep_summary">Double tap on the status bar to put the device to sleep</string>
|
||||
<!-- Lockscreen double tap to sleep -->
|
||||
<string name="lockscreen_gesture_title">Gestures</string>
|
||||
<string name="double_tap_sleep_lockscreen_title">Lockscreen double tap to sleep</string>
|
||||
<string name="double_tap_sleep_lockscreen_summary">Double tap anywhere on the lockscreen to put the device to sleep</string>
|
||||
<string name="notification_sound_vib_screen_on_title">Noisy notifications if screen on</string>
|
||||
<string name="notification_sound_vib_screen_on_summary">Disable to block notifications sound and vibration when the screen is awake</string>
|
||||
<!-- Heads up options -->
|
||||
<string name="notifications_category_title">Annoying notifications protection</string>
|
||||
<string name="less_boring_heads_up_title">Make heads up less annoying</string>
|
||||
<string name="less_boring_heads_up_summary">Show heads up only for dialer or messaging app if they are not in foreground</string>
|
||||
<!-- Incall vibrate options -->
|
||||
<string name="incall_vibration_category">In-call vibration options</string>
|
||||
<string name="incall_vibrate_connect_title">Vibrate on connect</string>
|
||||
<string name="incall_vibrate_call_wait_title">Vibrate on call waiting</string>
|
||||
<string name="incall_vibrate_disconnect_title">Vibrate on disconnect</string>
|
||||
<!-- Launch music player when headset is connected -->
|
||||
<string name="headset_connect_player_title">Launch music app on headset connection</string>
|
||||
<string name="headset_connect_player_summary">Launch the default music app when headset is connected</string>
|
||||
<!-- Network traffic -->
|
||||
<string name="network_traffic_title">Network traffic indicator</string>
|
||||
<string name="network_traffic_summary">Enable or disable network speed indicator in status bar</string>
|
||||
<string name="network_traffic_master_switch_title">Use Network Traffic Indicator</string>
|
||||
<string name="network_options_title">Options</string>
|
||||
<string name="network_traffic_autohide_title">Hide network traffic indicator if inactive</string>
|
||||
<string name="network_traffic_autohide_summary">Hide when network traffic indicator is below 1 KB/s</string>
|
||||
<!-- NavBar Inverse -->
|
||||
<string name="navigation_bar_inverse_title">Invert 3 button navigation bar</string>
|
||||
<string name="status_bar_icons_category_title">Icons</string>
|
||||
<!-- Status bar - icon blocklist -->
|
||||
<string name="status_bar_icons_title">Status bar icons</string>
|
||||
<string name="status_bar_icons_summary">Choose which status bar icons can be shown</string>
|
||||
<!-- Data disabled icon -->
|
||||
<string name="data_disabled_icon_title">Show data disabled icon</string>
|
||||
<string name="data_disabled_icon_summary">Display the cross sign next to signal bar when data is disabled</string>
|
||||
<!-- Show old style mobile data icon -->
|
||||
<string name="use_old_mobiletype_title">Use old style mobile data icons</string>
|
||||
<string name="use_old_mobiletype_summary">Show mobile type icon on top of the signal indicator</string>
|
||||
<!-- Show LTE/4G switch -->
|
||||
<string name="show_fourg_icon_title">Show 4G instead of LTE</string>
|
||||
<string name="show_fourg_icon_summary">Replace LTE indicator with 4G</string>
|
||||
<!-- Roaming indicator icon -->
|
||||
<string name="roaming_indicator_icon_title">Roaming indicator</string>
|
||||
<string name="roaming_indicator_icon_summary">Display roaming indicator when in roaming mode</string>
|
||||
<!-- Lock screen media artwork -->
|
||||
<string name="lockscreen_media_art_options_title">Lock screen media art</string>
|
||||
<!-- Media art -->
|
||||
<string name="media_art_title">Media cover art</string>
|
||||
<string name="media_art_summary">Display media cover art when available</string>
|
||||
<!-- Lock screen album art filter -->
|
||||
<string name="lockscreen_albumart_filter_title">Media cover art filter</string>
|
||||
<string name="lockscreen_albumart_filter_grayscale">Grayscale</string>
|
||||
<string name="lockscreen_albumart_filter_tint">Accent tinted</string>
|
||||
<string name="lockscreen_albumart_filter_blur">Blur</string>
|
||||
<string name="lockscreen_albumart_filter_grayblur">Grayscale and blurred</string>
|
||||
<string name="lockscreen_albumart_filter_blur_radius_title">Blur amount for lockscreen media artwork</string>
|
||||
<!-- Show VoLTE icon on statusbar -->
|
||||
<string name="volte_switch_title">VoLTE icon</string>
|
||||
<string name="volte_switch_summary">Display VoLTE icon</string>
|
||||
<string name="volte_icon_title">VoLTE icon</string>
|
||||
<string name="volte_icon_summary">Display VoLTE icon</string>
|
||||
<string name="volte_icon_style_title">Select VoLTE Icon</string>
|
||||
<string name="volte_icon_asus">VoLTE Asus Icon</string>
|
||||
<string name="volte_icon_vo">Vo Only Icon</string>
|
||||
<string name="volte_icon_volte">VoLTE Icon</string>
|
||||
<string name="volte_icon_oos">VoLTE OOS Icon</string>
|
||||
<string name="volte_icon_hd">HD Icon</string>
|
||||
<string name="volte_icon_hd2">HD CAF Icon</string>
|
||||
<string name="volte_icon_miui">MIUI 11 Icon</string>
|
||||
<string name="volte_icon_emui">EMUI Icon</string>
|
||||
<string name="volte_icon_margaritov">HD Filled Icon</string>
|
||||
<string name="volte_icon_margaritov2">Margaritov VoLTE Icon</string>
|
||||
<string name="volte_icon_vivo">Vivo Icon</string>
|
||||
<string name="volte_icon_aris">Aris Icon</string>
|
||||
<string name="volte_icon_beast">Aww Icon</string>
|
||||
<string name="volte_icon_ios">Ios Icon</string>
|
||||
<string name="volte_icon_lr">Livenge Icon</string>
|
||||
<string name="volte_icon_realme">Realme Icon</string>
|
||||
<string name="volte_icon_typeA">Mild Icon</string>
|
||||
<string name="volte_icon_typeB">Filth Icon</string>
|
||||
<string name="volte_icon_typeC">Mue Icon</string>
|
||||
<string name="volte_icon_typeD">Sus Icon</string>
|
||||
<string name="volte_icon_typeE">Acherus Icon</string>
|
||||
<string name="volte_icon_vcircle">Circle Icon</string>
|
||||
<string name="volte_icon_vimeo">Vimeo Icon</string>
|
||||
<string name="volte_icon_volit">Volit Icon</string>
|
||||
<string name="volte_icon_zirco">Ziroc Icon</string>
|
||||
<!-- Statusbar Battery -->
|
||||
<string name="battery_style_title">Battery icon style</string>
|
||||
<string name="battery_style_summary">Customize battery icons, hide or show percentage</string>
|
||||
<string name="battery_style_category_title">Battery icon</string>
|
||||
<string name="status_bar_battery_category_title">In Status Bar</string>
|
||||
<string name="status_bar_battery_percent_title">Battery percentage</string>
|
||||
<string name="status_bar_battery_style_title">Battery style</string>
|
||||
<string name="status_bar_battery_style_icon_portrait">Icon portrait (default)</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape">Icon landscape (Right)</string>
|
||||
<string name="status_bar_battery_style_icon_landscape">Icon landscape (Left)</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape_style_a">Landscape R Style A</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_style_a">Landscape L Style A</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape_style_b">Landscape R Style B</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_style_b">Landscape L Style B</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_pill">Portrait Mx</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_line">Landscape Lorn</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_musku">Portrait IOS</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_signal">Landscape Airoo</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_buddy">Landscape Capsule</string>
|
||||
<string name="status_bar_battery_style_circle">Circle</string>
|
||||
<string name="status_bar_battery_style_dotted_circle">Circle (Dotted)</string>
|
||||
<string name="status_bar_battery_style_filled_circle">Circle (Filled)</string>
|
||||
<string name="status_bar_battery_style_big_circle">Big circle</string>
|
||||
<string name="status_bar_battery_style_big_dotted_circle">Big dotted circle</string>
|
||||
<string name="status_bar_battery_style_text">Text</string>
|
||||
<string name="status_bar_battery_style_hidden">Hidden</string>
|
||||
<string name="status_bar_battery_percentage_default">Hidden (default)</string>
|
||||
<string name="status_bar_battery_percentage_text_inside">Inside the icon</string>
|
||||
<string name="status_bar_battery_percent_text_next_right">Next to the icon (right)</string>
|
||||
<string name="status_bar_battery_percent_text_next_left">Next to the icon (left)</string>
|
||||
<string name="status_bar_battery_text_charging_title">Battery percentage when charging</string>
|
||||
<string name="status_bar_battery_text_charging_summary">Always display battery percentage when charging</string>
|
||||
<!-- QS battery -->
|
||||
<string name="qs_battery_category_title">In QS Panel</string>
|
||||
<string name="qs_use_status_bar_battery_style">Follow status bar style</string>
|
||||
<!-- Statusbar Clock background chip -->
|
||||
<string name="statusbar_clock_chip_title">Background chip</string>
|
||||
<string name="statusbar_clock_chip_summary">Display accented chip behind clock</string>
|
||||
<!-- Quick Settings brightness slider -->
|
||||
<string name="qs_show_brightness_slider_title">Brightness slider</string>
|
||||
<string name="qs_show_brightness_slider_never">Never show</string>
|
||||
<string name="qs_show_brightness_slider_expanded">Show when expanded</string>
|
||||
<string name="qs_show_brightness_slider_always">Show always</string>
|
||||
<string name="qs_show_brightness_slider_not_expanded">Show when not expanded</string>
|
||||
<string name="qs_brightness_slider_position_title">Position</string>
|
||||
<string name="qs_brightness_slider_position_top">Top</string>
|
||||
<string name="qs_brightness_slider_position_bottom">Bottom</string>
|
||||
<!-- Quick Settings brightness icon -->
|
||||
<string name="qs_show_auto_brightness_title">Auto brightness icon</string>
|
||||
<string name="qs_show_auto_brightness_summary">Show toggle for adaptive brightness near the slider</string>
|
||||
<!-- Laboratory - Ignore window secure -->
|
||||
<string name="laboratory_ignore_window_secure_title">Ignore window secure flags</string>
|
||||
<string name="laboratory_ignore_window_secure_summary">This removes the screenshots and screenrecords limits for all applications. Normally, special applications are replaced with black areas in records. This can be convenient in some cases but may lead to privacy leaks. After changing this toggle, you may need to restart applications for the change to take effect.</string>
|
||||
<!-- Lockscreen battery info -->
|
||||
<string name="lockscreen_charging_info_title">Show charging info in lockscreen</string>
|
||||
<string name="lockscreen_charging_info_summary">Shows temperature, charging current and more while plugged in</string>
|
||||
<!-- QS Transparency -->
|
||||
<string name="qs_transparency_title">Background transparency</string>
|
||||
<string name="qs_transparency_summary">Set transparency level for QS background</string>
|
||||
<string name="click_partial_screenshot_title">Click to partial screenshot</string>
|
||||
<string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string>
|
||||
<!-- Brightness control -->
|
||||
<string name="status_bar_brightness_control_title">Brightness control</string>
|
||||
<string name="status_bar_brightness_control_summary">Adjust brightness by sliding across the status bar</string>
|
||||
<!-- Power menu on lockscreen -->
|
||||
<string name="power_menu_hide_on_secure_title">Hide power menu on lock screen</string>
|
||||
<string name="power_menu_hide_on_secure_summary">This will hide the power menu only on a secure lock screen</string>
|
||||
<!-- Hide Status bar on lock screen -->
|
||||
<string name="hide_lockscreen_status_bar_title">Hide status bar</string>
|
||||
<string name="hide_lockscreen_status_bar_summary">Touch status bar to toggle visibility</string>
|
||||
<!-- Navigation bar -->
|
||||
<string name="navigation_bar_category">Navigation bar</string>
|
||||
<string name="navigation_bar_title">On-screen navigation bar</string>
|
||||
<string name="navigation_bar_summary">Enable on-screen navigation keys</string>
|
||||
<string name="navigation_bar_arrow_keys_title">Show arrow keys while typing</string>
|
||||
<string name="navigation_bar_arrow_keys_summary">Display left and right cursor buttons in navigation bar while typing</string>
|
||||
<string name="navigation_bar_compact_layout_title">Compact layout</string>
|
||||
<string name="navigation_bar_compact_layout_summary">Use a compact layout in the navigation bar</string>
|
||||
<string name="system_navigation_summary">Choose which system navigation style to use</string>
|
||||
<string name="navbar_layout_category_title">Layout</string>
|
||||
<!-- Volume rocker wake -->
|
||||
<string name="volume_rocker_wake_title">Volume rocker wake</string>
|
||||
<string name="volume_rocker_wake_summary">Pressing the volume keys will wake your device</string>
|
||||
<string name="volume_category">Volume rocker</string>
|
||||
<!-- Volume Steps Fragment -->
|
||||
<string name="volume_steps_fragment_title">Volume steps</string>
|
||||
<string name="volume_steps_summary">Customize volume steps</string>
|
||||
<string name="volume_steps_alarm_title">Volume steps: Alarm</string>
|
||||
<string name="volume_steps_dtmf_title">Volume steps: DTMF</string>
|
||||
<string name="volume_steps_music_title">Volume steps: Media</string>
|
||||
<string name="volume_steps_notification_title">Volume steps: Notification</string>
|
||||
<string name="volume_steps_ring_title">Volume steps: Ringer</string>
|
||||
<string name="volume_steps_system_title">Volume steps: System</string>
|
||||
<string name="volume_steps_voice_call_title">Volume steps: Voice Call</string>
|
||||
<string name="volume_steps_reset">Reset</string>
|
||||
<!-- Buttons - Enable navbar -->
|
||||
<string name="disable_navkeys_title">Enable on-screen nav bar</string>
|
||||
<string name="disable_navkeys_summary">Enable on-screen navigation bar and disable hardware buttons</string>
|
||||
<!-- Buttons - Swap capacitive keys -->
|
||||
<string name="swap_capacitive_keys_title">Swap capacitive buttons</string>
|
||||
<string name="swap_capacitive_keys_summary">Swap the order of recents and back buttons</string>
|
||||
<!-- HW keys -->
|
||||
<string name="hardware_keys_title">Buttons</string>
|
||||
<string name="hardware_keys_category">Hardware navigation buttons</string>
|
||||
<string name="hardware_keys_disable_title">Disable hardware buttons</string>
|
||||
<string name="hardware_keys_disable_summary">Use the device hardware keys for navigation</string>
|
||||
<string name="hardware_keys_volume_keys_title">Volume rocker</string>
|
||||
<!-- Hardware button navigation -->
|
||||
<string name="picker_activities">Activities</string>
|
||||
<string name="select_custom_app_title">Select custom app</string>
|
||||
<string name="select_custom_activity_title">Select custom activity</string>
|
||||
<string name="profile_applist_title">Applications</string>
|
||||
<string name="choose_action_title">Choose action</string>
|
||||
<string name="action_entry_default_action">Default settings</string>
|
||||
<string name="action_entry_select_app">Select application</string>
|
||||
<string name="action_entry_custom_action">Select custom action</string>
|
||||
<string name="hardware_keys_home_key_title">Home button</string>
|
||||
<string name="hardware_keys_back_key_title">Back button</string>
|
||||
<string name="hardware_keys_menu_key_title">Menu button</string>
|
||||
<string name="hardware_keys_assist_key_title">Search button</string>
|
||||
<string name="hardware_keys_appswitch_key_title">Recents button</string>
|
||||
<string name="hardware_keys_camera_key_title">Camera button</string>
|
||||
<string name="hardware_keys_short_press_title">Short press action</string>
|
||||
<string name="hardware_keys_double_tap_summary">Set double tap action</string>
|
||||
<string name="hardware_keys_single_tap_summary">Set single tap action</string>
|
||||
<string name="hardware_keys_long_press_summary">Set long press action</string>
|
||||
<string name="hardware_keys_single_tap_title">Single tap action</string>
|
||||
<string name="hardware_keys_long_press_title">Long press action</string>
|
||||
<string name="hardware_keys_double_tap_title">Double tap action</string>
|
||||
<string name="hardware_keys_action_nothing">No action</string>
|
||||
<string name="hardware_keys_action_menu">Open/close menu</string>
|
||||
<string name="hardware_keys_action_app_switch">Recent apps switcher</string>
|
||||
<string name="hardware_keys_action_search">Search assistant</string>
|
||||
<string name="hardware_keys_action_voice_search">Voice search</string>
|
||||
<string name="hardware_keys_action_in_app_search">In-app search</string>
|
||||
<string name="hardware_keys_action_launch_camera">Launch camera</string>
|
||||
<string name="hardware_keys_action_sleep">Turn screen off</string>
|
||||
<string name="hardware_keys_action_split_screen">Split screen</string>
|
||||
<string name="hardware_keys_action_close_app">Kill app</string>
|
||||
<string name="hardware_keys_action_torch">Flashlight</string>
|
||||
<string name="hardware_keys_action_screenshot">Screenshot</string>
|
||||
<string name="hardware_keys_action_volume_panel">Toggle volume panel</string>
|
||||
<string name="hardware_keys_action_clear_all_notifications">Clear all notifications</string>
|
||||
<string name="hardware_keys_action_notifications_panel">Toggle notifications panel</string>
|
||||
<string name="hardware_keys_action_toggle_qs_panel">Toggle QS panel</string>
|
||||
<string name="hardware_keys_action_ringer_modes">Ringer modes</string>
|
||||
<string name="hardware_keys_swipe_right_key_title">Swipe right</string>
|
||||
<string name="hardware_keys_swipe_left_key_title">Swipe left</string>
|
||||
<string name="hardware_keys_long_tap_key_title">Long tap</string>
|
||||
<string name="hardware_keys_swipe_tap_title">Swipe action</string>
|
||||
<string name="hardware_keys_long_tap_title">Long tap action</string>
|
||||
<string name="button_wake_title">Wake device</string>
|
||||
<string name="button_wake_summary">Wake device by pressing the button</string>
|
||||
<string name="camera_sleep_on_release_title">Screen peek</string>
|
||||
<string name="camera_sleep_on_release_summary">A half press will keep the screen on only while the button is held down</string>
|
||||
<string name="camera_launch_title">Launch camera</string>
|
||||
<string name="camera_launch_summary">A longpress and release will launch camera</string>
|
||||
<string name="cursor_section_header">Cursor</string>
|
||||
<string name="volume_key_cursor_control_title">Keyboard cursor control</string>
|
||||
<string name="volume_key_cursor_control_off">Disabled</string>
|
||||
<string name="volume_key_cursor_control_on">Volume Up/Down - Cursor Left/Right</string>
|
||||
<string name="volume_key_cursor_control_on_reverse">Volume Up/Down - Cursor Right/Left</string>
|
||||
<string name="swap_volume_buttons_title">Reorient</string>
|
||||
<string name="swap_volume_buttons_summary">Swap volume buttons when the screen is rotated</string>
|
||||
<string name="volume_panel_on_left_title">Show volume panel on left</string>
|
||||
<string name="volume_panel_on_left_summary">Display volume panel on the left side of the screen</string>
|
||||
<!-- Alert Slider Notifications (OnePlus devices) -->
|
||||
<string name="alert_slider_notifications_title">Alert slider notifications</string>
|
||||
<string name="alert_slider_notifications_summary">Display notification when changing alert slider position</string>
|
||||
<!-- Power Menu -->
|
||||
<string name="power_menu_title">Power menu</string>
|
||||
<string name="power_menu_title_summary">View or change power menu entries</string>
|
||||
<string name="powermenu_screenshot">Screenshot</string>
|
||||
<string name="powermenu_power">Power</string>
|
||||
<string name="powermenu_advanced">Advanced reboot options</string>
|
||||
<string name="powermenu_restart">Restart</string>
|
||||
<string name="powermenu_airplane">Airplane</string>
|
||||
<string name="powermenu_settings">Settings</string>
|
||||
<string name="powermenu_lockdown">Lock Down</string>
|
||||
<string name="powermenu_soundpanel">Sound Panel</string>
|
||||
<string name="powermenu_users">Users</string>
|
||||
<string name="powermenu_logout">Logout</string>
|
||||
<string name="powermenu_emergency">Emergency</string>
|
||||
<!-- Unlock FPS for specific games -->
|
||||
<string name="use_games_spoof_title">Unlock higher FPS in games</string>
|
||||
<string name="use_games_spoof_summary">Spoof your device as a different model for specific games to unlock higher FPS</string>
|
||||
<!-- Netflix Spooft -->
|
||||
<string name="netflix_spoof_title">Netflix spoof</string>
|
||||
<string name="netflix_spoof_summary">Spoof your device as different model for Netflix</string>
|
||||
<!-- Unlimited google photos storage -->
|
||||
<string name="use_photos_spoof_title">Unlimited Photos storage</string>
|
||||
<string name="use_photos_spoof_summary">Spoof your device as Pixel XL for Google Photos app only to provide unlimited storage for backup</string>
|
||||
<!-- Notification guts kill app button -->
|
||||
<string name="notification_guts_kill_app_button_title">Force stop button</string>
|
||||
<string name="notification_guts_kill_app_button_summary">Show force stop button in the notification\'s longpress menu</string>
|
||||
<!-- Toast app icon -->
|
||||
<string name="toast_icon_title">Toast app icon</string>
|
||||
<string name="toast_icon_summary">Display the app\'s icon corresponding with the toast</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>
|
||||
<!-- Status bar - Clock -->
|
||||
<string name="status_bar_clock_title">Clock & date</string>
|
||||
<string name="status_bar_clock_summary">Customize clock & date</string>
|
||||
<string name="status_bar_clock_seconds_title">Clock seconds</string>
|
||||
<string name="status_bar_clock_seconds_summary">Display seconds next to clock in status bar</string>
|
||||
<string name="status_bar_clock_position_title">Clock style</string>
|
||||
<string name="status_bar_clock_position_right">Right</string>
|
||||
<string name="status_bar_clock_position_left">Left</string>
|
||||
<string name="status_bar_clock_position_center">Center</string>
|
||||
<string name="status_bar_clock_position_hidden">Hidden</string>
|
||||
<string name="status_bar_clock_auto_hide_title">Auto hide</string>
|
||||
<string name="status_bar_clock_auto_hide_launcher_summary">Hide clock if launcher is visible</string>
|
||||
<string name="status_bar_clock_auto_hide_summary">Hide clock at regular interval</string>
|
||||
<string name="status_bar_clock_auto_hide_hdur_title">Hide duration</string>
|
||||
<string name="status_bar_clock_auto_hide_hdur_summary">Number of seconds to hide clock</string>
|
||||
<string name="status_bar_clock_auto_hide_sdur_title">Show duration</string>
|
||||
<string name="status_bar_clock_auto_hide_sdur_summary">Number of seconds to wait before hiding clock</string>
|
||||
<string name="status_bar_am_pm_title">AM/PM style</string>
|
||||
<string name="status_bar_am_pm_info">24-hour clock is enabled</string>
|
||||
<string name="status_bar_am_pm_normal">Normal</string>
|
||||
<string name="status_bar_am_pm_small">Small</string>
|
||||
<string name="status_bar_am_pm_hidden">Hidden</string>
|
||||
<string name="status_bar_date_title">Date</string>
|
||||
<string name="status_bar_date_none">Hidden</string>
|
||||
<string name="status_bar_date_small">Small</string>
|
||||
<string name="status_bar_date_normal">Normal</string>
|
||||
<string name="status_bar_date_format_title">Date format</string>
|
||||
<string name="status_bar_date_style">Date style</string>
|
||||
<string name="status_bar_date_style_normal">Normal</string>
|
||||
<string name="status_bar_date_style_lowercase">Lowercase</string>
|
||||
<string name="status_bar_date_style_uppercase">Uppercase</string>
|
||||
<string name="status_bar_date_format_custom">Custom java format</string>
|
||||
<string name="status_bar_date_string_edittext_title">Must be in DateFormat eg. MM/dd/yy</string>
|
||||
<string name="status_bar_date_string_edittext_summary">Enter string</string>
|
||||
<string name="clock_date_position">Date position</string>
|
||||
<string name="clock_date_right">Right of time</string>
|
||||
<string name="clock_date_left">Left of time</string>
|
||||
<string name="clock_font_size_title">Clock font size</string>
|
||||
<!-- QS clock -->
|
||||
<string name="qs_clock_title">Clock</string>
|
||||
<string name="qs_clock_summary">Display clock in quick status bar header</string>
|
||||
<!-- QS date -->
|
||||
<string name="qs_date_title">Date</string>
|
||||
<string name="qs_date_summary">Display date in quick status bar header</string>
|
||||
<!-- Footer -->
|
||||
<string name="qs_footer_category">QS Footer</string>
|
||||
<string name="qs_footer_datausage_title">Data usage</string>
|
||||
<string name="qs_footer_datausage_summary">Display data usage summary in quick settings footer</string>
|
||||
<!-- Edge light -->
|
||||
<string name="edge_light_title">Edge light</string>
|
||||
<string name="enable_edge_light">Enable Edge Light</string>
|
||||
<string name="edge_light_intro_text">Display an animation along the edges of the screen when pulsing</string>
|
||||
<string name="edge_light_always_trigger_on_pulse_title">Always trigger on pulse</string>
|
||||
<string name="edge_light_always_trigger_on_pulse_summary">Whether to show edge light whenever ambient display is shown and not just for notifications</string>
|
||||
<string name="edge_light_repeat_animation_title">Repeat animation</string>
|
||||
<string name="edge_light_repeat_animation_summary_on">Repeat until timeout</string>
|
||||
<string name="edge_light_repeat_animation_summary_off">Show only once</string>
|
||||
<string name="edge_light_color_mode_title">Edge light color mode</string>
|
||||
<string name="accent_color">Accent color (Default)</string>
|
||||
<string name="notification_color">Notification color</string>
|
||||
<string name="wallpaper_color">Wallpaper color</string>
|
||||
<string name="custom_color">Custom color</string>
|
||||
<string name="edge_light_custom_color_title">Custom color</string>
|
||||
<!-- Custom settings dashboard style -->
|
||||
<string name="settings_dashboard_style_title">Settings layout</string>
|
||||
<string name="settings_dashboard_style_aosp">Aosp</string>
|
||||
<string name="settings_dashboard_style_oos11">OxygenOS 11</string>
|
||||
<string name="settings_dashboard_style_oos12">OxygenOS 12</string>
|
||||
<string name="settings_dashboard_style_cherish">Cherish</string>
|
||||
<string name="settings_dashboard_style_cherish_clean">Cherish Clean</string>
|
||||
<string name="settings_layout_category_title">Settings UI interface</string>
|
||||
<string name="settings_base_style_title">Settings Base layout</string>
|
||||
<string name="settings_base_style_summary">Use an alternative layout for setting menus</string>
|
||||
<string name="settings_home_style_title">Settings Home layout</string>
|
||||
<string name="settings_home_style_summary">Use stock aosp layout for homepage</string>
|
||||
<string name="disable_usercard_title">Settings UserCard</string>
|
||||
<string name="disable_usercard_summary">Toggle in order not to show the usercard on main settings page</string>
|
||||
<!-- Lockscreen Clocks -->
|
||||
<string name="lock_screen_custom_clock_face_category">Lockscreen Clock</string>
|
||||
<string name="lock_screen_custom_clock_face_title">Lockscreen clock style</string>
|
||||
<string name="lock_screen_custom_clock_face_default">Default</string>
|
||||
<string name="lock_screen_custom_clock_face_sfunny">Sfuny</string>
|
||||
<string name="lock_screen_custom_clock_face_oos">OOS</string>
|
||||
<string name="lock_screen_custom_clock_face_clockertino">Clockertino</string>
|
||||
<string name="lock_screen_custom_clock_face_spark">Spark</string>
|
||||
<string name="lock_screen_custom_clock_face_spark_circle">Spark Circle</string>
|
||||
<!-- UDFPS Haptic Feedback -->
|
||||
<string name="udfps_haptic_feedback_title">UDFPS haptic feedback</string>
|
||||
<string name="udfps_haptic_feedback_summary">Vibrate when touching UDFPS icon</string>
|
||||
<!-- Udfps authentication / error vibration -->
|
||||
<string name="udfps_success_vib_title">Udfps authentication vibration</string>
|
||||
<string name="udfps_success_vib_summary">Vibrate on successful fingerprint authentication</string>
|
||||
<string name="udfps_error_vib_title">Udfps error vibration</string>
|
||||
<string name="udfps_error_vib_summary">Vibrate on unsuccessful fingerprint authentication</string>
|
||||
<!-- UDFPS Recog Animation -->
|
||||
<string name="udfps_customization">UDFPS customization</string>
|
||||
<string name="udfps_recog_animation">UDFPS animation</string>
|
||||
<string name="udfps_recog_animation_summary">Shows an animation while reading your finger</string>
|
||||
<string name="udfps_recog_animation_effect_title">UDFPS custom animation</string>
|
||||
<string name="udfps_recog_animation_effect_summary">Choose animation effect</string>
|
||||
<string name="udfps_settings_title">UDFPS settings</string>
|
||||
<string name="udfps_settings_summary">Settings for customizing the UDFPS</string>
|
||||
<!-- UDFPS icon picker -->
|
||||
<string name="udfps_icon_picker_title">UDFPS icon picker</string>
|
||||
<string name="udfps_icon_picker_summary">Choose your favorite fingerprint icon</string>
|
||||
<!-- Custom FOD Icon -->
|
||||
<string name="custom_fp_icon_title">Custom UDFPS Icon</string>
|
||||
<string name="custom_fp_icon_summary">Enable custom UDFPS Icon from files</string>
|
||||
<string name="custom_fp_select_title">Select Custom UDFPS Icon</string>
|
||||
<string name="custom_fp_select_summary">Select custom image from your saved files or gallery</string>
|
||||
<!-- UDFPS pressed color -->
|
||||
<string name="udfps_pressed_color_title">Udfps pressed color</string>
|
||||
<string name="udfps_pressed_color_summary">Choose your favorite udfps pressed color</string>
|
||||
<!-- Fingerprint Ripple Effect -->
|
||||
<string name="enable_fingerprint_ripple_effect_title">Ripple effect</string>
|
||||
<string name="enable_fingerprint_ripple_effect_summary">Show ripple effect on unlock with fingerprint</string>
|
||||
<!-- reTicker -->
|
||||
<string name="reticker_title">reTicker</string>
|
||||
<string name="reticker_summary">Replace heads-up notification with slim and less invasive version of redesigned ticker</string>
|
||||
<string name="new_reticker_title">Alternative reTicker</string>
|
||||
<string name="new_reticker_summary">Use an alternative layout for reticker that is inspired from ios</string>
|
||||
<string name="new_reticker_animation_title">Alternative reTicker animation</string>
|
||||
<string name="new_reticker_animation_summary">Use a different animation for reticker (enabled by default on alternative reTicker)</string>
|
||||
<string name="reticker_colored_title">Use app colored background</string>
|
||||
<string name="reticker_colored_summary">Replace reTicker background color using notification app main color</string>
|
||||
<!-- VoWiFi icon -->
|
||||
<string name="vowifi_icon_title">VoWiFi icon</string>
|
||||
<string name="vowifi_icon_enabled">VoWiFi icon enabled</string>
|
||||
<string name="vowifi_icon_disabled">VoWiFi icon disabled</string>
|
||||
<string name="vowifi_icon_enabled_volte_disabled">VoWiFi instead of VoLTE icon</string>
|
||||
<string name="vowifi_icon_style_title">VoWiFi icon style</string>
|
||||
<string name="vowifi_icon_default">Default Icon</string>
|
||||
<string name="vowifi_icon_emui">EMUI Icon</string>
|
||||
<string name="vowifi_icon_asus">Asus Icon</string>
|
||||
<string name="vowifi_icon_oneplus">OOS Icon</string>
|
||||
<string name="vowifi_icon_moto">Motorola Icon</string>
|
||||
<string name="vowifi_icon_simple1">Simple1 Icon</string>
|
||||
<string name="vowifi_icon_simple2">Simple2 Icon</string>
|
||||
<string name="vowifi_icon_simple3">Simple3 Icon</string>
|
||||
<string name="vowifi_icon_vivo">Vivo Icon</string>
|
||||
<string name="vowifi_icon_margaritov">Margaritov Icon</string>
|
||||
<!-- Privacy Indicator -->
|
||||
<string name="mic_camera_privacy_indicator_title">Mic and camera privacy indicator</string>
|
||||
<string name="mic_camera_privacy_indicator_summary">Show indicator when any app uses mic or camera</string>
|
||||
<string name="location_privacy_indicator_title">Location privacy indicator</string>
|
||||
<string name="location_privacy_indicator_summary">Show indicator when any app uses location</string>
|
||||
<string name="projection_privacy_indicator_title">Media projection privacy indicator</string>
|
||||
<string name="projection_privacy_indicator_summary">Show indicator when device screen is projected</string>
|
||||
<!-- Notification count -->
|
||||
<string name="statusbar_notif_count_title">Show notification count</string>
|
||||
<string name="statusbar_notif_count_summary">Display the number of pending notifications</string>
|
||||
<!-- Statusbar colored icons -->
|
||||
<string name="statusbar_colored_icons_title">Colored icons</string>
|
||||
<string name="statusbar_colored_icons_summary">Use proper app icons for notification icons in statusbar</string>
|
||||
<!-- Bluetooth status -->
|
||||
<string name="bluetooth_battery_title">Bluetooth battery status</string>
|
||||
<string name="bluetooth_battery_summary">Display battery status for the connected bluetooth device, if available</string>
|
||||
<!-- Torch Power button gestures -->
|
||||
<string name="torch_power_button_gesture_title">Toggle torch when screen off</string>
|
||||
<string name="torch_power_button_gesture_none">Disabled</string>
|
||||
<string name="torch_power_button_gesture_dt">Double tap power button (slower single tap response), Disables double power tap for camera.</string>
|
||||
<string name="torch_power_button_gesture_dt_toast">Jump to camera gesture is now disabled</string>
|
||||
<string name="torch_power_button_gesture_lp">Long press power button</string>
|
||||
<!-- App lock -->
|
||||
<string name="app_lock_title">App lock</string>
|
||||
<string name="app_lock_summary">Apps will require fingerprint authentication to launch</string>
|
||||
<string name="app_lock_authentication_dialog_title">Unlock</string>
|
||||
<string name="enable_debugging">Enable debugging</string>
|
||||
<string name="disable_debugging">Disable debugging</string>
|
||||
<string name="app_lock_packages_title">Protected apps</string>
|
||||
<string name="app_lock_packages_summary">Select the apps to protect with biometrics or device credentials</string>
|
||||
<string name="app_lock_timeout_title">Auto lock timeout</string>
|
||||
<string name="app_lock_timeout_summary">Duration of time after which an unlocked app in background should be locked</string>
|
||||
<string name="app_lock_notifications_title">Redact notifications</string>
|
||||
<string name="app_lock_notifications_summary"> Notification content will be hidden and collapsed for selected apps when they are locked.
|
||||
Heads up notifications will be automatically disabled.
|
||||
</string>
|
||||
<string name="app_lock_notifications_disabled_summary">Protect an application first</string>
|
||||
<string name="app_lock_biometrics_allowed_title">Enable biometrics for unlocking</string>
|
||||
<string name="app_lock_footer_text">Bubbles will be automatically dismissed after timeout</string>
|
||||
<string name="enable_protection">Enable protection</string>
|
||||
<!-- Power menu Animations -->
|
||||
<string name="power_menu_animation_title">Power menu animation</string>
|
||||
<string name="power_menu_animation_dialog_title">Select power menu animation</string>
|
||||
<string name="power_menu_animation_aosp">AOSP (default)</string>
|
||||
<string name="power_menu_animation_bottom">Bottom</string>
|
||||
<string name="power_menu_animation_top">Top</string>
|
||||
<string name="power_menu_animation_xylon">Fly</string>
|
||||
<string name="power_menu_animation_slide">Slide</string>
|
||||
<string name="power_menu_animation_turn">Turn</string>
|
||||
<string name="power_menu_animation_fly">Glow</string>
|
||||
<string name="power_menu_animation_card">3D</string>
|
||||
<string name="power_menu_animation_translucent_top">Translucent (top)</string>
|
||||
<string name="power_menu_animation_translucent_bottom">Translucent (bottom)</string>
|
||||
<string name="power_menu_animation_rotate">Rotate</string>
|
||||
<!-- QS tiles animations category -->
|
||||
<string name="qs_tile_animation_category_title">QS Tiles</string>
|
||||
<!-- Tiles animation style -->
|
||||
<string name="qs_tile_animation_style_title">Animation style</string>
|
||||
<string name="qs_tile_animation_duration_title">Animation duration</string>
|
||||
<string name="qs_tile_animation_interpolator_title">Tiles animation interpolator</string>
|
||||
<string name="qs_tile_animation_style_off">No animation</string>
|
||||
<string name="qs_tile_animation_style_flip">Flip</string>
|
||||
<string name="qs_tile_animation_style_rotate">Rotate</string>
|
||||
<string name="qs_tile_animation_duration_low">Low</string>
|
||||
<string name="qs_tile_animation_duration_default">Default</string>
|
||||
<string name="qs_tile_animation_duration_fast">Fast</string>
|
||||
<string name="qs_tile_animation_duration_quite_fast">Quite fast</string>
|
||||
<string name="qs_tile_animation_duration_super_fast">Super fast</string>
|
||||
<string name="qs_tile_animation_interpolator_linearInterpolator">Linear</string>
|
||||
<string name="qs_tile_animation_interpolator_accelerateInterpolator">Accelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_decelerateInterpolator">Decelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_accelerateDecelerateInterpolator">Accelerate decelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_bounceInterpolator">Bounce</string>
|
||||
<string name="qs_tile_animation_interpolator_overshootInterpolator">Overshoot</string>
|
||||
<string name="qs_tile_animation_interpolator_anticipateInterpolator">Anticipate</string>
|
||||
<string name="qs_tile_animation_interpolator_anticipateOvershootInterpolator">Anticipate overshoot</string>
|
||||
<string name="qs_set_animation_style">%1$s</string>
|
||||
<string name="qs_set_animation_duration">%1$s</string>
|
||||
<string name="qs_set_animation_interpolator">%1$s</string>
|
||||
<!-- Power menu and dialogs opacity -->
|
||||
<string name="power_menu_transparency">Power/reboot menu opacity</string>
|
||||
<string name="power_menu_dialog_dim">Power/reboot dialog dim background amount</string>
|
||||
<!-- Black theme -->
|
||||
<string name="custom_theme_title">Use Custom theme</string>
|
||||
<string name="custom_theme_summary">Force custom background colors</string>
|
||||
<string name="custom_theme_default">Default</string>
|
||||
<string name="custom_theme_black">Black</string>
|
||||
<string name="custom_theme_clear">Clear</string>
|
||||
<string name="custom_theme_vivid">Vivid(Monet)</string>
|
||||
<!-- Pulse music visualizer -->
|
||||
<string name="pulse_help_policy_notice_title">About Pulse</string>
|
||||
<string name="pulse_help_policy_notice_summary">Pulse is a brilliant audio graphic equalizer when music plays on the device</string>
|
||||
<string name="pulse_settings">Pulse</string>
|
||||
<string name="pulse_settings_summary">Audio graphic equalizer for navigation bar and lockscreen</string>
|
||||
<string name="show_navbar_pulse_title">Navbar Pulse</string>
|
||||
<string name="show_navbar_pulse_summary">Audio graphic equalizer on the navigation bar</string>
|
||||
<string name="show_lockscreen_pulse_title">Lockscreen Pulse</string>
|
||||
<string name="show_lockscreen_pulse_summary">Audio graphic equalizer on the lockscreen</string>
|
||||
<string name="show_ambient_pulse_title">Ambient Pulse</string>
|
||||
<string name="show_ambient_pulse_summary">Audio graphic equalizer on the ambient screen</string>
|
||||
<string name="pulse_render_mode_title">Render mode</string>
|
||||
<string name="pulse_render_mode_fading_bars">Fading blocks</string>
|
||||
<string name="pulse_render_mode_solid_lines">Solid lines</string>
|
||||
<string name="pulse_legacy_mode_advanced_category">Fading blocks mode settings</string>
|
||||
<string name="pulse_custom_fudge_factor">Sanity level</string>
|
||||
<string name="pulse_lavalamp_speed_title">Lava lamp speed</string>
|
||||
<string name="pulse_solid_units_count">Solid lines count</string>
|
||||
<string name="pulse_solid_units_opacity">Solid lines opacity</string>
|
||||
<string name="pulse_solid_units_rounded_title">Rounded corners</string>
|
||||
<string name="pulse_solid_units_rounded_summary">Solid lines with rounded tip</string>
|
||||
<string name="pulse_solid_dimen_category">Solid lines mode settings</string>
|
||||
<string name="pulse_color_mode_title">Color</string>
|
||||
<string name="pulse_color_accent">Accent</string>
|
||||
<string name="pulse_color_custom">Custom</string>
|
||||
<string name="pulse_color_lava_lamp">Lava lamp</string>
|
||||
<string name="pulse_color_user_title">Choose color</string>
|
||||
<string name="pulse_smoothing_enabled_title">Turn on smoothing</string>
|
||||
<string name="pulse_smoothing_enabled_summary">Each bar is animated more smoothly</string>
|
||||
<string name="pulse_custom_dimen">Bar width</string>
|
||||
<string name="pulse_custom_div">Bar spacing</string>
|
||||
<string name="pulse_filled_block_size">Block size</string>
|
||||
<string name="pulse_empty_block_size">Block spacing</string>
|
||||
<!-- Pulse Gravity n Mirror Options -->
|
||||
<string name="pulse_custom_gravity_title">Gravity</string>
|
||||
<string name="pulse_custom_gravity_bottom">Bottom</string>
|
||||
<string name="pulse_custom_gravity_top">Top</string>
|
||||
<string name="pulse_custom_gravity_center">Center</string>
|
||||
<string name="visualizer_center_mirrored_title">Center mirrored</string>
|
||||
<string name="visualizer_center_mirrored_summary">Set the visualizer in center mirrored mode</string>
|
||||
<string name="pulse_vertical_mirror_title">Vertical Mirror</string>
|
||||
<string name="pulse_vertical_mirror_summary">Create other pulse and flip vertically</string>
|
||||
<!-- Smart charging -->
|
||||
<string name="smart_charging_title">Smart Charging</string>
|
||||
<string name="smart_charging_summary">Set maximum charging level</string>
|
||||
<string name="smart_charging_switch_title">Enable Smart Charging</string>
|
||||
<string name="smart_charging_level_title">Stop trigger level</string>
|
||||
<string name="smart_charging_resume_level_title">Start trigger level</string>
|
||||
<string name="smart_charging_reset_stats_title">Reset battery statistics</string>
|
||||
<string name="smart_charging_reset_stats_summary">Reset battery statistics after reaching user defined charging level</string>
|
||||
<string name="smart_charging_footer">Smart Charging allows you to set maximum charging level to extend the lifespan of your battery. When enabled, battery stops charging at Stop trigger level and resumes charging at Start trigger level. Stop trigger level should be always greater than Start trigger level.</string>
|
||||
<!-- Quick settings styling -->
|
||||
<string name="qs_styling">Quick Settings UI</string>
|
||||
<string name="qs_styles_title">QS Panel Styles</string>
|
||||
<string name="qs_outline">QS Outline Style</string>
|
||||
<string name="qs_two_tone">QS Two-Tone Accent</string>
|
||||
<string name="qs_color_pop">QS Color Pop</string>
|
||||
<!-- QS tiles layout direction: vertical or horizontal -->
|
||||
<string name="qs_tile_layout_category_title">Tile layout</string>
|
||||
<string name="qs_tile_layout_title">Title Alignment</string>
|
||||
<string name="qs_tile_layout_summary">Enable for centered layout.</string>
|
||||
<!-- QS tiles title visibility -->
|
||||
<string name="qs_tile_title_visibility_title">Hide tile titles</string>
|
||||
<string name="qs_tile_title_visibility_summary">Toggle to hide tile titles</string>
|
||||
<!-- QS tiles layout -->
|
||||
<string name="qs_layout_category_title">Tiles layout</string>
|
||||
<string name="qs_tile_label_hide_title">Hide label</string>
|
||||
<string name="qs_tile_label_hide_summary">Only show icon in tile</string>
|
||||
<string name="qs_tile_label_size_title">Label text size</string>
|
||||
<string name="qs_columns_portrait_title">Columns (portrait)</string>
|
||||
<string name="qs_columns_landscape_title">Columns (landscape)</string>
|
||||
<!-- Squiggle animation -->
|
||||
<string name="show_squiggle_animation_title">Show squiggle animation</string>
|
||||
<string name="show_squiggle_animation_summary">Show media panel squiggle animation, after change need to switch music, pause music or move the progress bar to apply</string>
|
||||
<!-- Lockscreen interface -->
|
||||
<string name="lockscreen_interface_title">Lockscreen User Interface</string>
|
||||
<string name="lockscreen_clock_color_title">Custom lockscreen clock color</string>
|
||||
<string name="lockscreen_clock_color_summary">Use custom color instead of wallpaper accent</string>
|
||||
<string name="kg_custom_clock_color_title">Choose lockscreen clock color</string>
|
||||
<string name="kg_custom_clock_font_title">Custom lockscreen clock font</string>
|
||||
<string name="kg_custom_date_font_title">Custom lockscreen date font</string>
|
||||
<string name="small_clock_doubleline_title">Double-line Lockscreen clock format</string>
|
||||
<string name="small_clock_doubleline_summary">Use double-line clock instead of single line style for lockscreen clock</string>
|
||||
<!-- QS Weather Options -->
|
||||
<string name="qs_weather_title">QS System weather style</string>
|
||||
<string name="qs_weather_summary">Configure system weather</string>
|
||||
<string name="qsweather_dialog_title">QuickSettings weather location</string>
|
||||
<string name="qs_weather_hidden">Hide weather</string>
|
||||
<string name="qs_temperature_image_show_scale">Show temp with scale and image</string>
|
||||
<string name="qs_temperature_image_hide_scale">Show temp with image without scale</string>
|
||||
<string name="qs_temperature_show_scale_hide_image">Show temp with scale</string>
|
||||
<string name="qs_temperature_hide_scale_hide_image">Show temp without scale</string>
|
||||
<string name="qs_show_image">Show image</string>
|
||||
<string name="weather_show_all_condition">Show temp with scale,image and weather condition</string>
|
||||
<string name="qsweather_position_qqs">QuickSettings</string>
|
||||
<string name="qsweather_position_qsb">QuickStatusbar</string>
|
||||
<string name="qsweather_position_both">Both</string>
|
||||
<!-- Launcher Weather Options -->
|
||||
<string name="launcher_weather_title">Launcher System weather style</string>
|
||||
<!-- Launcher Weather Options -->
|
||||
<string name="kg_weather_title">Lockscreen System weather style</string>
|
||||
<!-- Omni weather -->
|
||||
<string name="qs_weather_settings_title">Weather Settings</string>
|
||||
<string name="qs_weather_settings_summary">Setup icon pack and weather service</string>
|
||||
<string name="weather_title">Weather Settings</string>
|
||||
<string name="weather_config_title">Weather service</string>
|
||||
<string name="weather_config_summary">System service settings</string>
|
||||
<string name="weather_icon_pack_title">Condition icon pack</string>
|
||||
<string name="weather_icon_pack_note">Note\u003a you can install new icon packs from play store by searching for \"Chronus icons\"</string>
|
||||
<string name="weather_icon_pack_info_title">Tips\u003a \n\n1. Users can install new icon packs from play store by searching for \"Chronus icons\".\n\n2. Condition icon pack is used for weather icons on quick settings and sushi launcher at a glance.\n\n3. Long press the QuickSettings weather view/logo/temperature to access weather settings with ease.</string>
|
||||
<string name="qsweather_settings_title">QuickSettings Weather</string>
|
||||
<string name="qsweather_settings_summary">Setup quicksettings weather views</string>
|
||||
<!-- QS footer warnings -->
|
||||
<string name="qs_footer_warnings_title">Footer alerts</string>
|
||||
<string name="qs_footer_warnings_summary">Display an alert at bottom of QS panel when network is monitored by external apps or VPN</string>
|
||||
<!-- QS footer icons -->
|
||||
<string name="qs_footer_users_icon_title">User account icon</string>
|
||||
<string name="qs_footer_users_icon_summary">Display multiuser accessibility icon when available</string>
|
||||
<string name="qs_footer_edit_icon_title">Edit tiles icon</string>
|
||||
<string name="qs_footer_show_power_menu_title">Power menu shortcut</string>
|
||||
<string name="qs_footer_services_icon_title">Running services shortcut</string>
|
||||
<string name="qs_footer_settings_icon_title">Settings shortcut</string>
|
||||
</resources>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -119,6 +119,17 @@
|
||||
|
||||
<string-array name="status_bar_battery_style_entries" translatable="false">
|
||||
<item>@string/status_bar_battery_style_icon_portrait</item>
|
||||
<item>@string/status_bar_battery_style_icon_rlandscape</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_buddy</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_line</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_musku</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_pill</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_signal</item>
|
||||
<item>@string/status_bar_battery_style_icon_rlandscape_style_a</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_style_a</item>
|
||||
<item>@string/status_bar_battery_style_icon_rlandscape_style_b</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape_style_b</item>
|
||||
<item>@string/status_bar_battery_style_circle</item>
|
||||
<item>@string/status_bar_battery_style_dotted_circle</item>
|
||||
<item>@string/status_bar_battery_style_filled_circle</item>
|
||||
@@ -126,10 +137,22 @@
|
||||
<item>@string/status_bar_battery_style_big_dotted_circle</item>
|
||||
<item>@string/status_bar_battery_style_text</item>
|
||||
<item>@string/status_bar_battery_style_hidden</item>
|
||||
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_battery_style_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>13</item>
|
||||
<item>14</item>
|
||||
<item>15</item>
|
||||
<item>16</item>
|
||||
<item>17</item>
|
||||
<item>18</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
@@ -142,7 +165,9 @@
|
||||
<!-- QS battery style -->
|
||||
<string-array name="qs_battery_style_entries" translatable="false">
|
||||
<item>@string/qs_use_status_bar_battery_style</item>
|
||||
<item>@string/status_bar_battery_style_icon_portrait</item>
|
||||
<item>@string/status_bar_battery_style_icon_portrait</item>
|
||||
<item>@string/status_bar_battery_style_icon_rlandscape</item>
|
||||
<item>@string/status_bar_battery_style_icon_landscape</item>
|
||||
<item>@string/status_bar_battery_style_circle</item>
|
||||
<item>@string/status_bar_battery_style_dotted_circle</item>
|
||||
<item>@string/status_bar_battery_style_filled_circle</item>
|
||||
@@ -162,6 +187,642 @@
|
||||
<item>7</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Quick Settings brightness slider -->
|
||||
<string-array name="qs_show_brightness_slider_entries" translatable="false">
|
||||
<item>@string/qs_show_brightness_slider_never</item>
|
||||
<item>@string/qs_show_brightness_slider_expanded</item>
|
||||
<item>@string/qs_show_brightness_slider_always</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_show_brightness_slider_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_brightness_slider_position_entries" translatable="false">
|
||||
<item>@string/qs_brightness_slider_position_top</item>
|
||||
<item>@string/qs_brightness_slider_position_bottom</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_brightness_slider_position_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<!--- Volume key cursor control -->
|
||||
<string-array name="volume_key_cursor_control_entries">
|
||||
<item>@string/volume_key_cursor_control_off</item>
|
||||
<item>@string/volume_key_cursor_control_on</item>
|
||||
<item>@string/volume_key_cursor_control_on_reverse</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="volume_key_cursor_control_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- HW Keys customization -->
|
||||
<string-array name="action_dialog_entries">
|
||||
<item>@string/action_entry_default_action</item>
|
||||
<item>@string/action_entry_custom_action</item>
|
||||
<item>@string/action_entry_select_app</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="action_dialog_values" translatable="false">
|
||||
<item>@string/action_value_default_action</item>
|
||||
<item>@string/action_value_custom_action</item>
|
||||
<item>@string/action_value_select_app</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="action_dialog_no_default_entries">
|
||||
<item>@string/action_entry_custom_action</item>
|
||||
<item>@string/action_entry_select_app</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="action_dialog_no_default_values" translatable="false">
|
||||
<item>@string/action_value_custom_action</item>
|
||||
<item>@string/action_value_select_app</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Volume step options. -->
|
||||
<string-array name="volume_steps_entries" translatable="false">
|
||||
<item>60</item>
|
||||
<item>45</item>
|
||||
<item>30</item>
|
||||
<item>15</item>
|
||||
<item>7</item>
|
||||
<item>5</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>3</item>
|
||||
<item>4</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Status bar - Clock -->
|
||||
<string-array name="status_bar_clock_position_entries" translatable="false">
|
||||
<item>@string/status_bar_clock_position_right</item>
|
||||
<item>@string/status_bar_clock_position_center</item>
|
||||
<item>@string/status_bar_clock_position_left</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_entries_rtl" translatable="false">
|
||||
<item>@string/status_bar_clock_position_left</item>
|
||||
<item>@string/status_bar_clock_position_center</item>
|
||||
<item>@string/status_bar_clock_position_right</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_values_rtl" translatable="false">
|
||||
<item>2</item>
|
||||
<item>1</item>
|
||||
<item>0</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_entries_notch" translatable="false">
|
||||
<item>@string/status_bar_clock_position_right</item>
|
||||
<item>@string/status_bar_clock_position_left</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_values_notch" translatable="false">
|
||||
<item>0</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_entries_notch_rtl" translatable="false">
|
||||
<item>@string/status_bar_clock_position_left</item>
|
||||
<item>@string/status_bar_clock_position_right</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_clock_position_values_notch_rtl" translatable="false">
|
||||
<item>2</item>
|
||||
<item>0</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_am_pm_entries" translatable="false">
|
||||
<item>@string/status_bar_am_pm_hidden</item>
|
||||
<item>@string/status_bar_am_pm_normal</item>
|
||||
<item>@string/status_bar_am_pm_small</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_am_pm_values" translatable="false">
|
||||
<item>2</item>
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="clock_date_position_entries" translatable="false">
|
||||
<item>@string/clock_date_left</item>
|
||||
<item>@string/clock_date_right</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="clock_date_position_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_date_entries">
|
||||
<item>@string/status_bar_date_none</item>
|
||||
<item>@string/status_bar_date_small</item>
|
||||
<item>@string/status_bar_date_normal</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_date_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_date_style_entries">
|
||||
<item>@string/status_bar_date_style_normal</item>
|
||||
<item>@string/status_bar_date_style_lowercase</item>
|
||||
<item>@string/status_bar_date_style_uppercase</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_date_style_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="status_bar_date_format_entries_values" translatable="false">
|
||||
<item>dd/MM/yy</item>
|
||||
<item>MM/dd/yy</item>
|
||||
<item>yyyy-MM-dd</item>
|
||||
<item>yyyy-dd-MM</item>
|
||||
<item>dd-MM-yyyy</item>
|
||||
<item>MM-dd-yyyy</item>
|
||||
<item>MMM dd</item>
|
||||
<item>MMM dd, yyyy</item>
|
||||
<item>MMMM dd, yyyy</item>
|
||||
<item>EEE</item>
|
||||
<item>EEE dd</item>
|
||||
<item>EEE dd/MM</item>
|
||||
<item>EEE MM/dd</item>
|
||||
<item>EEE dd MMM</item>
|
||||
<item>EEE MMM dd</item>
|
||||
<item>EEE MMMM dd</item>
|
||||
<item>EEEE dd/MM</item>
|
||||
<item>EEEE MM/dd</item>
|
||||
<item>@string/status_bar_date_format_custom</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Edge light color modes -->
|
||||
<string-array name="edge_light_color_mode_entries" translatable="false">
|
||||
<item>@string/accent_color</item>
|
||||
<item>@string/notification_color</item>
|
||||
<item>@string/wallpaper_color</item>
|
||||
<item>@string/custom_color</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="edge_light_color_mode_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Settings dashboard styles-->
|
||||
<string-array name="settings_dashboard_style_entries" translatable="false">
|
||||
<item>@string/settings_dashboard_style_aosp</item>
|
||||
<item>@string/settings_dashboard_style_oos11</item>
|
||||
<item>@string/settings_dashboard_style_oos12</item>
|
||||
<item>@string/settings_dashboard_style_cherish</item>
|
||||
<item>@string/settings_dashboard_style_cherish_clean</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="settings_dashboard_style_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Lockscreen Clock -->
|
||||
<string-array name="lock_screen_custom_clock_face_entries" translatable="false">
|
||||
<item>@string/lock_screen_custom_clock_face_default</item>
|
||||
<item>@string/lock_screen_custom_clock_face_sfunny</item>
|
||||
<item>@string/lock_screen_custom_clock_face_oos</item>
|
||||
<item>@string/lock_screen_custom_clock_face_clockertino</item>
|
||||
<item>@string/lock_screen_custom_clock_face_spark</item>
|
||||
<item>@string/lock_screen_custom_clock_face_spark_circle</item>
|
||||
</string-array>
|
||||
<string-array name="lock_screen_custom_clock_face_values" translatable="false">
|
||||
<item>com.android.keyguard.clock.DefaultClockController</item>
|
||||
<item>com.android.keyguard.clock.SfunnyClockController</item>
|
||||
<item>com.android.keyguard.clock.OOSClockController</item>
|
||||
<item>com.android.keyguard.clock.ClockertinoClockController</item>
|
||||
<item>com.android.keyguard.clock.SparkClockController</item>
|
||||
<item>com.android.keyguard.clock.SparkCircleClockController</item>
|
||||
</string-array>
|
||||
|
||||
<!-- VoWiFi Icon -->
|
||||
<string-array name="vowifi_icon_entries" translatable="false">
|
||||
<item>@string/vowifi_icon_disabled</item>
|
||||
<item>@string/vowifi_icon_enabled</item>
|
||||
<item>@string/vowifi_icon_enabled_volte_disabled</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="vowifi_icon_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- VoWiFi icon style -->
|
||||
<string-array name="vowifi_icon_style_entries" translatable="false">
|
||||
<item>@string/vowifi_icon_default</item>
|
||||
<item>@string/vowifi_icon_oneplus</item>
|
||||
<item>@string/vowifi_icon_moto</item>
|
||||
<item>@string/vowifi_icon_asus</item>
|
||||
<item>@string/vowifi_icon_emui</item>
|
||||
<item>@string/vowifi_icon_simple1</item>
|
||||
<item>@string/vowifi_icon_simple2</item>
|
||||
<item>@string/vowifi_icon_simple3</item>
|
||||
<item>@string/vowifi_icon_vivo</item>
|
||||
<item>@string/vowifi_icon_margaritov</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="vowifi_icon_style_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Torch Power button gestures -->
|
||||
<string-array name="torch_power_button_gesture_entries">
|
||||
<item>@string/torch_power_button_gesture_none</item>
|
||||
<item>@string/torch_power_button_gesture_dt</item>
|
||||
<item>@string/torch_power_button_gesture_lp</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="torch_power_button_gesture_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- App lock timeout -->
|
||||
<string-array name="app_lock_timeout_entries">
|
||||
<item>5 seconds</item>
|
||||
<item>10 seconds</item>
|
||||
<item>30 seconds</item>
|
||||
<item>1 minute</item>
|
||||
<item>5 minutes</item>
|
||||
<item>10 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="app_lock_timeout_values" translatable="false">
|
||||
<item>5000</item>
|
||||
<item>10000</item>
|
||||
<item>30000</item>
|
||||
<item>60000</item>
|
||||
<item>300000</item>
|
||||
<item>600000</item>
|
||||
<item>1800000</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Power menu Animations -->
|
||||
<string-array name="power_menu_animations_entries">
|
||||
<item>@string/power_menu_animation_aosp</item>
|
||||
<item>@string/power_menu_animation_bottom</item>
|
||||
<item>@string/power_menu_animation_top</item>
|
||||
<item>@string/power_menu_animation_fly</item>
|
||||
<item>@string/power_menu_animation_turn</item>
|
||||
<item>@string/power_menu_animation_slide</item>
|
||||
<item>@string/power_menu_animation_xylon</item>
|
||||
<item>@string/power_menu_animation_card</item>
|
||||
<item>@string/power_menu_animation_translucent_top</item>
|
||||
<item>@string/power_menu_animation_translucent_bottom</item>
|
||||
<item>@string/power_menu_animation_rotate</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="power_menu_animations_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Tiles animation style -->
|
||||
<string-array name="qs_tile_animation_style_entries" translatable="false">
|
||||
<item>@string/qs_tile_animation_style_off</item>
|
||||
<item>@string/qs_tile_animation_style_flip</item>
|
||||
<item>@string/qs_tile_animation_style_rotate</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_tile_animation_style_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Tiles animation duration -->
|
||||
<string-array name="qs_tile_animation_duration_entries" translatable="false">
|
||||
<item>@string/qs_tile_animation_duration_low</item>
|
||||
<item>@string/qs_tile_animation_duration_default</item>
|
||||
<item>@string/qs_tile_animation_duration_fast</item>
|
||||
<item>@string/qs_tile_animation_duration_quite_fast</item>
|
||||
<item>@string/qs_tile_animation_duration_super_fast</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Pulse music visualizer -->
|
||||
<string-array name="pulse_render_mode_entries">
|
||||
<item>@string/pulse_render_mode_fading_bars</item>
|
||||
<item>@string/pulse_render_mode_solid_lines</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pulse_render_mode_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pulse_color_mode_entries">
|
||||
<item>@string/pulse_color_accent</item>
|
||||
<item>@string/pulse_color_custom</item>
|
||||
<item>@string/pulse_color_lava_lamp</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pulse_color_mode_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_tile_animation_duration_values" translatable="false">
|
||||
<item>2500</item>
|
||||
<item>2000</item>
|
||||
<item>1500</item>
|
||||
<item>1000</item>
|
||||
<item>500</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pulse_custom_gravity_entries">
|
||||
<item>@string/pulse_custom_gravity_bottom</item>
|
||||
<item>@string/pulse_custom_gravity_top</item>
|
||||
<item>@string/pulse_custom_gravity_center</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pulse_custom_gravity_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Tiles animation interpolator -->
|
||||
<string-array name="qs_tile_animation_interpolator_entries" translatable="false">
|
||||
<item>@string/qs_tile_animation_interpolator_linearInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_accelerateInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_decelerateInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_accelerateDecelerateInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_bounceInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_overshootInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_anticipateInterpolator</item>
|
||||
<item>@string/qs_tile_animation_interpolator_anticipateOvershootInterpolator</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_tile_animation_interpolator_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="custom_theme_entries" translatable="false">
|
||||
<item>@string/custom_theme_default</item>
|
||||
<item>@string/custom_theme_black</item>
|
||||
<item>@string/custom_theme_clear</item>
|
||||
<item>@string/custom_theme_vivid</item>
|
||||
</string-array>
|
||||
<string-array name="custom_theme_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_styles_entries" translatable="false">
|
||||
<item>@string/default_string</item>
|
||||
<item>@string/qs_outline</item>
|
||||
<item>@string/qs_two_tone</item>
|
||||
<item>@string/qs_color_pop</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_styles_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Lockscreen Clock -->
|
||||
<string-array name="kg_custom_clock_font_entries" translatable="false">
|
||||
<item>@string/default_string</item>
|
||||
<item>accuratist</item>
|
||||
<item>aclonica</item>
|
||||
<item>amarante</item>
|
||||
<item>bariol</item>
|
||||
<item>cagliostro</item>
|
||||
<item>cocon</item>
|
||||
<item>comfortaa</item>
|
||||
<item>comicsans</item>
|
||||
<item>coolstory</item>
|
||||
<item>exotwo</item>
|
||||
<item>fifa 2018</item>
|
||||
<item>fluid sans</item>
|
||||
<item>google sans</item>
|
||||
<item>grandhotel</item>
|
||||
<item>harmony os sans</item>
|
||||
<item>inter custom</item>
|
||||
<item>jtleonor</item>
|
||||
<item>lato</item>
|
||||
<item>lg smart gothic</item>
|
||||
<item>linotte</item>
|
||||
<item>misans</item>
|
||||
<item>nokia pure</item>
|
||||
<item>nothingdot57</item>
|
||||
<item>nunito</item>
|
||||
<item>oneplus sans</item>
|
||||
<item>oneplus slate</item>
|
||||
<item>oppo sans</item>
|
||||
<item>oswald bold</item>
|
||||
<item>product sans vh</item>
|
||||
<item>quando</item>
|
||||
<item>redressed</item>
|
||||
<item>reemkufi</item>
|
||||
<item>roboto condensed</item>
|
||||
<item>rosemary</item>
|
||||
<item>rubik bold</item>
|
||||
<item>samsung one</item>
|
||||
<item>san francisco</item>
|
||||
<item>simple day</item>
|
||||
<item>sony sketch</item>
|
||||
<item>storopia</item>
|
||||
<item>surfer</item>
|
||||
<item>ubuntu</item>
|
||||
<item>manrope</item>
|
||||
<item>notosans</item>
|
||||
<item>recursive casual</item>
|
||||
<item>recursive</item>
|
||||
<item>roboto system</item>
|
||||
<item>sourcesans</item>
|
||||
<item>serif</item>
|
||||
<item>google sans clock(weight 400)</item>
|
||||
<item>apice outline</item>
|
||||
<item>audimat</item>
|
||||
<item>geometos soft extra bold</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="kg_custom_clock_font_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
<item>7</item>
|
||||
<item>8</item>
|
||||
<item>9</item>
|
||||
<item>10</item>
|
||||
<item>11</item>
|
||||
<item>12</item>
|
||||
<item>13</item>
|
||||
<item>14</item>
|
||||
<item>15</item>
|
||||
<item>16</item>
|
||||
<item>17</item>
|
||||
<item>18</item>
|
||||
<item>19</item>
|
||||
<item>20</item>
|
||||
<item>21</item>
|
||||
<item>22</item>
|
||||
<item>23</item>
|
||||
<item>24</item>
|
||||
<item>25</item>
|
||||
<item>26</item>
|
||||
<item>27</item>
|
||||
<item>28</item>
|
||||
<item>29</item>
|
||||
<item>30</item>
|
||||
<item>31</item>
|
||||
<item>32</item>
|
||||
<item>33</item>
|
||||
<item>34</item>
|
||||
<item>35</item>
|
||||
<item>36</item>
|
||||
<item>37</item>
|
||||
<item>38</item>
|
||||
<item>39</item>
|
||||
<item>40</item>
|
||||
<item>41</item>
|
||||
<item>42</item>
|
||||
<item>43</item>
|
||||
<item>44</item>
|
||||
<item>45</item>
|
||||
<item>46</item>
|
||||
<item>47</item>
|
||||
<item>48</item>
|
||||
<item>49</item>
|
||||
<item>50</item>
|
||||
<item>51</item>
|
||||
<item>52</item>
|
||||
<item>53</item>
|
||||
</string-array>
|
||||
|
||||
<!-- KG/LAUNCHER Weather options -->
|
||||
<string-array name="kg_launcher_weather_entries" translatable="false">
|
||||
<item>@string/qs_weather_hidden</item>
|
||||
<item>@string/qs_temperature_image_show_scale</item>
|
||||
<item>@string/qs_temperature_image_hide_scale</item>
|
||||
<item>@string/qs_temperature_show_scale_hide_image</item>
|
||||
<item>@string/qs_temperature_hide_scale_hide_image</item>
|
||||
<item>@string/qs_show_image</item>
|
||||
<item>@string/weather_show_all_condition</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="kg_launcher_weather_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
</string-array>
|
||||
|
||||
<!-- QS Weather options -->
|
||||
<string-array name="qs_weather_entries" translatable="false">
|
||||
<item>@string/qs_weather_hidden</item>
|
||||
<item>@string/qs_temperature_image_show_scale</item>
|
||||
<item>@string/qs_temperature_image_hide_scale</item>
|
||||
<item>@string/qs_temperature_show_scale_hide_image</item>
|
||||
<item>@string/qs_temperature_hide_scale_hide_image</item>
|
||||
<item>@string/qs_show_image</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qs_weather_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
</string-array>
|
||||
|
||||
<!-- QS Weather positions -->
|
||||
<string-array name="qsweather_position_entries" translatable="false">
|
||||
<item>@string/qsweather_position_qqs</item>
|
||||
<item>@string/qsweather_position_qsb</item>
|
||||
<item>@string/qsweather_position_both</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="qsweather_position_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<string name="qs_category">QS category</string>
|
||||
<string name="navbar_title">Navigation bar</string>
|
||||
<string name="volume_keys_title">Volume keys</string>
|
||||
<string name="udfps_category">UDFPS</string>
|
||||
|
||||
<!-- General strings -->
|
||||
<string name="ok">OK</string>
|
||||
@@ -75,6 +76,13 @@
|
||||
<string name="profile_choose_app">Choose app</string>
|
||||
<string name="dialog_delete_title">Delete</string>
|
||||
<string name="dialog_delete_message">Remove selected item?</string>
|
||||
|
||||
<!-- Units -->
|
||||
<string name="unit_milliseconds">milliseconds</string>
|
||||
<string name="unit_percent" translatable="false">\u0025</string>
|
||||
<string name="unit_pixels" translatable="false">dp</string>
|
||||
<string name="unit_seconds">seconds</string>
|
||||
<string name="unit_x1000ms" translatable="false">x1000 ms</string>
|
||||
|
||||
<!-- QS settings -->
|
||||
<string name="qs_title">Quick settings</string>
|
||||
@@ -113,9 +121,6 @@
|
||||
|
||||
<string name="notification_light_settings">Notifications light</string>
|
||||
|
||||
<!-- Volume rocker wake -->
|
||||
<string name="volume_rocker_wake_title">Volume rocker wake</string>
|
||||
|
||||
<string name="search">Search</string>
|
||||
<string name="search_apps">Search apps</string>
|
||||
|
||||
@@ -277,6 +282,17 @@
|
||||
<string name="status_bar_battery_percent_title">Battery percentage</string>
|
||||
<string name="status_bar_battery_style_title">Battery style</string>
|
||||
<string name="status_bar_battery_style_icon_portrait">Icon portrait (default)</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape">Icon landscape (Right)</string>
|
||||
<string name="status_bar_battery_style_icon_landscape">Icon landscape (Left)</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape_style_a">Landscape R Style A</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_style_a">Landscape L Style A</string>
|
||||
<string name="status_bar_battery_style_icon_rlandscape_style_b">Landscape R Style B</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_style_b">Landscape L Style B</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_pill">Portrait Mx</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_line">Landscape Lorn</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_musku">Portrait IOS</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_signal">Landscape Airoo</string>
|
||||
<string name="status_bar_battery_style_icon_landscape_buddy">Landscape Capsule</string>
|
||||
<string name="status_bar_battery_style_circle">Circle</string>
|
||||
<string name="status_bar_battery_style_dotted_circle">Circle (Dotted)</string>
|
||||
<string name="status_bar_battery_style_filled_circle">Circle (Filled)</string>
|
||||
@@ -295,5 +311,603 @@
|
||||
<string name="qs_battery_category_title">In QS Panel</string>
|
||||
<string name="qs_battery_percent_title" translatable="false">@string/status_bar_battery_percent_title</string>
|
||||
<string name="qs_use_status_bar_battery_style">Follow status bar style</string>
|
||||
|
||||
<!-- Statusbar Clock background chip -->
|
||||
<string name="statusbar_clock_chip_title">Background chip</string>
|
||||
<string name="statusbar_clock_chip_summary">Display accented chip behind clock</string>
|
||||
|
||||
<!-- Quick Settings brightness slider -->
|
||||
<string name="qs_show_brightness_slider_title">Brightness slider</string>
|
||||
<string name="qs_show_brightness_slider_never">Never show</string>
|
||||
<string name="qs_show_brightness_slider_expanded">Show when expanded</string>
|
||||
<string name="qs_show_brightness_slider_always">Show always</string>
|
||||
<string name="qs_show_brightness_slider_not_expanded">Show when not expanded</string>
|
||||
<string name="qs_brightness_slider_position_title">Position</string>
|
||||
<string name="qs_brightness_slider_position_top">Top</string>
|
||||
<string name="qs_brightness_slider_position_bottom">Bottom</string>
|
||||
|
||||
<!-- Quick Settings brightness icon -->
|
||||
<string name="qs_show_auto_brightness_title">Auto brightness icon</string>
|
||||
<string name="qs_show_auto_brightness_summary">Show toggle for adaptive brightness near the slider</string>
|
||||
|
||||
<!-- Laboratory - Ignore window secure -->
|
||||
<string name="laboratory_ignore_window_secure_title">Ignore window secure flags</string>
|
||||
<string name="laboratory_ignore_window_secure_summary">This removes the screenshots and screenrecords limits for all applications. Normally, special applications are replaced with black areas in records. This can be convenient in some cases but may lead to privacy leaks. After changing this toggle, you may need to restart applications for the change to take effect.</string>
|
||||
|
||||
<!-- Lockscreen battery info -->
|
||||
<string name="lockscreen_charging_info_title">Show charging info in lockscreen</string>
|
||||
<string name="lockscreen_charging_info_summary">Shows temperature, charging current and more while plugged in</string>
|
||||
|
||||
<!-- QS Transparency -->
|
||||
<string name="qs_transparency_title">Background transparency</string>
|
||||
<string name="qs_transparency_summary">Set transparency level for QS background</string>
|
||||
|
||||
<string name="click_partial_screenshot_title">Click to partial screenshot</string>
|
||||
<string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string>
|
||||
|
||||
<!-- Brightness control -->
|
||||
<string name="status_bar_brightness_control_title">Brightness control</string>
|
||||
<string name="status_bar_brightness_control_summary">Adjust brightness by sliding across the status bar</string>
|
||||
|
||||
<!-- Power menu on lockscreen -->
|
||||
<string name="power_menu_hide_on_secure_title">Hide power menu on lock screen</string>
|
||||
<string name="power_menu_hide_on_secure_summary">This will hide the power menu only on a secure lock screen</string>
|
||||
|
||||
<!-- Hide Status bar on lock screen -->
|
||||
<string name="hide_lockscreen_status_bar_title">Hide status bar</string>
|
||||
<string name="hide_lockscreen_status_bar_summary">Touch status bar to toggle visibility</string>
|
||||
|
||||
<!-- Navigation bar -->
|
||||
<string name="navigation_bar_category">Navigation bar</string>
|
||||
<string name="navigation_bar_title">On-screen navigation bar</string>
|
||||
<string name="navigation_bar_summary">Enable on-screen navigation keys</string>
|
||||
<string name="navigation_bar_arrow_keys_title">Show arrow keys while typing</string>
|
||||
<string name="navigation_bar_arrow_keys_summary">Display left and right cursor buttons in navigation bar while typing</string>
|
||||
<string name="navigation_bar_compact_layout_title">Compact layout</string>
|
||||
<string name="navigation_bar_compact_layout_summary">Use a compact layout in the navigation bar</string>
|
||||
<string name="system_navigation_summary">Choose which system navigation style to use</string>
|
||||
<string name="navbar_layout_category_title">Layout</string>
|
||||
|
||||
<!-- Volume rocker wake -->
|
||||
<string name="volume_rocker_wake_title">Volume rocker wake</string>
|
||||
<string name="volume_rocker_wake_summary">Pressing the volume keys will wake your device</string>
|
||||
<string name="volume_category">Volume rocker</string>
|
||||
|
||||
<!-- Volume Steps Fragment -->
|
||||
<string name="volume_steps_fragment_title">Volume steps</string>
|
||||
<string name="volume_steps_summary">Customize volume steps</string>
|
||||
<string name="volume_steps_alarm_title">Volume steps: Alarm</string>
|
||||
<string name="volume_steps_dtmf_title">Volume steps: DTMF</string>
|
||||
<string name="volume_steps_music_title">Volume steps: Media</string>
|
||||
<string name="volume_steps_notification_title">Volume steps: Notification</string>
|
||||
<string name="volume_steps_ring_title">Volume steps: Ringer</string>
|
||||
<string name="volume_steps_system_title">Volume steps: System</string>
|
||||
<string name="volume_steps_voice_call_title">Volume steps: Voice Call</string>
|
||||
<string name="volume_steps_reset">Reset</string>
|
||||
|
||||
<!-- Buttons - Enable navbar -->
|
||||
<string name="disable_navkeys_title">Enable on-screen nav bar</string>
|
||||
<string name="disable_navkeys_summary">Enable on-screen navigation bar and disable hardware buttons</string>
|
||||
|
||||
<!-- Buttons - Swap capacitive keys -->
|
||||
<string name="swap_capacitive_keys_title">Swap capacitive buttons</string>
|
||||
<string name="swap_capacitive_keys_summary">Swap the order of recents and back buttons</string>
|
||||
|
||||
<!-- HW keys -->
|
||||
<string name="hardware_keys_title">Buttons</string>
|
||||
<string name="hardware_keys_category">Hardware navigation buttons</string>
|
||||
<string name="hardware_keys_disable_title">Disable hardware buttons</string>
|
||||
<string name="hardware_keys_disable_summary">Use the device hardware keys for navigation</string>
|
||||
<string name="hardware_keys_volume_keys_title">Volume rocker</string>
|
||||
|
||||
<!-- Hardware button navigation -->
|
||||
<string name="action_value_default_action" translatable="false">default</string>
|
||||
<string name="action_value_select_app" translatable="false">app</string>
|
||||
<string name="action_value_custom_action" translatable="false">custom</string>
|
||||
<string name="action_value_back" translatable="false">task_back</string>
|
||||
<string name="action_value_home" translatable="false">task_home</string>
|
||||
<string name="action_value_search_assist" translatable="false">task_assist</string>
|
||||
<string name="action_value_recent_apps" translatable="false">task_recents</string>
|
||||
<string name="action_value_voice_search" translatable="false">task_voice_search</string>
|
||||
<string name="action_value_menu" translatable="false">task_menu</string>
|
||||
<string name="picker_activities">Activities</string>
|
||||
<string name="select_custom_app_title">Select custom app</string>
|
||||
<string name="select_custom_activity_title">Select custom activity</string>
|
||||
<string name="profile_applist_title">Applications</string>
|
||||
<string name="choose_action_title">Choose action</string>
|
||||
<string name="action_entry_default_action">Default settings</string>
|
||||
<string name="action_entry_select_app">Select application</string>
|
||||
<string name="action_entry_custom_action">Select custom action</string>
|
||||
<string name="hardware_keys_home_key_title">Home button</string>
|
||||
<string name="hardware_keys_back_key_title">Back button</string>
|
||||
<string name="hardware_keys_menu_key_title">Menu button</string>
|
||||
<string name="hardware_keys_assist_key_title">Search button</string>
|
||||
<string name="hardware_keys_appswitch_key_title">Recents button</string>
|
||||
<string name="hardware_keys_camera_key_title">Camera button</string>
|
||||
<string name="hardware_keys_short_press_title">Short press action</string>
|
||||
<string name="hardware_keys_double_tap_summary">Set double tap action</string>
|
||||
<string name="hardware_keys_single_tap_summary">Set single tap action</string>
|
||||
<string name="hardware_keys_long_press_summary">Set long press action</string>
|
||||
<string name="hardware_keys_single_tap_title">Single tap action</string>
|
||||
<string name="hardware_keys_long_press_title">Long press action</string>
|
||||
<string name="hardware_keys_double_tap_title">Double tap action</string>
|
||||
<string name="hardware_keys_action_nothing">No action</string>
|
||||
<string name="hardware_keys_action_menu">Open/close menu</string>
|
||||
<string name="hardware_keys_action_app_switch">Recent apps switcher</string>
|
||||
<string name="hardware_keys_action_search">Search assistant</string>
|
||||
<string name="hardware_keys_action_voice_search">Voice search</string>
|
||||
<string name="hardware_keys_action_in_app_search">In-app search</string>
|
||||
<string name="hardware_keys_action_launch_camera">Launch camera</string>
|
||||
<string name="hardware_keys_action_sleep">Turn screen off</string>
|
||||
<string name="hardware_keys_action_split_screen">Split screen</string>
|
||||
<string name="hardware_keys_action_close_app">Kill app</string>
|
||||
<string name="hardware_keys_action_torch">Flashlight</string>
|
||||
<string name="hardware_keys_action_screenshot">Screenshot</string>
|
||||
<string name="hardware_keys_action_volume_panel">Toggle volume panel</string>
|
||||
<string name="hardware_keys_action_clear_all_notifications">Clear all notifications</string>
|
||||
<string name="hardware_keys_action_notifications_panel">Toggle notifications panel</string>
|
||||
<string name="hardware_keys_action_toggle_qs_panel">Toggle QS panel</string>
|
||||
<string name="hardware_keys_action_ringer_modes">Ringer modes</string>
|
||||
<string name="hardware_keys_swipe_right_key_title">Swipe right</string>
|
||||
<string name="hardware_keys_swipe_left_key_title">Swipe left</string>
|
||||
<string name="hardware_keys_long_tap_key_title">Long tap</string>
|
||||
<string name="hardware_keys_swipe_tap_title">Swipe action</string>
|
||||
<string name="hardware_keys_long_tap_title">Long tap action</string>
|
||||
<string name="button_wake_title">Wake device</string>
|
||||
<string name="button_wake_summary">Wake device by pressing the button</string>
|
||||
<string name="camera_sleep_on_release_title">Screen peek</string>
|
||||
<string name="camera_sleep_on_release_summary">A half press will keep the screen on only while the button is held down</string>
|
||||
<string name="camera_launch_title">Launch camera</string>
|
||||
<string name="camera_launch_summary">A longpress and release will launch camera</string>
|
||||
<string name="cursor_section_header">Cursor</string>
|
||||
<string name="volume_key_cursor_control_title">Keyboard cursor control</string>
|
||||
<string name="volume_key_cursor_control_off">Disabled</string>
|
||||
<string name="volume_key_cursor_control_on">Volume Up/Down - Cursor Left/Right</string>
|
||||
<string name="volume_key_cursor_control_on_reverse">Volume Up/Down - Cursor Right/Left</string>
|
||||
<string name="swap_volume_buttons_title">Reorient</string>
|
||||
<string name="swap_volume_buttons_summary">Swap volume buttons when the screen is rotated</string>
|
||||
<string name="volume_panel_on_left_title">Show volume panel on left</string>
|
||||
<string name="volume_panel_on_left_summary">Display volume panel on the left side of the screen</string>
|
||||
|
||||
<!-- Alert Slider Notifications (OnePlus devices) -->
|
||||
<string name="alert_slider_notifications_title">Alert slider notifications</string>
|
||||
<string name="alert_slider_notifications_summary">Display notification when changing alert slider position</string>
|
||||
|
||||
<!-- Power Menu -->
|
||||
<string name="power_menu_title">Power menu</string>
|
||||
<string name="power_menu_title_summary">View or change power menu entries</string>
|
||||
<string name="powermenu_screenshot">Screenshot</string>
|
||||
<string name="powermenu_power">Power</string>
|
||||
<string name="powermenu_advanced">Advanced reboot options</string>
|
||||
<string name="powermenu_restart">Restart</string>
|
||||
<string name="powermenu_airplane">Airplane</string>
|
||||
<string name="powermenu_settings">Settings</string>
|
||||
<string name="powermenu_lockdown">Lock Down</string>
|
||||
<string name="powermenu_soundpanel">Sound Panel</string>
|
||||
<string name="powermenu_users">Users</string>
|
||||
<string name="powermenu_logout">Logout</string>
|
||||
<string name="powermenu_emergency">Emergency</string>
|
||||
|
||||
<!-- Unlock FPS for specific games -->
|
||||
<string name="use_games_spoof_title">Unlock higher FPS in games</string>
|
||||
<string name="use_games_spoof_summary">Spoof your device as a different model for specific games to unlock higher FPS</string>
|
||||
|
||||
<!-- Netflix Spooft -->
|
||||
<string name="netflix_spoof_title">Netflix spoof</string>
|
||||
<string name="netflix_spoof_summary">Spoof your device as different model for Netflix</string>
|
||||
|
||||
<!-- Unlimited google photos storage -->
|
||||
<string name="use_photos_spoof_title">Unlimited Photos storage</string>
|
||||
<string name="use_photos_spoof_summary">Spoof your device as Pixel XL for Google Photos app only to provide unlimited storage for backup</string>
|
||||
|
||||
<!-- Notification guts kill app button -->
|
||||
<string name="notification_guts_kill_app_button_title">Force stop button</string>
|
||||
<string name="notification_guts_kill_app_button_summary">Show force stop button in the notification\'s longpress menu</string>
|
||||
|
||||
<!-- Toast app icon -->
|
||||
<string name="toast_icon_title">Toast app icon</string>
|
||||
<string name="toast_icon_summary">Display the app\'s icon corresponding with the toast</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>
|
||||
|
||||
<!-- Status bar - Clock -->
|
||||
<string name="status_bar_clock_title">Clock & date</string>
|
||||
<string name="status_bar_clock_summary">Customize clock & date</string>
|
||||
<string name="status_bar_clock_seconds_title">Clock seconds</string>
|
||||
<string name="status_bar_clock_seconds_summary">Display seconds next to clock in status bar</string>
|
||||
<string name="status_bar_clock_position_title">Clock style</string>
|
||||
<string name="status_bar_clock_position_right">Right</string>
|
||||
<string name="status_bar_clock_position_left">Left</string>
|
||||
<string name="status_bar_clock_position_center">Center</string>
|
||||
<string name="status_bar_clock_position_hidden">Hidden</string>
|
||||
<string name="status_bar_clock_auto_hide_title">Auto hide</string>
|
||||
<string name="status_bar_clock_auto_hide_launcher_summary">Hide clock if launcher is visible</string>
|
||||
<string name="status_bar_clock_auto_hide_summary">Hide clock at regular interval</string>
|
||||
<string name="status_bar_clock_auto_hide_hdur_title">Hide duration</string>
|
||||
<string name="status_bar_clock_auto_hide_hdur_summary">Number of seconds to hide clock</string>
|
||||
<string name="status_bar_clock_auto_hide_sdur_title">Show duration</string>
|
||||
<string name="status_bar_clock_auto_hide_sdur_summary">Number of seconds to wait before hiding clock</string>
|
||||
<string name="status_bar_am_pm_title">AM/PM style</string>
|
||||
<string name="status_bar_am_pm_info">24-hour clock is enabled</string>
|
||||
<string name="status_bar_am_pm_normal">Normal</string>
|
||||
<string name="status_bar_am_pm_small">Small</string>
|
||||
<string name="status_bar_am_pm_hidden">Hidden</string>
|
||||
<string name="status_bar_date_title">Date</string>
|
||||
<string name="status_bar_date_none">Hidden</string>
|
||||
<string name="status_bar_date_small">Small</string>
|
||||
<string name="status_bar_date_normal">Normal</string>
|
||||
<string name="status_bar_date_format_title">Date format</string>
|
||||
<string name="status_bar_date_style">Date style</string>
|
||||
<string name="status_bar_date_style_normal">Normal</string>
|
||||
<string name="status_bar_date_style_lowercase">Lowercase</string>
|
||||
<string name="status_bar_date_style_uppercase">Uppercase</string>
|
||||
<string name="status_bar_date_format_custom">Custom java format</string>
|
||||
<string name="status_bar_date_string_edittext_title">Must be in DateFormat eg. MM/dd/yy</string>
|
||||
<string name="status_bar_date_string_edittext_summary">Enter string</string>
|
||||
<string name="clock_date_position">Date position</string>
|
||||
<string name="clock_date_right">Right of time</string>
|
||||
<string name="clock_date_left">Left of time</string>
|
||||
<string name="clock_font_size_title">Clock font size</string>
|
||||
|
||||
<!-- QS clock -->
|
||||
<string name="qs_clock_title">Clock</string>
|
||||
<string name="qs_clock_summary">Display clock in quick status bar header</string>
|
||||
|
||||
<!-- QS date -->
|
||||
<string name="qs_date_title">Date</string>
|
||||
<string name="qs_date_summary">Display date in quick status bar header</string>
|
||||
|
||||
<!-- Footer -->
|
||||
<string name="qs_footer_category">QS Footer</string>
|
||||
<string name="qs_footer_datausage_title">Data usage</string>
|
||||
<string name="qs_footer_datausage_summary">Display data usage summary in quick settings footer</string>
|
||||
|
||||
<!-- Edge light -->
|
||||
<string name="edge_light_title">Edge light</string>
|
||||
<string name="enable_edge_light">Enable Edge Light</string>
|
||||
<string name="edge_light_intro_text">Display an animation along the edges of the screen when pulsing</string>
|
||||
<string name="edge_light_always_trigger_on_pulse_title">Always trigger on pulse</string>
|
||||
<string name="edge_light_always_trigger_on_pulse_summary">Whether to show edge light whenever ambient display is shown and not just for notifications</string>
|
||||
<string name="edge_light_repeat_animation_title">Repeat animation</string>
|
||||
<string name="edge_light_repeat_animation_summary_on">Repeat until timeout</string>
|
||||
<string name="edge_light_repeat_animation_summary_off">Show only once</string>
|
||||
<string name="edge_light_color_mode_title">Edge light color mode</string>
|
||||
<string name="accent_color">Accent color (Default)</string>
|
||||
<string name="notification_color">Notification color</string>
|
||||
<string name="wallpaper_color">Wallpaper color</string>
|
||||
<string name="custom_color">Custom color</string>
|
||||
<string name="edge_light_custom_color_title">Custom color</string>
|
||||
|
||||
<!-- Custom settings dashboard style -->
|
||||
<string name="settings_dashboard_style_title">Settings layout</string>
|
||||
<string name="settings_dashboard_style_aosp">Aosp</string>
|
||||
<string name="settings_dashboard_style_oos11">OxygenOS 11</string>
|
||||
<string name="settings_dashboard_style_oos12">OxygenOS 12</string>
|
||||
<string name="settings_dashboard_style_cherish">Cherish</string>
|
||||
<string name="settings_dashboard_style_cherish_clean">Cherish Clean</string>
|
||||
<string name="settings_layout_category_title">Settings UI interface</string>
|
||||
<string name="settings_base_style_title">Settings Base layout</string>
|
||||
<string name="settings_base_style_summary">Use an alternative layout for setting menus</string>
|
||||
<string name="settings_home_style_title">Settings Home layout</string>
|
||||
<string name="settings_home_style_summary">Use stock aosp layout for homepage</string>
|
||||
<string name="disable_usercard_title">Settings UserCard</string>
|
||||
<string name="disable_usercard_summary">Toggle in order not to show the usercard on main settings page</string>
|
||||
|
||||
<!-- Lockscreen Clocks -->
|
||||
<string name="lock_screen_custom_clock_face_category">Lockscreen Clock</string>
|
||||
<string name="lock_screen_custom_clock_face_title">Lockscreen clock style</string>
|
||||
<string name="lock_screen_custom_clock_face_default">Default</string>
|
||||
<string name="lock_screen_custom_clock_face_sfunny">Sfuny</string>
|
||||
<string name="lock_screen_custom_clock_face_oos">OOS</string>
|
||||
<string name="lock_screen_custom_clock_face_clockertino">Clockertino</string>
|
||||
<string name="lock_screen_custom_clock_face_spark">Spark</string>
|
||||
<string name="lock_screen_custom_clock_face_spark_circle">Spark Circle</string>
|
||||
|
||||
<!-- UDFPS Haptic Feedback -->
|
||||
<string name="udfps_haptic_feedback_title">UDFPS haptic feedback</string>
|
||||
<string name="udfps_haptic_feedback_summary">Vibrate when touching UDFPS icon</string>
|
||||
|
||||
<!-- Udfps authentication / error vibration -->
|
||||
<string name="udfps_success_vib_title">Udfps authentication vibration</string>
|
||||
<string name="udfps_success_vib_summary">Vibrate on successful fingerprint authentication</string>
|
||||
<string name="udfps_error_vib_title">Udfps error vibration</string>
|
||||
<string name="udfps_error_vib_summary">Vibrate on unsuccessful fingerprint authentication</string>
|
||||
|
||||
<!-- UDFPS Recog Animation -->
|
||||
<string name="udfps_customization">UDFPS customization</string>
|
||||
<string name="udfps_recog_animation">UDFPS animation</string>
|
||||
<string name="udfps_recog_animation_summary">Shows an animation while reading your finger</string>
|
||||
<string name="udfps_recog_animation_effect_title">UDFPS custom animation</string>
|
||||
<string name="udfps_recog_animation_effect_summary">Choose animation effect</string>
|
||||
<string name="udfps_settings_title">UDFPS settings</string>
|
||||
<string name="udfps_settings_summary">Settings for customizing the UDFPS</string>
|
||||
|
||||
<!-- UDFPS icon picker -->
|
||||
<string name="udfps_icon_picker_title">UDFPS icon picker</string>
|
||||
<string name="udfps_icon_picker_summary">Choose your favorite fingerprint icon</string>
|
||||
|
||||
<!-- Custom FOD Icon -->
|
||||
<string name="custom_fp_icon_title">Custom UDFPS Icon</string>
|
||||
<string name="custom_fp_icon_summary">Enable custom UDFPS Icon from files</string>
|
||||
<string name="custom_fp_select_title">Select Custom UDFPS Icon</string>
|
||||
<string name="custom_fp_select_summary">Select custom image from your saved files or gallery</string>
|
||||
|
||||
<!-- UDFPS pressed color -->
|
||||
<string name="udfps_pressed_color_title">Udfps pressed color</string>
|
||||
<string name="udfps_pressed_color_summary">Choose your favorite udfps pressed color</string>
|
||||
|
||||
<!-- Fingerprint Ripple Effect -->
|
||||
<string name="enable_fingerprint_ripple_effect_title">Ripple effect</string>
|
||||
<string name="enable_fingerprint_ripple_effect_summary">Show ripple effect on unlock with fingerprint</string>
|
||||
|
||||
<!-- reTicker -->
|
||||
<string name="reticker_category" translatable="false">reTicker</string>
|
||||
<string name="reticker_title">reTicker</string>
|
||||
<string name="reticker_summary">Replace heads-up notification with slim and less invasive version of redesigned ticker</string>
|
||||
<string name="new_reticker_title">Alternative reTicker</string>
|
||||
<string name="new_reticker_summary">Use an alternative layout for reticker that is inspired from ios</string>
|
||||
<string name="new_reticker_animation_title">Alternative reTicker animation</string>
|
||||
<string name="new_reticker_animation_summary">Use a different animation for reticker (enabled by default on alternative reTicker)</string>
|
||||
<string name="reticker_colored_title">Use app colored background</string>
|
||||
<string name="reticker_colored_summary">Replace reTicker background color using notification app main color</string>
|
||||
|
||||
<!-- VoWiFi icon -->
|
||||
<string name="vowifi_icon_title">VoWiFi icon</string>
|
||||
<string name="vowifi_icon_enabled">VoWiFi icon enabled</string>
|
||||
<string name="vowifi_icon_disabled">VoWiFi icon disabled</string>
|
||||
<string name="vowifi_icon_enabled_volte_disabled">VoWiFi instead of VoLTE icon</string>
|
||||
<string name="vowifi_icon_style_title">VoWiFi icon style</string>
|
||||
<string name="vowifi_icon_default">Default Icon</string>
|
||||
<string name="vowifi_icon_emui">EMUI Icon</string>
|
||||
<string name="vowifi_icon_asus">Asus Icon</string>
|
||||
<string name="vowifi_icon_oneplus">OOS Icon</string>
|
||||
<string name="vowifi_icon_moto">Motorola Icon</string>
|
||||
<string name="vowifi_icon_simple1">Simple1 Icon</string>
|
||||
<string name="vowifi_icon_simple2">Simple2 Icon</string>
|
||||
<string name="vowifi_icon_simple3">Simple3 Icon</string>
|
||||
<string name="vowifi_icon_vivo">Vivo Icon</string>
|
||||
<string name="vowifi_icon_margaritov">Margaritov Icon</string>
|
||||
|
||||
<!-- Privacy Indicator -->
|
||||
<string name="mic_camera_privacy_indicator_title">Mic and camera privacy indicator</string>
|
||||
<string name="mic_camera_privacy_indicator_summary">Show indicator when any app uses mic or camera</string>
|
||||
<string name="location_privacy_indicator_title">Location privacy indicator</string>
|
||||
<string name="location_privacy_indicator_summary">Show indicator when any app uses location</string>
|
||||
<string name="projection_privacy_indicator_title">Media projection privacy indicator</string>
|
||||
<string name="projection_privacy_indicator_summary">Show indicator when device screen is projected</string>
|
||||
|
||||
<!-- Notification count -->
|
||||
<string name="statusbar_notif_count_title">Show notification count</string>
|
||||
<string name="statusbar_notif_count_summary">Display the number of pending notifications</string>
|
||||
|
||||
<!-- Statusbar colored icons -->
|
||||
<string name="statusbar_colored_icons_title">Colored icons</string>
|
||||
<string name="statusbar_colored_icons_summary">Use proper app icons for notification icons in statusbar</string>
|
||||
|
||||
<!-- Bluetooth status -->
|
||||
<string name="bluetooth_battery_title">Bluetooth battery status</string>
|
||||
<string name="bluetooth_battery_summary">Display battery status for the connected bluetooth device, if available</string>
|
||||
|
||||
<!-- Torch Power button gestures -->
|
||||
<string name="torch_power_button_gesture_title">Toggle torch when screen off</string>
|
||||
<string name="torch_power_button_gesture_none">Disabled</string>
|
||||
<string name="torch_power_button_gesture_dt">Double tap power button (slower single tap response), Disables double power tap for camera.</string>
|
||||
<string name="torch_power_button_gesture_dt_toast">Jump to camera gesture is now disabled</string>
|
||||
<string name="torch_power_button_gesture_lp">Long press power button</string>
|
||||
|
||||
<!-- App lock -->
|
||||
<string name="app_lock_title">App lock</string>
|
||||
<string name="app_lock_summary">Apps will require fingerprint authentication to launch</string>
|
||||
<string name="app_lock_authentication_dialog_title">Unlock</string>
|
||||
<string name="enable_debugging">Enable debugging</string>
|
||||
<string name="disable_debugging">Disable debugging</string>
|
||||
<string name="app_lock_packages_title">Protected apps</string>
|
||||
<string name="app_lock_packages_summary">Select the apps to protect with biometrics or device credentials</string>
|
||||
<string name="app_lock_timeout_title">Auto lock timeout</string>
|
||||
<string name="app_lock_timeout_summary">Duration of time after which an unlocked app in background should be locked</string>
|
||||
<string name="app_lock_notifications_title">Redact notifications</string>
|
||||
<string name="app_lock_notifications_summary">
|
||||
Notification content will be hidden and collapsed for selected apps when they are locked.
|
||||
Heads up notifications will be automatically disabled.
|
||||
</string>
|
||||
<string name="app_lock_notifications_disabled_summary">Protect an application first</string>
|
||||
<string name="app_lock_biometrics_allowed_title">Enable biometrics for unlocking</string>
|
||||
<string name="app_lock_footer_text">Bubbles will be automatically dismissed after timeout</string>
|
||||
<string name="enable_protection">Enable protection</string>
|
||||
|
||||
<!-- Power menu Animations -->
|
||||
<string name="power_menu_animation_title">Power menu animation</string>
|
||||
<string name="power_menu_animation_dialog_title">Select power menu animation</string>
|
||||
<string name="power_menu_animation_aosp">AOSP (default)</string>
|
||||
<string name="power_menu_animation_bottom">Bottom</string>
|
||||
<string name="power_menu_animation_top">Top</string>
|
||||
<string name="power_menu_animation_xylon">Fly</string>
|
||||
<string name="power_menu_animation_slide">Slide</string>
|
||||
<string name="power_menu_animation_turn">Turn</string>
|
||||
<string name="power_menu_animation_fly">Glow</string>
|
||||
<string name="power_menu_animation_card">3D</string>
|
||||
<string name="power_menu_animation_translucent_top">Translucent (top)</string>
|
||||
<string name="power_menu_animation_translucent_bottom">Translucent (bottom)</string>
|
||||
<string name="power_menu_animation_rotate">Rotate</string>
|
||||
|
||||
<!-- QS tiles animations category -->
|
||||
<string name="qs_tile_animation_category_title">QS Tiles</string>
|
||||
|
||||
<!-- Tiles animation style -->
|
||||
<string name="qs_tile_animation_style_title">Animation style</string>
|
||||
<string name="qs_tile_animation_duration_title">Animation duration</string>
|
||||
<string name="qs_tile_animation_interpolator_title">Tiles animation interpolator</string>
|
||||
<string name="qs_tile_animation_style_off">No animation</string>
|
||||
<string name="qs_tile_animation_style_flip">Flip</string>
|
||||
<string name="qs_tile_animation_style_rotate">Rotate</string>
|
||||
<string name="qs_tile_animation_duration_low">Low</string>
|
||||
<string name="qs_tile_animation_duration_default">Default</string>
|
||||
<string name="qs_tile_animation_duration_fast">Fast</string>
|
||||
<string name="qs_tile_animation_duration_quite_fast">Quite fast</string>
|
||||
<string name="qs_tile_animation_duration_super_fast">Super fast</string>
|
||||
<string name="qs_tile_animation_interpolator_linearInterpolator">Linear</string>
|
||||
<string name="qs_tile_animation_interpolator_accelerateInterpolator">Accelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_decelerateInterpolator">Decelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_accelerateDecelerateInterpolator">Accelerate decelerate</string>
|
||||
<string name="qs_tile_animation_interpolator_bounceInterpolator">Bounce</string>
|
||||
<string name="qs_tile_animation_interpolator_overshootInterpolator">Overshoot</string>
|
||||
<string name="qs_tile_animation_interpolator_anticipateInterpolator">Anticipate</string>
|
||||
<string name="qs_tile_animation_interpolator_anticipateOvershootInterpolator">Anticipate overshoot</string>
|
||||
<string name="qs_set_animation_style">%1$s</string>
|
||||
<string name="qs_set_animation_duration">%1$s</string>
|
||||
<string name="qs_set_animation_interpolator">%1$s</string>
|
||||
|
||||
<!-- Power menu and dialogs opacity -->
|
||||
<string name="power_menu_transparency">Power/reboot menu opacity</string>
|
||||
<string name="power_menu_dialog_dim">Power/reboot dialog dim background amount</string>
|
||||
|
||||
<!-- Black theme -->
|
||||
<string name="custom_theme_title">Use Custom theme</string>
|
||||
<string name="custom_theme_summary">Force custom background colors</string>
|
||||
<string name="custom_theme_default">Default</string>
|
||||
<string name="custom_theme_black">Black</string>
|
||||
<string name="custom_theme_clear">Clear</string>
|
||||
<string name="custom_theme_vivid">Vivid(Monet)</string>
|
||||
|
||||
<!-- Pulse music visualizer -->
|
||||
<string name="pulse_help_policy_notice_title">About Pulse</string>
|
||||
<string name="pulse_help_policy_notice_summary">Pulse is a brilliant audio graphic equalizer when music plays on the device</string>
|
||||
<string name="pulse_settings">Pulse</string>
|
||||
<string name="pulse_settings_summary">Audio graphic equalizer for navigation bar and lockscreen</string>
|
||||
<string name="show_navbar_pulse_title">Navbar Pulse</string>
|
||||
<string name="show_navbar_pulse_summary">Audio graphic equalizer on the navigation bar</string>
|
||||
<string name="show_lockscreen_pulse_title">Lockscreen Pulse</string>
|
||||
<string name="show_lockscreen_pulse_summary">Audio graphic equalizer on the lockscreen</string>
|
||||
<string name="show_ambient_pulse_title">Ambient Pulse</string>
|
||||
<string name="show_ambient_pulse_summary">Audio graphic equalizer on the ambient screen</string>
|
||||
<string name="pulse_render_mode_title">Render mode</string>
|
||||
<string name="pulse_render_mode_fading_bars">Fading blocks</string>
|
||||
<string name="pulse_render_mode_solid_lines">Solid lines</string>
|
||||
<string name="pulse_legacy_mode_advanced_category">Fading blocks mode settings</string>
|
||||
<string name="pulse_custom_fudge_factor">Sanity level</string>
|
||||
<string name="pulse_lavalamp_speed_title">Lava lamp speed</string>
|
||||
<string name="pulse_solid_units_count">Solid lines count</string>
|
||||
<string name="pulse_solid_units_opacity">Solid lines opacity</string>
|
||||
<string name="pulse_solid_units_rounded_title">Rounded corners</string>
|
||||
<string name="pulse_solid_units_rounded_summary">Solid lines with rounded tip</string>
|
||||
<string name="pulse_solid_dimen_category">Solid lines mode settings</string>
|
||||
<string name="pulse_color_mode_title">Color</string>
|
||||
<string name="pulse_color_accent">Accent</string>
|
||||
<string name="pulse_color_custom">Custom</string>
|
||||
<string name="pulse_color_lava_lamp">Lava lamp</string>
|
||||
<string name="pulse_color_user_title">Choose color</string>
|
||||
<string name="pulse_smoothing_enabled_title">Turn on smoothing</string>
|
||||
<string name="pulse_smoothing_enabled_summary">Each bar is animated more smoothly</string>
|
||||
<string name="pulse_custom_dimen">Bar width</string>
|
||||
<string name="pulse_custom_div">Bar spacing</string>
|
||||
<string name="pulse_filled_block_size">Block size</string>
|
||||
<string name="pulse_empty_block_size">Block spacing</string>
|
||||
|
||||
<!-- Pulse Gravity n Mirror Options -->
|
||||
<string name="pulse_custom_gravity_title">Gravity</string>
|
||||
<string name="pulse_custom_gravity_bottom">Bottom</string>
|
||||
<string name="pulse_custom_gravity_top">Top</string>
|
||||
<string name="pulse_custom_gravity_center">Center</string>
|
||||
<string name="visualizer_center_mirrored_title">Center mirrored</string>
|
||||
<string name="visualizer_center_mirrored_summary">Set the visualizer in center mirrored mode</string>
|
||||
<string name="pulse_vertical_mirror_title">Vertical Mirror</string>
|
||||
<string name="pulse_vertical_mirror_summary">Create other pulse and flip vertically</string>
|
||||
|
||||
<!-- Smart charging -->
|
||||
<string name="smart_charging_title">Smart Charging</string>
|
||||
<string name="smart_charging_summary">Set maximum charging level</string>
|
||||
<string name="smart_charging_switch_title">Enable Smart Charging</string>
|
||||
<string name="smart_charging_level_title">Stop trigger level</string>
|
||||
<string name="smart_charging_resume_level_title">Start trigger level</string>
|
||||
<string name="smart_charging_reset_stats_title">Reset battery statistics</string>
|
||||
<string name="smart_charging_reset_stats_summary">Reset battery statistics after reaching user defined charging level</string>
|
||||
<string name="smart_charging_footer">Smart Charging allows you to set maximum charging level to extend the lifespan of your battery. When enabled, battery stops charging at Stop trigger level and resumes charging at Start trigger level. Stop trigger level should be always greater than Start trigger level.</string>
|
||||
|
||||
<!-- Quick settings styling -->
|
||||
<string name="qs_styling">Quick Settings UI</string>
|
||||
<string name="qs_styles_title">QS Panel Styles</string>
|
||||
<string name="qs_outline">QS Outline Style</string>
|
||||
<string name="qs_two_tone">QS Two-Tone Accent</string>
|
||||
<string name="qs_color_pop">QS Color Pop</string>
|
||||
|
||||
<!-- QS tiles layout direction: vertical or horizontal -->
|
||||
<string name="qs_tile_layout_category_title">Tile layout</string>
|
||||
<string name="qs_tile_layout_title">Title Alignment</string>
|
||||
<string name="qs_tile_layout_summary">Enable for centered layout.</string>
|
||||
|
||||
<!-- QS tiles title visibility -->
|
||||
<string name="qs_tile_title_visibility_title">Hide tile titles</string>
|
||||
<string name="qs_tile_title_visibility_summary">Toggle to hide tile titles</string>
|
||||
|
||||
<!-- QS tiles layout -->
|
||||
<string name="qs_layout_category_title">Tiles layout</string>
|
||||
<string name="qs_tile_label_hide_title">Hide label</string>
|
||||
<string name="qs_tile_label_hide_summary">Only show icon in tile</string>
|
||||
<string name="qs_tile_label_size_title">Label text size</string>
|
||||
<string name="qs_columns_portrait_title">Columns (portrait)</string>
|
||||
<string name="qs_columns_landscape_title">Columns (landscape)</string>
|
||||
|
||||
<!-- Squiggle animation -->
|
||||
<string name="show_squiggle_animation_title">Show squiggle animation</string>
|
||||
<string name="show_squiggle_animation_summary">Show media panel squiggle animation, after change need to switch music, pause music or move the progress bar to apply</string>
|
||||
|
||||
<!-- Lockscreen interface -->
|
||||
<string name="lockscreen_interface_title">Lockscreen User Interface</string>
|
||||
<string name="lockscreen_clock_color_title">Custom lockscreen clock color</string>
|
||||
<string name="lockscreen_clock_color_summary">Use custom color instead of wallpaper accent</string>
|
||||
<string name="kg_custom_clock_color_title">Choose lockscreen clock color</string>
|
||||
<string name="kg_custom_clock_font_title">Custom lockscreen clock font</string>
|
||||
<string name="kg_custom_date_font_title">Custom lockscreen date font</string>
|
||||
<string name="small_clock_doubleline_title">Double-line Lockscreen clock format</string>
|
||||
<string name="small_clock_doubleline_summary">Use double-line clock instead of single line style for lockscreen clock</string>
|
||||
|
||||
<!-- QS Weather Options -->
|
||||
<string name="qs_weather_title">QS System weather style</string>
|
||||
<string name="qs_weather_summary">Configure system weather</string>
|
||||
<string name="qsweather_dialog_title">QuickSettings weather location</string>
|
||||
<string name="qs_weather_hidden">Hide weather</string>
|
||||
<string name="qs_temperature_image_show_scale">Show temp with scale and image</string>
|
||||
<string name="qs_temperature_image_hide_scale">Show temp with image without scale</string>
|
||||
<string name="qs_temperature_show_scale_hide_image">Show temp with scale</string>
|
||||
<string name="qs_temperature_hide_scale_hide_image">Show temp without scale</string>
|
||||
<string name="qs_show_image">Show image</string>
|
||||
<string name="weather_show_all_condition">Show temp with scale,image and weather condition</string>
|
||||
<string name="qsweather_position_qqs">QuickSettings</string>
|
||||
<string name="qsweather_position_qsb">QuickStatusbar</string>
|
||||
<string name="qsweather_position_both">Both</string>
|
||||
|
||||
<!-- Launcher Weather Options -->
|
||||
<string name="launcher_weather_title">Launcher System weather style</string>
|
||||
|
||||
<!-- Launcher Weather Options -->
|
||||
<string name="kg_weather_title">Lockscreen System weather style</string>
|
||||
|
||||
<!-- Omni weather -->
|
||||
<string name="qs_weather_settings_title">Weather Settings</string>
|
||||
<string name="qs_weather_settings_summary">Setup icon pack and weather service</string>
|
||||
<string name="weather_title">Weather Settings</string>
|
||||
<string name="weather_config_title">Weather service</string>
|
||||
<string name="weather_config_summary">System service settings</string>
|
||||
<string name="weather_icon_pack_title">Condition icon pack</string>
|
||||
<string name="weather_icon_pack_note">Note\u003a you can install new icon packs from play store by searching for \"Chronus icons\"</string>
|
||||
<string name="weather_icon_pack_info_title">Tips\u003a \n\n1. Users can install new icon packs from play store by searching for \"Chronus icons\".\n\n2. Condition icon pack is used for weather icons on quick settings and sushi launcher at a glance.\n\n3. Long press the QuickSettings weather view/logo/temperature to access weather settings with ease.</string>
|
||||
<string name="qsweather_settings_title">QuickSettings Weather</string>
|
||||
<string name="qsweather_settings_summary">Setup quicksettings weather views</string>
|
||||
|
||||
<!-- QS footer warnings -->
|
||||
<string name="qs_footer_warnings_title">Footer alerts</string>
|
||||
<string name="qs_footer_warnings_summary">Display an alert at bottom of QS panel when network is monitored by external apps or VPN</string>
|
||||
|
||||
<!-- QS footer icons -->
|
||||
<string name="qs_footer_users_icon_title">User account icon</string>
|
||||
<string name="qs_footer_users_icon_summary">Display multiuser accessibility icon when available</string>
|
||||
<string name="qs_footer_edit_icon_title">Edit tiles icon</string>
|
||||
<string name="qs_footer_show_power_menu_title">Power menu shortcut</string>
|
||||
<string name="qs_footer_services_icon_title">Running services shortcut</string>
|
||||
<string name="qs_footer_settings_icon_title">Settings shortcut</string>
|
||||
</resources>
|
||||
|
||||
24
res/values/plurals.xml
Normal file
24
res/values/plurals.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 FlamingoOS 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.
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
|
||||
<!-- App Lock -->
|
||||
<plurals name="app_lock_summary">
|
||||
<item quantity="one"><xliff:g example="1" id="Number of applications">%1$d</xliff:g> application is protected</item>
|
||||
<item quantity="other"><xliff:g example="10" id="Number of applications">%1$d</xliff:g> applications are protected</item>
|
||||
</plurals>
|
||||
|
||||
</resources>
|
||||
34
res/xml/always_on_display_schedule.xml
Normal file
34
res/xml/always_on_display_schedule.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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>
|
||||
39
res/xml/app_lock_package_config_settings.xml
Normal file
39
res/xml/app_lock_package_config_settings.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 CherishOS 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"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/app_lock_title">
|
||||
|
||||
<Preference
|
||||
android:key="app_lock_packages"
|
||||
android:title="@string/app_lock_packages_title"
|
||||
android:summary="@string/app_lock_packages_summary"
|
||||
android:fragment="com.cherish.settings.security.applock.AppLockPackageListFragment" />
|
||||
|
||||
<ListPreference
|
||||
android:key="app_lock_timeout"
|
||||
android:title="@string/app_lock_timeout_title"
|
||||
android:summary="@string/app_lock_timeout_summary"
|
||||
android:entries="@array/app_lock_timeout_entries"
|
||||
android:entryValues="@array/app_lock_timeout_values"
|
||||
android:defaultValue="0"
|
||||
android:persistent="false"
|
||||
settings:controller="com.cherish.settings.security.applock.AppLockTimeoutPreferenceController" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="app_lock_biometrics_allowed"
|
||||
android:title="@string/app_lock_biometrics_allowed_title"
|
||||
android:persistent="false"
|
||||
settings:controller="com.cherish.settings.security.applock.AppLockBiometricPreferenceController" />
|
||||
|
||||
</PreferenceScreen>
|
||||
19
res/xml/app_lock_package_list_settings.xml
Normal file
19
res/xml/app_lock_package_list_settings.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 FlamingoOS 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"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/app_lock_packages_title">
|
||||
</PreferenceScreen>
|
||||
@@ -19,5 +19,43 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/animations_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" >
|
||||
|
||||
<ListPreference
|
||||
android:key="power_menu_animations"
|
||||
android:title="@string/power_menu_animation_title"
|
||||
android:dialogTitle="@string/power_menu_animation_dialog_title"
|
||||
android:entries="@array/power_menu_animations_entries"
|
||||
android:entryValues="@array/power_menu_animations_values"
|
||||
android:summary="%s"
|
||||
android:persistent="false" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/qs_tile_animation_category_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingIntListPreference
|
||||
android:key="anim_tile_style"
|
||||
android:title="@string/qs_tile_animation_style_title"
|
||||
android:entries="@array/qs_tile_animation_style_entries"
|
||||
android:entryValues="@array/qs_tile_animation_style_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingIntListPreference
|
||||
android:key="anim_tile_duration"
|
||||
android:title="@string/qs_tile_animation_duration_title"
|
||||
android:entries="@array/qs_tile_animation_duration_entries"
|
||||
android:entryValues="@array/qs_tile_animation_duration_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="2000" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingIntListPreference
|
||||
android:key="anim_tile_interpolator"
|
||||
android:title="@string/qs_tile_animation_interpolator_title"
|
||||
android:entries="@array/qs_tile_animation_interpolator_entries"
|
||||
android:entryValues="@array/qs_tile_animation_interpolator_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
38
res/xml/cherish_settings_app_lock.xml
Normal file
38
res/xml/cherish_settings_app_lock.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 FlamingoOS 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"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/app_lock_title">
|
||||
|
||||
<Preference
|
||||
android:key="app_lock_packages"
|
||||
android:title="@string/app_lock_packages_title"
|
||||
android:summary="@string/app_lock_packages_summary"
|
||||
android:fragment="com.cherish.settings.security.applock.AppLockPackageListFragment" />
|
||||
|
||||
<ListPreference
|
||||
android:key="app_lock_timeout"
|
||||
android:title="@string/app_lock_timeout_title"
|
||||
android:summary="@string/app_lock_timeout_summary"
|
||||
android:entries="@array/app_lock_timeout_entries"
|
||||
android:entryValues="@array/app_lock_timeout_values"
|
||||
android:defaultValue="0"
|
||||
android:persistent="false"
|
||||
settings:controller="com.cherish.settings.security.applock.AppLockTimeoutPreferenceController" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="app_lock_biometrics_allowed"
|
||||
android:title="@string/app_lock_biometrics_allowed_title"
|
||||
android:persistent="false" />
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -18,11 +18,247 @@
|
||||
android:title="@string/button_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
<SwitchPreference
|
||||
android:key="navbar_visibility"
|
||||
android:title="@string/navigation_bar_title"
|
||||
android:summary="@string/navigation_bar_summary" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="navbar_layout_category"
|
||||
android:title="@string/navbar_layout_category_title"
|
||||
android:dependency="navbar_visibility">
|
||||
|
||||
<Preference
|
||||
android:key="gesture_system_navigation_input_summary"
|
||||
android:title="@string/system_navigation_title"
|
||||
android:fragment="com.android.settings.gestures.SystemNavigationGestureSettings"
|
||||
settings:controller="com.android.settings.gestures.SystemNavigationPreferenceController"
|
||||
settings:keywords="@string/keywords_system_navigation" />
|
||||
|
||||
<!-- com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="navigation_bar_menu_arrow_keys"
|
||||
android:title="@string/navigation_bar_arrow_keys_title"
|
||||
android:summary="@string/navigation_bar_arrow_keys_summary"
|
||||
android:defaultValue="false" />-->
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="navigation_bar_compact_layout"
|
||||
android:title="@string/navigation_bar_compact_layout_title"
|
||||
android:summary="@string/navigation_bar_compact_layout_summary"
|
||||
android:defaultValue="false" />-->
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="navigation_bar_inverse"
|
||||
android:title="@string/navigation_bar_inverse_title"
|
||||
android:defaultValue="0"
|
||||
settings:controller="com.cherish.settings.fragments.NavBarInversePreferenceController" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="volume_category"
|
||||
android:title="@string/volume_category">
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="volume_panel_on_left"
|
||||
android:title="@string/volume_panel_on_left_title"
|
||||
android:summary="@string/volume_panel_on_left_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<Preference
|
||||
android:key="vol_steps"
|
||||
android:title="@string/volume_steps_fragment_title"
|
||||
android:summary="@string/volume_steps_summary"
|
||||
android:fragment="com.cherish.settings.fragments.VolumeRockerSettings" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="volume_rocker_wake"
|
||||
android:summary="@string/volume_rocker_wake_summary"
|
||||
android:title="@string/volume_rocker_wake_title"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="volume_key_cursor_control"
|
||||
android:summary="%s"
|
||||
android:title="@string/volume_key_cursor_control_title"
|
||||
android:dialogTitle="@string/volume_key_cursor_control_title"
|
||||
android:entries="@array/volume_key_cursor_control_entries"
|
||||
android:entryValues="@array/volume_key_cursor_control_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="hardware_keys"
|
||||
android:title="@string/hardware_keys_category">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="hardware_keys_disable"
|
||||
android:title="@string/hardware_keys_disable_title" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="swap_capacitive_keys"
|
||||
android:title="@string/swap_capacitive_keys_title"
|
||||
android:summary="@string/swap_capacitive_keys_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- PreferenceCategory
|
||||
android:key="button_backlight_options_category"
|
||||
android:title="@string/button_backlight_options_category">
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="button_backlight_enable"
|
||||
android:title="@string/button_backlight_enable_title"
|
||||
android:defaultValue="true" />
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="custom_button_use_screen_brightness"
|
||||
android:title="@string/button_link_brightness"
|
||||
android:summary="@string/button_link_brightness_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="button_backlight_enable"
|
||||
android:disableDependentsState="true" />
|
||||
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||
android:key="button_manual_brightness_new"
|
||||
android:title="@string/button_manual_brightness"
|
||||
android:max="255"
|
||||
settings:min="1"
|
||||
android:persistent="false"
|
||||
android:dependency="custom_button_use_screen_brightness" />
|
||||
<com.cherish.settings.preferences.CustomSeekBarPreference
|
||||
android:key="button_timeout"
|
||||
android:title="@string/button_timeout_title"
|
||||
android:max="30"
|
||||
settings:min="0"
|
||||
android:persistent="false"
|
||||
android:dependency="button_backlight_enable" />
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="button_backlight_on_touch_only"
|
||||
android:title="@string/button_backlight_on_touch_only_title"
|
||||
android:summary="@string/button_backlight_on_touch_only_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="button_backlight_enable" />
|
||||
</PreferenceCategory>-->
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="back_key"
|
||||
android:title="@string/hardware_keys_back_key_title">
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_back_single_tap"
|
||||
android:summary="@string/hardware_keys_single_tap_summary"
|
||||
android:title="@string/hardware_keys_single_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_back_long_press"
|
||||
android:summary="@string/hardware_keys_long_press_summary"
|
||||
android:title="@string/hardware_keys_long_press_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_back_double_tap"
|
||||
android:summary="@string/hardware_keys_double_tap_summary"
|
||||
android:title="@string/hardware_keys_double_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="home_key"
|
||||
android:title="@string/hardware_keys_home_key_title">
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_home_single_tap"
|
||||
android:summary="@string/hardware_keys_single_tap_summary"
|
||||
android:title="@string/hardware_keys_single_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_home_long_press"
|
||||
android:summary="@string/hardware_keys_long_press_summary"
|
||||
android:title="@string/hardware_keys_long_press_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_home_double_tap"
|
||||
android:summary="@string/hardware_keys_double_tap_summary"
|
||||
android:title="@string/hardware_keys_double_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="app_switch_key"
|
||||
android:title="@string/hardware_keys_appswitch_key_title">
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_overview_single_tap"
|
||||
android:summary="@string/hardware_keys_single_tap_summary"
|
||||
android:title="@string/hardware_keys_single_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_overview_long_press"
|
||||
android:summary="@string/hardware_keys_long_press_summary"
|
||||
android:title="@string/hardware_keys_long_press_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_overview_double_tap"
|
||||
android:summary="@string/hardware_keys_double_tap_summary"
|
||||
android:title="@string/hardware_keys_double_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="menu_key"
|
||||
android:title="@string/hardware_keys_menu_key_title">
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_menu_single_tap"
|
||||
android:summary="@string/hardware_keys_single_tap_summary"
|
||||
android:title="@string/hardware_keys_single_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_menu_long_press"
|
||||
android:summary="@string/hardware_keys_long_press_summary"
|
||||
android:title="@string/hardware_keys_long_press_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_menu_double_tap"
|
||||
android:summary="@string/hardware_keys_double_tap_summary"
|
||||
android:title="@string/hardware_keys_double_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="assist_key"
|
||||
android:title="@string/hardware_keys_assist_key_title">
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_assist_single_tap"
|
||||
android:summary="@string/hardware_keys_single_tap_summary"
|
||||
android:title="@string/hardware_keys_single_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_assist_long_press"
|
||||
android:summary="@string/hardware_keys_long_press_summary"
|
||||
android:title="@string/hardware_keys_long_press_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
<com.cherish.settings.preferences.ActionPreference
|
||||
android:key="hwkeys_button_assist_double_tap"
|
||||
android:summary="@string/hardware_keys_double_tap_summary"
|
||||
android:title="@string/hardware_keys_double_tap_title">
|
||||
</com.cherish.settings.preferences.ActionPreference>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
||||
54
res/xml/cherish_settings_edge_light.xml
Normal file
54
res/xml/cherish_settings_edge_light.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2022 FlamingoOS 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/edge_light_title">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:key="edge_light_intro"
|
||||
android:title="@string/edge_light_intro_text"
|
||||
android:selectable="false"
|
||||
android:persistent="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingMainSwitchPreference
|
||||
android:key="edge_light_enabled"
|
||||
android:title="@string/enable_edge_light"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="edge_light_always_trigger_on_pulse"
|
||||
android:title="@string/edge_light_always_trigger_on_pulse_title"
|
||||
android:summary="@string/edge_light_always_trigger_on_pulse_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="edge_light_repeat_animation"
|
||||
android:title="@string/edge_light_repeat_animation_title"
|
||||
android:summaryOn="@string/edge_light_repeat_animation_summary_on"
|
||||
android:summaryOff="@string/edge_light_repeat_animation_summary_off"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="edge_light_color_mode"
|
||||
android:title="@string/edge_light_color_mode_title"
|
||||
android:entries="@array/edge_light_color_mode_entries"
|
||||
android:entryValues="@array/edge_light_color_mode_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<net.margaritov.preference.colorpicker.ColorPickerPreference
|
||||
android:key="edge_light_custom_color"
|
||||
android:title="@string/edge_light_custom_color_title"
|
||||
android:defaultValue="0xffffff" />
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -27,8 +27,116 @@
|
||||
android:summary="@string/double_tap_sleep_lockscreen_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<ListPreference
|
||||
android:key="torch_power_button_gesture"
|
||||
android:title="@string/torch_power_button_gesture_title"
|
||||
android:entries="@array/torch_power_button_gesture_entries"
|
||||
android:entryValues="@array/torch_power_button_gesture_values" />
|
||||
|
||||
<Preference
|
||||
android:key="edge_light_enabled"
|
||||
android:title="@string/edge_light_title"
|
||||
android:summary="@string/edge_light_intro_text"
|
||||
android:fragment="com.cherish.settings.fragments.EdgeLightSettings" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="power_menu_hide_on_secure"
|
||||
android:title="@string/power_menu_hide_on_secure_title"
|
||||
android:summary="@string/power_menu_hide_on_secure_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="hide_lockscreen_status_bar"
|
||||
android:title="@string/hide_lockscreen_status_bar_title"
|
||||
android:summary="@string/hide_lockscreen_status_bar_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<Preference
|
||||
android:key="always_on_display_schedule"
|
||||
android:title="@string/always_on_display_schedule_title"
|
||||
android:fragment="com.cherish.settings.fragments.AODSchedule" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="lockscreen_battery_info"
|
||||
android:title="@string/lockscreen_charging_info_title"
|
||||
android:summary="@string/lockscreen_charging_info_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/lock_screen_custom_clock_face_category">
|
||||
|
||||
<ListPreference
|
||||
android:key="lock_screen_custom_clock_face"
|
||||
android:summary="%s"
|
||||
android:title="@string/lock_screen_custom_clock_face_title"
|
||||
android:entries="@array/lock_screen_custom_clock_face_entries"
|
||||
android:entryValues="@array/lock_screen_custom_clock_face_values" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="kg_custom_clock_color_enabled"
|
||||
android:title="@string/lockscreen_clock_color_title"
|
||||
android:summary="@string/lockscreen_clock_color_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<net.margaritov.preference.colorpicker.SecureSettingColorPickerPreference
|
||||
android:key="kg_custom_clock_color"
|
||||
android:title="@string/kg_custom_clock_color_title"
|
||||
android:defaultValue="0xFFFFFFFF"
|
||||
android:dependency="kg_custom_clock_color_enabled"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="kg_custom_clock_font"
|
||||
android:title="@string/kg_custom_clock_font_title"
|
||||
android:entries="@array/kg_custom_clock_font_entries"
|
||||
android:entryValues="@array/kg_custom_clock_font_values"
|
||||
android:defaultValue="23"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="kg_custom_date_font"
|
||||
android:title="@string/kg_custom_date_font_title"
|
||||
android:entries="@array/kg_custom_clock_font_entries"
|
||||
android:entryValues="@array/kg_custom_clock_font_values"
|
||||
android:defaultValue="23"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="small_clock_double_line"
|
||||
android:title="@string/small_clock_doubleline_title"
|
||||
android:summary="@string/small_clock_doubleline_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/weather_title">
|
||||
|
||||
<Preference
|
||||
android:key="omnijaws_settings"
|
||||
android:title="@string/qs_weather_settings_title"
|
||||
android:summary="@string/qs_weather_settings_summary"
|
||||
android:fragment="com.cherish.settings.fragments.OmniJawsSettings" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<!-- Udfps options -->
|
||||
<PreferenceCategory
|
||||
android:key="udfps_category"
|
||||
android:title="@string/udfps_category">
|
||||
|
||||
<Preference
|
||||
android:key="udfps_settings"
|
||||
android:title="@string/udfps_settings_title"
|
||||
android:summary="@string/udfps_settings_summary"
|
||||
android:fragment="com.cherish.settings.fragments.Udfps" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="enable_ripple_effect"
|
||||
android:title="@string/enable_fingerprint_ripple_effect_title"
|
||||
android:summary="@string/enable_fingerprint_ripple_effect_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="lockscreen_media_art_options"
|
||||
android:title="@string/lockscreen_media_art_options_title">
|
||||
@@ -46,6 +154,13 @@
|
||||
android:entryValues="@array/lockscreen_albumart_filter_values"
|
||||
android:dependency="lockscreen_media_metadata"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<!-- Pulse music visualizer -->
|
||||
<Preference
|
||||
android:key="pulse_settings"
|
||||
android:title="@string/pulse_settings"
|
||||
android:summary="@string/pulse_settings_summary"
|
||||
android:fragment="com.cherish.settings.fragments.sound.PulseSettings" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="ls_media_filter_blur_radius"
|
||||
|
||||
@@ -24,5 +24,58 @@
|
||||
android:title="@string/headset_connect_player_title"
|
||||
android:summary="@string/headset_connect_player_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="window_ignore_secure"
|
||||
android:title="@string/laboratory_ignore_window_secure_title"
|
||||
android:summary="@string/laboratory_ignore_window_secure_summary"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="click_partial_screenshot"
|
||||
android:title="@string/click_partial_screenshot_title"
|
||||
android:summary="@string/click_partial_screenshot_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<Preference
|
||||
android:key="app_lock"
|
||||
android:title="@string/app_lock_title"
|
||||
android:summary="@string/app_lock_summary"
|
||||
android:fragment="com.cherish.settings.security.applock.AppLockSettingsFragment"
|
||||
settings:controller="com.cherish.settings.security.applock.AppLockSettingsPreferenceController" />
|
||||
|
||||
<!-- Smart Charging -->
|
||||
<Preference
|
||||
android:key="smart_charging"
|
||||
android:title="@string/smart_charging_title"
|
||||
android:summary="@string/smart_charging_summary"
|
||||
android:fragment="com.cherish.settings.fragments.SmartCharging"/>
|
||||
|
||||
<!-- Squiggle animation -->
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="show_media_squiggle_animation"
|
||||
android:title="@string/show_squiggle_animation_title"
|
||||
android:summary="@string/show_squiggle_animation_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
|
||||
<!-- Unlock FPS for specific games -->
|
||||
<SwitchPreference
|
||||
android:key="use_games_spoof"
|
||||
android:title="@string/use_games_spoof_title"
|
||||
android:summary="@string/use_games_spoof_summary" />
|
||||
|
||||
<!--Netflix -->
|
||||
<SwitchPreference
|
||||
android:key="use_netflix_spoof"
|
||||
android:title="@string/netflix_spoof_title"
|
||||
android:summary="@string/netflix_spoof_summary"/>
|
||||
|
||||
<!-- Unlimited Photos storage -->
|
||||
<SwitchPreference
|
||||
android:key="use_photos_spoof"
|
||||
android:title="@string/use_photos_spoof_title"
|
||||
android:summary="@string/use_photos_spoof_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
@@ -62,6 +62,53 @@
|
||||
android:title="@string/notification_sound_vib_screen_on_title"
|
||||
android:summary="@string/notification_sound_vib_screen_on_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<!-- Alert Slider Notifications -->
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="alert_slider_notifications"
|
||||
android:title="@string/alert_slider_notifications_title"
|
||||
android:summary="@string/alert_slider_notifications_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="notification_guts_kill_app_button"
|
||||
android:title="@string/notification_guts_kill_app_button_title"
|
||||
android:summary="@string/notification_guts_kill_app_button_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="toast_icon"
|
||||
android:order="24"
|
||||
android:title="@string/toast_icon_title"
|
||||
android:summary="@string/toast_icon_summary"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="reticker_status"
|
||||
android:title="@string/reticker_title"
|
||||
android:summary="@string/reticker_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:dependency="reticker_status"
|
||||
android:key="reticker_colored"
|
||||
android:title="@string/reticker_colored_title"
|
||||
android:summary="@string/reticker_colored_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="new_reticker"
|
||||
android:dependency="reticker_status"
|
||||
android:title="@string/new_reticker_title"
|
||||
android:summary="@string/new_reticker_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="new_reticker_animation"
|
||||
android:dependency="reticker_status"
|
||||
android:title="@string/new_reticker_animation_title"
|
||||
android:summary="@string/new_reticker_animation_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
@@ -17,5 +17,64 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/powermenu_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="transparent_power_menu"
|
||||
android:title="@string/power_menu_transparency"
|
||||
android:max="100"
|
||||
android:min="0"
|
||||
android:defaultValue="100" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="transparent_power_dialog_dim"
|
||||
android:title="@string/power_menu_dialog_dim"
|
||||
android:max="100"
|
||||
android:min="0"
|
||||
android:defaultValue="50" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_power"
|
||||
android:title="@string/powermenu_power"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_restart"
|
||||
android:title="@string/powermenu_restart"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_advanced"
|
||||
android:title="@string/powermenu_advanced"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_screenshot"
|
||||
android:title="@string/powermenu_screenshot"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_settings"
|
||||
android:title="@string/powermenu_settings"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_lockdown"
|
||||
android:title="@string/powermenu_lockdown"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_emergency"
|
||||
android:title="@string/powermenu_emergency"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_users"
|
||||
android:title="@string/powermenu_users"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="powermenu_logout"
|
||||
android:title="@string/powermenu_logout"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
@@ -21,13 +21,162 @@
|
||||
<PreferenceCategory
|
||||
android:title="@string/qs_category">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="qs_transparency"
|
||||
android:title="@string/qs_transparency_title"
|
||||
android:summary="@string/qs_transparency_summary"
|
||||
android:defaultValue="100"
|
||||
settings:interval="1"
|
||||
settings:units="%"
|
||||
android:max="100"
|
||||
android:min="1" />
|
||||
|
||||
<ListPreference
|
||||
android:key="status_bar_quick_qs_pulldown"
|
||||
android:title="@string/status_bar_quick_qs_pulldown"
|
||||
android:entries="@array/quick_pulldown_entries"
|
||||
android:entryValues="@array/quick_pulldown_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="qs_header_clock_size"
|
||||
android:title="@string/clock_font_size_title"
|
||||
android:max="27"
|
||||
settings:min="10"
|
||||
settings:interval="1"
|
||||
android:defaultValue="14"
|
||||
settings:units="@string/unit_pixels" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="show_qs_date"
|
||||
android:title="@string/qs_date_title"
|
||||
android:summary="@string/qs_date_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="quick_settings_brighness_category"
|
||||
android:title="@string/qs_show_brightness_slider_title">
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="qs_show_brightness_slider"
|
||||
android:title="@string/qs_show_brightness_slider_title"
|
||||
android:entries="@array/qs_show_brightness_slider_entries"
|
||||
android:entryValues="@array/qs_show_brightness_slider_values"
|
||||
android:defaultValue="1" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="qs_brightness_slider_position"
|
||||
android:title="@string/qs_brightness_slider_position_title"
|
||||
android:entries="@array/qs_brightness_slider_position_entries"
|
||||
android:entryValues="@array/qs_brightness_slider_position_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="qs_show_auto_brightness"
|
||||
android:title="@string/qs_show_auto_brightness_title"
|
||||
android:summary="@string/qs_show_auto_brightness_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="qs_layout_category"
|
||||
android:title="@string/qs_layout_category_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_tile_label_hide"
|
||||
android:title="@string/qs_tile_label_hide_title"
|
||||
android:summary="@string/qs_tile_label_hide_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="qs_tile_label_size"
|
||||
android:title="@string/qs_tile_label_size_title"
|
||||
android:max="15"
|
||||
settings:min="10"
|
||||
settings:interval="1"
|
||||
settings:units="sp"
|
||||
android:defaultValue="14" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_tile_vertical_layout"
|
||||
android:title="@string/qs_tile_layout_title"
|
||||
android:summary="@string/qs_tile_layout_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="qs_layout_columns"
|
||||
android:title="@string/qs_columns_portrait_title"
|
||||
android:max="5"
|
||||
settings:min="2"
|
||||
settings:interval="1"
|
||||
android:defaultValue="2" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="qs_layout_columns_landscape"
|
||||
android:title="@string/qs_columns_landscape_title"
|
||||
android:max="6"
|
||||
settings:min="2"
|
||||
settings:interval="1"
|
||||
android:defaultValue="4" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/qs_footer_category">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_data_usage"
|
||||
android:title="@string/qs_footer_datausage_title"
|
||||
android:summary="@string/qs_footer_datausage_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/qs_footer_category">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_warnings"
|
||||
android:title="@string/qs_footer_warnings_title"
|
||||
android:summary="@string/qs_footer_warnings_summary"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_show_user"
|
||||
android:title="@string/qs_footer_users_icon_title"
|
||||
android:summary="@string/qs_footer_users_icon_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_data_usage"
|
||||
android:title="@string/qs_footer_datausage_title"
|
||||
android:summary="@string/qs_footer_datausage_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_show_edit"
|
||||
android:title="@string/qs_footer_edit_icon_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_show_power_menu"
|
||||
android:title="@string/qs_footer_show_power_menu_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_show_services"
|
||||
android:title="@string/qs_footer_services_icon_title" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="qs_footer_show_settings"
|
||||
android:title="@string/qs_footer_settings_icon_title"
|
||||
android:defaultValue="true" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
95
res/xml/cherish_settings_status_bar_clock.xml
Normal file
95
res/xml/cherish_settings_status_bar_clock.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2022 The CherishOS Projects
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/status_bar_clock_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="status_bar_clock_auto_hide_launcher"
|
||||
android:title="@string/status_bar_clock_auto_hide_title"
|
||||
android:summary="@string/status_bar_clock_auto_hide_launcher_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="status_bar_clock_auto_hide"
|
||||
android:title="@string/status_bar_clock_auto_hide_title"
|
||||
android:summary="@string/status_bar_clock_auto_hide_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="status_bar_clock_auto_hide_hduration"
|
||||
android:title="@string/status_bar_clock_auto_hide_hdur_title"
|
||||
android:summary="@string/status_bar_clock_auto_hide_hdur_summary"
|
||||
android:max="300"
|
||||
settings:min="5"
|
||||
settings:interval="5"
|
||||
android:dependency="status_bar_clock_auto_hide"
|
||||
android:defaultValue="60"
|
||||
settings:units="@string/unit_seconds" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="status_bar_clock_auto_hide_sduration"
|
||||
android:title="@string/status_bar_clock_auto_hide_sdur_title"
|
||||
android:summary="@string/status_bar_clock_auto_hide_sdur_summary"
|
||||
android:max="300"
|
||||
settings:min="5"
|
||||
settings:interval="5"
|
||||
android:dependency="status_bar_clock_auto_hide"
|
||||
android:defaultValue="5"
|
||||
settings:units="@string/unit_seconds" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="status_bar_clock_seconds"
|
||||
android:title="@string/status_bar_clock_seconds_title"
|
||||
android:summary="@string/status_bar_clock_seconds_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="status_bar_am_pm"
|
||||
android:title="@string/status_bar_am_pm_title"
|
||||
android:summary="%s"
|
||||
android:dialogTitle="@string/status_bar_am_pm_title"
|
||||
android:entries="@array/status_bar_am_pm_entries"
|
||||
android:entryValues="@array/status_bar_am_pm_values"
|
||||
android:defaultValue="2" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="status_bar_clock_size"
|
||||
android:title="@string/clock_font_size_title"
|
||||
android:max="20"
|
||||
settings:min="4"
|
||||
settings:interval="1"
|
||||
android:defaultValue="14"
|
||||
settings:units="@string/unit_pixels" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="status_bar_clock_date_display"
|
||||
android:title="@string/status_bar_date_title"
|
||||
android:entries="@array/status_bar_date_entries"
|
||||
android:entryValues="@array/status_bar_date_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="status_bar_clock_date_position"
|
||||
android:title="@string/clock_date_position"
|
||||
android:entries="@array/clock_date_position_entries"
|
||||
android:entryValues="@array/clock_date_position_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="status_bar_clock_date_style"
|
||||
android:title="@string/status_bar_date_style"
|
||||
android:entries="@array/status_bar_date_style_entries"
|
||||
android:entryValues="@array/status_bar_date_style_values"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<ListPreference
|
||||
android:key="status_bar_clock_date_format"
|
||||
android:title="@string/status_bar_date_format_title"
|
||||
android:entries="@array/status_bar_date_format_entries_values"
|
||||
android:entryValues="@array/status_bar_date_format_entries_values" />
|
||||
</PreferenceScreen>
|
||||
@@ -27,6 +27,12 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="statusbar_clock_chip"
|
||||
android:title="@string/statusbar_clock_chip_title"
|
||||
android:summary="@string/statusbar_clock_chip_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<Preference
|
||||
android:key="network_traffic_settings"
|
||||
android:title="@string/network_traffic_title"
|
||||
@@ -42,6 +48,21 @@
|
||||
<PreferenceCategory
|
||||
android:title="@string/status_bar_icons_category_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="status_bar_clock"
|
||||
android:title="@string/status_bar_clock_position_title"
|
||||
android:summary="%s"
|
||||
android:dialogTitle="@string/status_bar_clock_position_title"
|
||||
android:entries="@array/status_bar_clock_position_entries"
|
||||
android:entryValues="@array/status_bar_clock_position_values"
|
||||
android:defaultValue="2" />
|
||||
|
||||
<Preference
|
||||
android:key="clock"
|
||||
android:title="@string/status_bar_clock_title"
|
||||
android:summary="@string/status_bar_clock_summary"
|
||||
android:fragment="com.cherish.settings.fragments.Clock" />
|
||||
|
||||
<Preference
|
||||
android:key="status_bar_icons"
|
||||
android:title="@string/status_bar_icons_title"
|
||||
@@ -71,6 +92,22 @@
|
||||
android:summary="%s"
|
||||
android:defaultValue="0"
|
||||
android:dependency="show_volte_icon"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="vowifi_icon"
|
||||
android:title="@string/vowifi_icon_title"
|
||||
android:entries="@array/vowifi_icon_entries"
|
||||
android:entryValues="@array/vowifi_icon_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="vowifi_icon_style"
|
||||
android:title="@string/vowifi_icon_style_title"
|
||||
android:entries="@array/vowifi_icon_style_entries"
|
||||
android:entryValues="@array/vowifi_icon_style_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0"/>
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="use_old_mobiletype"
|
||||
@@ -89,6 +126,50 @@
|
||||
android:title="@string/roaming_indicator_icon_title"
|
||||
android:summary="@string/roaming_indicator_icon_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="enable_camera_privacy_indicator"
|
||||
android:title="@string/mic_camera_privacy_indicator_title"
|
||||
android:summary="@string/mic_camera_privacy_indicator_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="enable_location_privacy_indicator"
|
||||
android:title="@string/location_privacy_indicator_title"
|
||||
android:summary="@string/location_privacy_indicator_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="enable_projection_privacy_indicator"
|
||||
android:title="@string/projection_privacy_indicator_title"
|
||||
android:summary="@string/projection_privacy_indicator_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="statusbar_notif_count"
|
||||
android:title="@string/statusbar_notif_count_title"
|
||||
android:summary="@string/statusbar_notif_count_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="statusbar_colored_icons"
|
||||
android:title="@string/statusbar_colored_icons_title"
|
||||
android:summary="@string/statusbar_colored_icons_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="bluetooth_show_battery"
|
||||
android:title="@string/bluetooth_battery_title"
|
||||
android:summary="@string/bluetooth_battery_summary"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
|
||||
<!-- Birghtness control -->
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="status_bar_brightness_control"
|
||||
android:title="@string/status_bar_brightness_control_title"
|
||||
android:summary="@string/status_bar_brightness_control_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
@@ -17,6 +17,38 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/theme_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="settings_layout_category"
|
||||
android:title="@string/settings_layout_category_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="settings_dashboard_style"
|
||||
android:title="@string/settings_dashboard_style_title"
|
||||
android:entries="@array/settings_dashboard_style_entries"
|
||||
android:entryValues="@array/settings_dashboard_style_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="alt_settings_layout"
|
||||
android:title="@string/settings_base_style_title"
|
||||
android:summary="@string/settings_base_style_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="use_stock_layout"
|
||||
android:title="@string/settings_home_style_title"
|
||||
android:summary="@string/settings_home_style_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="disable_usercard"
|
||||
android:title="@string/disable_usercard_title"
|
||||
android:summary="@string/disable_usercard_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/theme_customization_category">
|
||||
@@ -27,6 +59,24 @@
|
||||
android:summary="@string/dark_ui_mode_summary"
|
||||
android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment"
|
||||
settings:controller="com.android.settings.display.DarkUIPreferenceController" />
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="system_custom_theme"
|
||||
android:title="@string/custom_theme_title"
|
||||
android:summary="@string/custom_theme_summary"
|
||||
android:defaultValue="0"
|
||||
android:entries="@array/custom_theme_entries"
|
||||
android:entryValues="@array/custom_theme_values" />
|
||||
|
||||
<!-- QS style -->
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="qs_panel_style"
|
||||
android:title="@string/qs_styles_title"
|
||||
android:dialogTitle="@string/qs_styles_title"
|
||||
android:entries="@array/qs_styles_entries"
|
||||
android:entryValues="@array/qs_styles_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0" />
|
||||
|
||||
<!-- Font style -->
|
||||
<Preference
|
||||
|
||||
68
res/xml/cherish_settings_udfps.xml
Normal file
68
res/xml/cherish_settings_udfps.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2019-2022 The CherishOS Projects
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/udfps_category">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="udfps_haptic_feedback"
|
||||
android:title="@string/udfps_haptic_feedback_title"
|
||||
android:summary="@string/udfps_haptic_feedback_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="udfps_success_vib"
|
||||
android:title="@string/udfps_success_vib_title"
|
||||
android:summary="@string/udfps_success_vib_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="udfps_error_vib"
|
||||
android:title="@string/udfps_error_vib_title"
|
||||
android:summary="@string/udfps_error_vib_summary"
|
||||
android:defaultValue="true" />
|
||||
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="udfps_customization"
|
||||
android:title="@string/udfps_customization">
|
||||
|
||||
<Preference
|
||||
android:key="udfps_icon_picker"
|
||||
android:title="@string/udfps_icon_picker_title"
|
||||
android:summary="@string/udfps_icon_picker_summary"
|
||||
android:fragment="com.cherish.settings.fragments.UdfpsIconPicker" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="custom_fp_icon_enabled"
|
||||
android:title="@string/custom_fp_icon_title"
|
||||
android:summary="@string/custom_fp_icon_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<Preference
|
||||
android:key="custom_fp_file_select"
|
||||
android:title="@string/custom_fp_select_title"
|
||||
android:summary="@string/custom_fp_select_summary"
|
||||
android:dependency="custom_fp_icon_enabled"
|
||||
android:persistent="false">
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="udfps_recognizing_animation_preview"
|
||||
android:title="@string/udfps_recog_animation_effect_title"
|
||||
android:summary="@string/udfps_recog_animation_effect_summary"
|
||||
android:fragment="com.cherish.settings.fragments.UdfpsAnimation" />
|
||||
|
||||
<Preference
|
||||
android:key="udfps_pressedicon_picker"
|
||||
android:title="@string/udfps_pressed_color_title"
|
||||
android:summary="@string/udfps_pressed_color_summary"
|
||||
android:fragment="com.cherish.settings.fragments.UdfpsPressedIconPicker" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -15,6 +15,49 @@
|
||||
-->
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/volume_steps_fragment_title">
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_alarm"
|
||||
android:title="@string/volume_steps_alarm_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_dtmf"
|
||||
android:title="@string/volume_steps_dtmf_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_music"
|
||||
android:title="@string/volume_steps_music_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_notification"
|
||||
android:title="@string/volume_steps_notification_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_ring"
|
||||
android:title="@string/volume_steps_ring_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_system"
|
||||
android:title="@string/volume_steps_system_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
<ListPreference
|
||||
android:key="volume_steps_voice_call"
|
||||
android:title="@string/volume_steps_voice_call_title"
|
||||
android:entries="@array/volume_steps_entries"
|
||||
android:entryValues="@array/volume_steps_entries" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
60
res/xml/omnijaws_settings.xml
Normal file
60
res/xml/omnijaws_settings.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2017 The OmniROM Project
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:key="omnijaws_settings"
|
||||
android:title="@string/weather_title">
|
||||
|
||||
<ListPreference
|
||||
android:key="weather_icon_pack"
|
||||
android:title="@string/weather_icon_pack_title"
|
||||
android:persistent="false" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:title="@string/weather_icon_pack_info_title" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="kg_show_weather_temp"
|
||||
android:title="@string/kg_weather_title"
|
||||
android:dialogTitle="@string/kg_weather_title"
|
||||
android:entries="@array/kg_launcher_weather_entries"
|
||||
android:summary="%s"
|
||||
android:entryValues="@array/kg_launcher_weather_values" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="qs_show_weather_temp"
|
||||
android:title="@string/qs_weather_title"
|
||||
android:dialogTitle="@string/qs_weather_title"
|
||||
android:entries="@array/qs_weather_entries"
|
||||
android:summary="%s"
|
||||
android:entryValues="@array/qs_weather_values" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingListPreference
|
||||
android:key="qs_weather_position"
|
||||
android:title="@string/qsweather_dialog_title"
|
||||
android:dialogTitle="@string/qsweather_dialog_title"
|
||||
android:entries="@array/qsweather_position_entries"
|
||||
android:summary="%s"
|
||||
android:entryValues="@array/qsweather_position_values" />
|
||||
|
||||
<Preference
|
||||
android:title="@string/weather_config_title"
|
||||
android:summary="@string/weather_config_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="org.omnirom.omnijaws"
|
||||
android:targetClass="org.omnirom.omnijaws.SettingsActivityService" />
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
183
res/xml/pulse_settings.xml
Normal file
183
res/xml/pulse_settings.xml
Normal file
@@ -0,0 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2020-22 The CherishOS 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"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/pulse_settings" >
|
||||
|
||||
<SwitchPreference
|
||||
android:key="navbar_pulse_enabled"
|
||||
android:title="@string/show_navbar_pulse_title"
|
||||
android:summary="@string/show_navbar_pulse_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="lockscreen_pulse_enabled"
|
||||
android:title="@string/show_lockscreen_pulse_title"
|
||||
android:summary="@string/show_lockscreen_pulse_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="ambient_pulse_enabled"
|
||||
android:title="@string/show_ambient_pulse_title"
|
||||
android:summary="@string/show_ambient_pulse_summary"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="pulse_render_style"
|
||||
android:title="@string/pulse_render_mode_title"
|
||||
android:entries="@array/pulse_render_mode_entries"
|
||||
android:entryValues="@array/pulse_render_mode_values"
|
||||
android:defaultValue="1"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="pulse_custom_gravity"
|
||||
android:title="@string/pulse_custom_gravity_title"
|
||||
android:entries="@array/pulse_custom_gravity_entries"
|
||||
android:entryValues="@array/pulse_custom_gravity_values"
|
||||
android:summary="%s"
|
||||
android:defaultValue="0"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="visualizer_center_mirrored"
|
||||
android:title="@string/visualizer_center_mirrored_title"
|
||||
android:summary="@string/visualizer_center_mirrored_summary"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="pulse_vertical_mirror"
|
||||
android:title="@string/pulse_vertical_mirror_title"
|
||||
android:summary="@string/pulse_vertical_mirror_summary"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="pulse_smoothing_enabled"
|
||||
android:title="@string/pulse_smoothing_enabled_title"
|
||||
android:summary="@string/pulse_smoothing_enabled_summary"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingListPreference
|
||||
android:key="pulse_color_mode"
|
||||
android:title="@string/pulse_color_mode_title"
|
||||
android:entries="@array/pulse_color_mode_entries"
|
||||
android:entryValues="@array/pulse_color_mode_values"
|
||||
android:defaultValue="2"/>
|
||||
|
||||
<net.margaritov.preference.colorpicker.SecureSettingColorPickerPreference
|
||||
android:key="pulse_color_user"
|
||||
android:title="@string/pulse_color_user_title"
|
||||
android:defaultValue="0x92FFFFFF"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_lavalamp_speed"
|
||||
android:title="@string/pulse_lavalamp_speed_title"
|
||||
android:defaultValue="10000"
|
||||
android:max="30000"
|
||||
settings:min="200"
|
||||
settings:interval="200"
|
||||
settings:units="@string/unit_milliseconds"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="pulse_fading_bars_category"
|
||||
android:title="@string/pulse_legacy_mode_advanced_category">
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_custom_dimen"
|
||||
android:title="@string/pulse_custom_dimen"
|
||||
android:defaultValue="14"
|
||||
android:max="30"
|
||||
settings:min="1"
|
||||
settings:units="@string/unit_pixels"
|
||||
android:dependency="pulse_fading_bars_category"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_custom_div"
|
||||
android:title="@string/pulse_custom_div"
|
||||
android:defaultValue="16"
|
||||
android:max="44"
|
||||
settings:min="2"
|
||||
settings:interval="2"
|
||||
settings:units="@string/unit_pixels"
|
||||
android:dependency="pulse_fading_bars_category"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_filled_block_size"
|
||||
android:title="@string/pulse_filled_block_size"
|
||||
android:defaultValue="4"
|
||||
android:max="8"
|
||||
settings:min="4"
|
||||
settings:units="@string/unit_pixels"
|
||||
android:dependency="pulse_fading_bars_category"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_empty_block_size"
|
||||
android:title="@string/pulse_empty_block_size"
|
||||
android:defaultValue="1"
|
||||
android:max="4"
|
||||
settings:min="0"
|
||||
settings:units="@string/unit_pixels"
|
||||
android:dependency="pulse_fading_bars_category"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_custom_fudge_factor"
|
||||
android:title="@string/pulse_custom_fudge_factor"
|
||||
android:defaultValue="4"
|
||||
android:max="6"
|
||||
settings:min="2"
|
||||
android:dependency="pulse_fading_bars_category"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="pulse_2"
|
||||
android:title="@string/pulse_solid_dimen_category">
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSwitchPreference
|
||||
android:key="pulse_solid_units_rounded"
|
||||
android:title="@string/pulse_solid_units_rounded_title"
|
||||
android:summary="@string/pulse_solid_units_rounded_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="pulse_2"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_solid_units_opacity"
|
||||
android:title="@string/pulse_solid_units_opacity"
|
||||
android:defaultValue="200"
|
||||
android:max="255"
|
||||
settings:min="0"
|
||||
android:dependency="pulse_2"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_solid_units_count"
|
||||
android:title="@string/pulse_solid_units_count"
|
||||
android:defaultValue="32"
|
||||
android:max="128"
|
||||
settings:min="16"
|
||||
settings:interval="16"
|
||||
android:dependency="pulse_2"/>
|
||||
|
||||
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
|
||||
android:key="pulse_solid_fudge_factor"
|
||||
android:title="@string/pulse_custom_fudge_factor"
|
||||
android:defaultValue="4"
|
||||
android:max="6"
|
||||
settings:min="2"
|
||||
android:dependency="pulse_2"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="pulse_settings_footer"
|
||||
android:selectable="false"
|
||||
settings:searchable="false" />
|
||||
</PreferenceScreen>
|
||||
57
res/xml/smart_charging.xml
Normal file
57
res/xml/smart_charging.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2020-2022 The CherishOS 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"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
android:title="@string/smart_charging_title">
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="smart_charging"
|
||||
android:title="@string/smart_charging_switch_title"
|
||||
android:summary="@string/smart_charging_summary"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSwitchPreference
|
||||
android:key="smart_charging_reset_stats"
|
||||
android:title="@string/smart_charging_reset_stats_title"
|
||||
android:summary="@string/smart_charging_reset_stats_summary"
|
||||
android:defaultValue="false"
|
||||
android:dependency="smart_charging" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="smart_charging_level"
|
||||
android:title="@string/smart_charging_level_title"
|
||||
android:max="100"
|
||||
settings:min="65"
|
||||
settings:units="%"
|
||||
android:defaultValue="80"
|
||||
android:dependency="smart_charging" />
|
||||
|
||||
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
|
||||
android:key="smart_charging_resume_level"
|
||||
android:title="@string/smart_charging_resume_level_title"
|
||||
android:max="99"
|
||||
settings:min="15"
|
||||
settings:units="%"
|
||||
android:defaultValue="60"
|
||||
android:dependency="smart_charging" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="smart_charging_footer"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
android:dependency="smart_charging" />
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Switch
|
||||
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
||||
import com.android.settings.R
|
||||
import com.android.settings.core.TogglePreferenceController
|
||||
import com.android.settingslib.widget.MainSwitchPreference
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener
|
||||
|
||||
abstract class CherishTogglePreferenceController(
|
||||
context: Context,
|
||||
key: String,
|
||||
) : TogglePreferenceController(context, key),
|
||||
OnMainSwitchChangeListener {
|
||||
|
||||
override fun displayPreference(screen: PreferenceScreen) {
|
||||
super.displayPreference(screen)
|
||||
val preference = screen.findPreference<Preference>(preferenceKey) ?: return
|
||||
if (preference is MainSwitchPreference) {
|
||||
preference.addOnSwitchChangeListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
|
||||
setChecked(isChecked)
|
||||
}
|
||||
|
||||
override fun getSliceHighlightMenuRes() = R.string.menu_key_cherish
|
||||
}
|
||||
186
src/com/cherish/settings/fragments/AODSchedule.java
Normal file
186
src/com/cherish/settings/fragments/AODSchedule.java
Normal file
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import static com.cherish.settings.fragments.LockScreenSettings.MODE_DISABLED;
|
||||
import static com.cherish.settings.fragments.LockScreenSettings.MODE_NIGHT;
|
||||
import static com.cherish.settings.fragments.LockScreenSettings.MODE_TIME;
|
||||
import static com.cherish.settings.fragments.LockScreenSettings.MODE_MIXED_SUNSET;
|
||||
import static com.cherish.settings.fragments.LockScreenSettings.MODE_MIXED_SUNRISE;
|
||||
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.format.DateFormat;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import com.cherish.settings.preferences.SecureSettingListPreference;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@SearchIndexable
|
||||
public class AODSchedule extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceClickListener, Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String MODE_KEY = "doze_always_on_auto_mode";
|
||||
private static final String SINCE_PREF_KEY = "doze_always_on_auto_since";
|
||||
private static final String TILL_PREF_KEY = "doze_always_on_auto_till";
|
||||
|
||||
private SecureSettingListPreference mModePref;
|
||||
private Preference mSincePref;
|
||||
private Preference mTillPref;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.always_on_display_schedule);
|
||||
PreferenceScreen screen = getPreferenceScreen();
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
|
||||
mSincePref = findPreference(SINCE_PREF_KEY);
|
||||
mSincePref.setOnPreferenceClickListener(this);
|
||||
mTillPref = findPreference(TILL_PREF_KEY);
|
||||
mTillPref.setOnPreferenceClickListener(this);
|
||||
|
||||
int mode = Settings.Secure.getIntForUser(resolver,
|
||||
MODE_KEY, MODE_DISABLED, UserHandle.USER_CURRENT);
|
||||
mModePref = (SecureSettingListPreference) findPreference(MODE_KEY);
|
||||
mModePref.setValue(String.valueOf(mode));
|
||||
mModePref.setSummary(mModePref.getEntry());
|
||||
mModePref.setOnPreferenceChangeListener(this);
|
||||
|
||||
updateTimeEnablement(mode);
|
||||
updateTimeSummary(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||
int value = Integer.parseInt((String) objValue);
|
||||
int index = mModePref.findIndexOfValue((String) objValue);
|
||||
mModePref.setSummary(mModePref.getEntries()[index]);
|
||||
Settings.Secure.putIntForUser(getActivity().getContentResolver(),
|
||||
MODE_KEY, value, UserHandle.USER_CURRENT);
|
||||
updateTimeEnablement(value);
|
||||
updateTimeSummary(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
String[] times = getCustomTimeSetting();
|
||||
boolean isSince = preference == mSincePref;
|
||||
int hour, minute;
|
||||
TimePickerDialog.OnTimeSetListener listener = (view, hourOfDay, minute1) -> {
|
||||
updateTimeSetting(isSince, hourOfDay, minute1);
|
||||
};
|
||||
if (isSince) {
|
||||
String[] sinceValues = times[0].split(":", 0);
|
||||
hour = Integer.parseInt(sinceValues[0]);
|
||||
minute = Integer.parseInt(sinceValues[1]);
|
||||
} else {
|
||||
String[] tillValues = times[1].split(":", 0);
|
||||
hour = Integer.parseInt(tillValues[0]);
|
||||
minute = Integer.parseInt(tillValues[1]);
|
||||
}
|
||||
TimePickerDialog dialog = new TimePickerDialog(getContext(), listener,
|
||||
hour, minute, DateFormat.is24HourFormat(getContext()));
|
||||
dialog.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
private String[] getCustomTimeSetting() {
|
||||
String value = Settings.Secure.getStringForUser(getActivity().getContentResolver(),
|
||||
Settings.Secure.DOZE_ALWAYS_ON_AUTO_TIME, UserHandle.USER_CURRENT);
|
||||
if (value == null || value.equals("")) value = "20:00,07:00";
|
||||
return value.split(",", 0);
|
||||
}
|
||||
|
||||
private void updateTimeEnablement(int mode) {
|
||||
mSincePref.setEnabled(mode == MODE_TIME || mode == MODE_MIXED_SUNRISE);
|
||||
mTillPref.setEnabled(mode == MODE_TIME || mode == MODE_MIXED_SUNSET);
|
||||
}
|
||||
|
||||
private void updateTimeSummary(int mode) {
|
||||
updateTimeSummary(getCustomTimeSetting(), mode);
|
||||
}
|
||||
|
||||
private void updateTimeSummary(String[] times, int mode) {
|
||||
if (mode == MODE_DISABLED) {
|
||||
mSincePref.setSummary("-");
|
||||
mTillPref.setSummary("-");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == MODE_NIGHT) {
|
||||
mSincePref.setSummary(R.string.always_on_display_schedule_sunset);
|
||||
mTillPref.setSummary(R.string.always_on_display_schedule_sunrise);
|
||||
return;
|
||||
}
|
||||
|
||||
String outputFormat = DateFormat.is24HourFormat(getContext()) ? "HH:mm" : "hh:mm a";
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern(outputFormat);
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
LocalTime sinceDT = LocalTime.parse(times[0], formatter);
|
||||
LocalTime tillDT = LocalTime.parse(times[1], formatter);
|
||||
|
||||
if (mode == MODE_MIXED_SUNSET) {
|
||||
mSincePref.setSummary(R.string.always_on_display_schedule_sunset);
|
||||
mTillPref.setSummary(tillDT.format(outputFormatter));
|
||||
} else if (mode == MODE_MIXED_SUNRISE) {
|
||||
mTillPref.setSummary(R.string.always_on_display_schedule_sunrise);
|
||||
mSincePref.setSummary(sinceDT.format(outputFormatter));
|
||||
} else {
|
||||
mSincePref.setSummary(sinceDT.format(outputFormatter));
|
||||
mTillPref.setSummary(tillDT.format(outputFormatter));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTimeSetting(boolean since, int hour, int minute) {
|
||||
String[] times = getCustomTimeSetting();
|
||||
String nHour = "";
|
||||
String nMinute = "";
|
||||
if (hour < 10) nHour += "0";
|
||||
if (minute < 10) nMinute += "0";
|
||||
nHour += String.valueOf(hour);
|
||||
nMinute += String.valueOf(minute);
|
||||
times[since ? 0 : 1] = nHour + ":" + nMinute;
|
||||
Settings.Secure.putStringForUser(getActivity().getContentResolver(),
|
||||
Settings.Secure.DOZE_ALWAYS_ON_AUTO_TIME,
|
||||
times[0] + "," + times[1], UserHandle.USER_CURRENT);
|
||||
updateTimeSummary(times, Integer.parseInt(mModePref.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.always_on_display_schedule);
|
||||
}
|
||||
@@ -54,6 +54,10 @@ import java.util.List;
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
implements OnPreferenceChangeListener {
|
||||
|
||||
private static final String POWER_MENU_ANIMATIONS = "power_menu_animations";
|
||||
|
||||
private ListPreference mPowerMenuAnimations;
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
@@ -66,6 +70,12 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
addPreferencesFromResource(R.xml.cherish_settings_animations);
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
PreferenceScreen prefs = getPreferenceScreen();
|
||||
|
||||
mPowerMenuAnimations = (ListPreference) findPreference(POWER_MENU_ANIMATIONS);
|
||||
mPowerMenuAnimations.setValue(String.valueOf(Settings.System.getInt(
|
||||
getContentResolver(), Settings.System.POWER_MENU_ANIMATIONS, 0)));
|
||||
mPowerMenuAnimations.setSummary(mPowerMenuAnimations.getEntry());
|
||||
mPowerMenuAnimations.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +85,14 @@ public class AnimationsSettings extends SettingsPreferenceFragment
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mPowerMenuAnimations) {
|
||||
Settings.System.putInt(getContentResolver(), Settings.System.POWER_MENU_ANIMATIONS,
|
||||
Integer.valueOf((String) newValue));
|
||||
mPowerMenuAnimations.setValue(String.valueOf(newValue));
|
||||
mPowerMenuAnimations.setSummary(mPowerMenuAnimations.getEntry());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.cherish.settings.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.annotation.IntDef
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.drawable.Drawable
|
||||
@@ -35,6 +35,7 @@ import android.widget.TextView
|
||||
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
@@ -43,8 +44,6 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.android.settings.R
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
@@ -57,38 +56,29 @@ import kotlinx.coroutines.withContext
|
||||
* and package name of the application, along with a [CheckBox]
|
||||
* indicating whether the item is selected or not.
|
||||
*/
|
||||
abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnActionExpandListener {
|
||||
abstract class AppListFragment : Fragment(R.layout.app_list_layout),
|
||||
MenuItem.OnActionExpandListener {
|
||||
|
||||
private val mutex = Mutex()
|
||||
|
||||
private lateinit var fragmentScope: CoroutineScope
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private lateinit var appBarLayout: AppBarLayout
|
||||
private lateinit var packageManager: PackageManager
|
||||
private lateinit var recyclerView: RecyclerView
|
||||
private lateinit var pm: PackageManager
|
||||
private lateinit var adapter: AppListAdapter
|
||||
|
||||
private val packageList = mutableListOf<PackageInfo>()
|
||||
private var appBarLayout: AppBarLayout? = null
|
||||
private var recyclerView: RecyclerView? = null
|
||||
private var progressBar: ProgressBar? = null
|
||||
|
||||
private var searchText = ""
|
||||
private var displayCategory: Int = CATEGORY_USER_ONLY
|
||||
private var packageFilter: ((PackageInfo) -> Boolean) = { true }
|
||||
private var packageComparator: ((PackageInfo, PackageInfo) -> Int) = { a, b ->
|
||||
getLabel(a).compareTo(getLabel(b))
|
||||
}
|
||||
|
||||
private var needsToHideProgressBar = false
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
fragmentScope = CoroutineScope(Dispatchers.Main)
|
||||
private var packageFilter: (PackageInfo) -> Boolean = { true }
|
||||
private var packageComparator: (PackageInfo, PackageInfo) -> Int = { first, second ->
|
||||
getLabel(first).compareTo(getLabel(second))
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setHasOptionsMenu(true)
|
||||
packageManager = requireContext().packageManager
|
||||
packageList.addAll(packageManager.getInstalledPackages(0))
|
||||
pm = requireContext().packageManager
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,15 +87,19 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
abstract protected fun getTitle(): Int
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
requireActivity().setTitle(getTitle())
|
||||
appBarLayout = requireActivity().findViewById(R.id.app_bar)
|
||||
val activity = requireActivity()
|
||||
activity.setTitle(getTitle())
|
||||
appBarLayout = activity.findViewById(R.id.app_bar)
|
||||
progressBar = view.findViewById(R.id.loading_progress)
|
||||
adapter = AppListAdapter()
|
||||
recyclerView = view.findViewById<RecyclerView>(R.id.apps_list).also {
|
||||
adapter = AppListAdapter(getInitialCheckedList(), layoutInflater).apply {
|
||||
setOnAppSelectListener { onAppSelected(it) }
|
||||
setOnAppDeselectListener { onAppDeselected(it) }
|
||||
setOnListUpdateListener { onListUpdate(it) }
|
||||
}
|
||||
recyclerView = view.findViewById<RecyclerView>(R.id.apps_list)?.also {
|
||||
it.layoutManager = LinearLayoutManager(context)
|
||||
it.adapter = adapter
|
||||
}
|
||||
needsToHideProgressBar = true
|
||||
refreshList()
|
||||
}
|
||||
|
||||
@@ -118,19 +112,21 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
inflater.inflate(R.menu.app_list_menu, menu)
|
||||
val searchItem = menu.findItem(R.id.search).also {
|
||||
it.setOnActionExpandListener(this)
|
||||
if (appBarLayout != null) {
|
||||
it.setOnActionExpandListener(this)
|
||||
}
|
||||
}
|
||||
val searchView = searchItem.actionView as SearchView
|
||||
searchView.setQueryHint(getString(R.string.search_apps));
|
||||
searchView.setOnQueryTextListener(object: SearchView.OnQueryTextListener {
|
||||
searchView.setQueryHint(getString(R.string.search_apps))
|
||||
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
||||
override fun onQueryTextSubmit(query: String) = false
|
||||
|
||||
override fun onQueryTextChange(newText: String): Boolean {
|
||||
fragmentScope.launch {
|
||||
lifecycleScope.launch {
|
||||
mutex.withLock {
|
||||
searchText = newText
|
||||
}
|
||||
refreshList()
|
||||
refreshListInternal()
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -139,34 +135,29 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
|
||||
override fun onMenuItemActionExpand(item: MenuItem): Boolean {
|
||||
// To prevent a large space on tool bar.
|
||||
appBarLayout.setExpanded(false /*expanded*/, false /*animate*/)
|
||||
appBarLayout?.setExpanded(false /*expanded*/, false /*animate*/)
|
||||
// To prevent user expanding the collapsing tool bar view.
|
||||
ViewCompat.setNestedScrollingEnabled(recyclerView, false)
|
||||
recyclerView?.let { ViewCompat.setNestedScrollingEnabled(it, false) }
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onMenuItemActionCollapse(item: MenuItem): Boolean {
|
||||
// We keep the collapsed status after user cancel the search function.
|
||||
appBarLayout.setExpanded(false /*expanded*/, false /*animate*/)
|
||||
appBarLayout?.setExpanded(false /*expanded*/, false /*animate*/)
|
||||
// Allow user to expande the tool bar view.
|
||||
ViewCompat.setNestedScrollingEnabled(recyclerView, true)
|
||||
recyclerView?.let { ViewCompat.setNestedScrollingEnabled(it, true) }
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDetach() {
|
||||
fragmentScope.cancel()
|
||||
super.onDetach()
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the type of apps that should be displayed in the list.
|
||||
* Defaults to [CATEGORY_USER_ONLY].
|
||||
*
|
||||
* @param category one of [CATEGORY_SYSTEM_ONLY],
|
||||
* [CATEGORY_USER_ONLY], [CATEGORY_BOTH]
|
||||
* [CATEGORY_USER_ONLY], [CATEGORY_BOTH]
|
||||
*/
|
||||
fun setDisplayCategory(category: Int) {
|
||||
fragmentScope.launch {
|
||||
fun setDisplayCategory(@Category category: Int) {
|
||||
lifecycleScope.launch {
|
||||
mutex.withLock {
|
||||
displayCategory = category
|
||||
}
|
||||
@@ -177,10 +168,10 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
* Set a custom filter to filter out items from the list.
|
||||
*
|
||||
* @param customFilter a function that takes a [PackageInfo] and
|
||||
* returns a [Boolean] indicating whether to show the item or not.
|
||||
* returns a [Boolean] indicating whether to show the item or not.
|
||||
*/
|
||||
fun setCustomFilter(customFilter: ((packageInfo: PackageInfo) -> Boolean)) {
|
||||
fragmentScope.launch {
|
||||
fun setCustomFilter(customFilter: (PackageInfo) -> Boolean) {
|
||||
lifecycleScope.launch {
|
||||
mutex.withLock {
|
||||
packageFilter = customFilter
|
||||
}
|
||||
@@ -188,13 +179,13 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a [Comparator] for sorting the elements in the list..
|
||||
* Set a [Comparator] for sorting the elements in the list.
|
||||
*
|
||||
* @param comparator a function that takes two [PackageInfo]'s and returns
|
||||
* an [Int] representing their relative priority.
|
||||
* an [Int] representing their relative priority.
|
||||
*/
|
||||
fun setComparator(comparator: ((a: PackageInfo, b: PackageInfo) -> Int)) {
|
||||
fragmentScope.launch {
|
||||
fun setComparator(comparator: (PackageInfo, PackageInfo) -> Int) {
|
||||
lifecycleScope.launch {
|
||||
mutex.withLock {
|
||||
packageComparator = comparator
|
||||
}
|
||||
@@ -222,75 +213,111 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
*/
|
||||
open protected fun onAppDeselected(packageName: String) {}
|
||||
|
||||
protected fun refreshList() {
|
||||
fragmentScope.launch {
|
||||
val list = withContext(Dispatchers.Default) {
|
||||
mutex.withLock {
|
||||
packageList.filter {
|
||||
when (displayCategory) {
|
||||
CATEGORY_SYSTEM_ONLY -> it.applicationInfo.isSystemApp()
|
||||
CATEGORY_USER_ONLY -> !it.applicationInfo.isSystemApp()
|
||||
else -> true
|
||||
} &&
|
||||
getLabel(it).contains(searchText, true) &&
|
||||
packageFilter(it)
|
||||
}.sortedWith(packageComparator).map { appInfofromPackage(it) }
|
||||
}
|
||||
}
|
||||
adapter.submitList(list)
|
||||
if (needsToHideProgressBar) {
|
||||
progressBar.visibility = View.GONE
|
||||
needsToHideProgressBar = false
|
||||
}
|
||||
fun refreshList() {
|
||||
lifecycleScope.launch {
|
||||
refreshListInternal()
|
||||
}
|
||||
}
|
||||
|
||||
private fun appInfofromPackage(packageInfo: PackageInfo): AppInfo =
|
||||
AppInfo(
|
||||
packageInfo.packageName,
|
||||
getLabel(packageInfo),
|
||||
packageInfo.applicationInfo.loadIcon(packageManager),
|
||||
)
|
||||
private suspend fun refreshListInternal() {
|
||||
val list = withContext(Dispatchers.Default) {
|
||||
val sortedList = mutex.withLock {
|
||||
pm.getInstalledPackages(PackageManager.MATCH_ALL).filter {
|
||||
val categoryMatches = when (displayCategory) {
|
||||
CATEGORY_SYSTEM_ONLY -> it.applicationInfo.isSystemApp()
|
||||
CATEGORY_USER_ONLY -> !it.applicationInfo.isSystemApp()
|
||||
else -> true
|
||||
}
|
||||
categoryMatches && packageFilter(it) &&
|
||||
getLabel(it).contains(searchText, true)
|
||||
}.sortedWith(packageComparator)
|
||||
}
|
||||
sortedList.map {
|
||||
AppInfo(
|
||||
it.packageName,
|
||||
getLabel(it),
|
||||
it.applicationInfo.loadIcon(pm),
|
||||
)
|
||||
}
|
||||
}
|
||||
adapter.submitList(list)
|
||||
progressBar?.visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun getLabel(packageInfo: PackageInfo) =
|
||||
packageInfo.applicationInfo.loadLabel(packageManager).toString()
|
||||
packageInfo.applicationInfo.loadLabel(pm).toString()
|
||||
|
||||
private inner class AppListAdapter :
|
||||
ListAdapter<AppInfo, AppListViewHolder>(itemCallback)
|
||||
{
|
||||
private val checkedList = getInitialCheckedList().toMutableList()
|
||||
private class AppListAdapter(
|
||||
initialCheckedList: List<String>,
|
||||
private val layoutInflater: LayoutInflater
|
||||
) : ListAdapter<AppInfo, AppListViewHolder>(itemCallback) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
|
||||
AppListViewHolder(layoutInflater.inflate(
|
||||
R.layout.app_list_item, parent, false))
|
||||
private val checkedList = initialCheckedList.toMutableList()
|
||||
private var appSelectListener: (String) -> Unit = {}
|
||||
private var appDeselectListener: (String) -> Unit = {}
|
||||
private var listUpdateListener: (List<String>) -> Unit = {}
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
) = AppListViewHolder(
|
||||
layoutInflater.inflate(
|
||||
R.layout.app_list_item,
|
||||
parent,
|
||||
false /* attachToParent */
|
||||
)
|
||||
)
|
||||
|
||||
override fun onBindViewHolder(holder: AppListViewHolder, position: Int) {
|
||||
val item = getItem(position)
|
||||
val pkg = item.packageName
|
||||
holder.label.setText(item.label)
|
||||
holder.packageName.setText(pkg)
|
||||
holder.label.text = item.label
|
||||
holder.packageName.text = item.packageName
|
||||
holder.icon.setImageDrawable(item.icon)
|
||||
holder.checkBox.setChecked(checkedList.contains(pkg))
|
||||
holder.checkBox.isChecked = checkedList.contains(item.packageName)
|
||||
holder.itemView.setOnClickListener {
|
||||
if (checkedList.contains(pkg)){
|
||||
checkedList.remove(pkg)
|
||||
onAppDeselected(pkg)
|
||||
if (checkedList.contains(item.packageName)) {
|
||||
checkedList.remove(item.packageName)
|
||||
appDeselectListener(item.packageName)
|
||||
} else {
|
||||
checkedList.add(pkg)
|
||||
onAppSelected(pkg)
|
||||
checkedList.add(item.packageName)
|
||||
appSelectListener(item.packageName)
|
||||
}
|
||||
notifyItemChanged(position)
|
||||
onListUpdate(checkedList.toList())
|
||||
listUpdateListener(checkedList.toList())
|
||||
}
|
||||
}
|
||||
|
||||
fun setOnAppSelectListener(listener: (String) -> Unit) {
|
||||
appSelectListener = listener
|
||||
}
|
||||
|
||||
fun setOnAppDeselectListener(listener: (String) -> Unit) {
|
||||
appDeselectListener = listener
|
||||
}
|
||||
|
||||
fun setOnListUpdateListener(listener: (List<String>) -> Unit) {
|
||||
listUpdateListener = listener
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val itemCallback = object : DiffUtil.ItemCallback<AppInfo>() {
|
||||
override fun areItemsTheSame(oldInfo: AppInfo, newInfo: AppInfo) =
|
||||
oldInfo.packageName == newInfo.packageName
|
||||
|
||||
override fun areContentsTheSame(oldInfo: AppInfo, newInfo: AppInfo) =
|
||||
oldInfo == newInfo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AppListViewHolder(itemView: View) :
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
private class AppListViewHolder(
|
||||
itemView: View
|
||||
) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
val icon: ImageView = itemView.findViewById(R.id.icon)
|
||||
val label: TextView = itemView.findViewById(R.id.label)
|
||||
val packageName: TextView = itemView.findViewById(R.id.packageName)
|
||||
val checkBox: CheckBox = itemView.findViewById(R.id.checkBox)
|
||||
val packageName: TextView = itemView.findViewById(R.id.package_name)
|
||||
val checkBox: CheckBox = itemView.findViewById(R.id.check_box)
|
||||
}
|
||||
|
||||
private data class AppInfo(
|
||||
@@ -300,18 +327,16 @@ abstract class AppListFragment: Fragment(R.layout.app_list_layout), MenuItem.OnA
|
||||
)
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AppListFragment"
|
||||
|
||||
const val CATEGORY_SYSTEM_ONLY = 0
|
||||
const val CATEGORY_USER_ONLY = 1
|
||||
const val CATEGORY_BOTH = 2
|
||||
|
||||
private val itemCallback = object : DiffUtil.ItemCallback<AppInfo>() {
|
||||
override fun areItemsTheSame(oldInfo: AppInfo, newInfo: AppInfo) =
|
||||
oldInfo.packageName == newInfo.packageName
|
||||
|
||||
override fun areContentsTheSame(oldInfo: AppInfo, newInfo: AppInfo) =
|
||||
oldInfo == newInfo
|
||||
}
|
||||
@IntDef(value = intArrayOf(
|
||||
CATEGORY_SYSTEM_ONLY,
|
||||
CATEGORY_USER_ONLY,
|
||||
CATEGORY_BOTH
|
||||
))
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class Category
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,38 +18,81 @@
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.Resources;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.os.Vibrator;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.internal.lineage.hardware.LineageHardwareManager;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.util.cherish.CherishUtils;
|
||||
import com.android.internal.util.hwkeys.ActionConstants;
|
||||
import com.android.internal.util.hwkeys.ActionUtils;
|
||||
import com.android.settings.R;
|
||||
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
|
||||
import com.cherish.settings.preferences.CustomSeekBarPreference;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.cherish.settings.preferences.ActionFragment;
|
||||
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class ButtonSettings extends SettingsPreferenceFragment implements
|
||||
public class ButtonSettings extends ActionFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String HWKEY_DISABLE = "hardware_keys_disable";
|
||||
private static final String NAVBAR_VISIBILITY = "navbar_visibility";
|
||||
private static final String KEY_NAVBAR_INVERSE = "navigation_bar_inverse";
|
||||
private static final String KEY_NAVIGATION_COMPACT_LAYOUT = "navigation_bar_compact_layout";
|
||||
private static final String KEY_SWAP_CAPACITIVE_KEYS = "swap_capacitive_keys";
|
||||
|
||||
// category keys
|
||||
private static final String CATEGORY_HWKEY = "hardware_keys";
|
||||
private static final String CATEGORY_BACK = "back_key";
|
||||
private static final String CATEGORY_HOME = "home_key";
|
||||
private static final String CATEGORY_MENU = "menu_key";
|
||||
private static final String CATEGORY_ASSIST = "assist_key";
|
||||
private static final String CATEGORY_APPSWITCH = "app_switch_key";
|
||||
private static final String CATEGORY_VOLUME = "volume_keys";
|
||||
private static final String CATEGORY_POWER = "power_key";
|
||||
|
||||
// Masks for checking presence of hardware keys.
|
||||
// Must match values in frameworks/base/core/res/res/values/config.xml
|
||||
public static final int KEY_MASK_HOME = 0x01;
|
||||
public static final int KEY_MASK_BACK = 0x02;
|
||||
public static final int KEY_MASK_MENU = 0x04;
|
||||
public static final int KEY_MASK_ASSIST = 0x08;
|
||||
public static final int KEY_MASK_APP_SWITCH = 0x10;
|
||||
public static final int KEY_MASK_CAMERA = 0x20;
|
||||
public static final int KEY_MASK_VOLUME = 0x40;
|
||||
|
||||
private PreferenceCategory mButtonBackLightCategory;
|
||||
private PreferenceCategory mHwKeyCategory;
|
||||
private SecureSettingSwitchPreference mSwapCapacitiveKeys;
|
||||
private SwitchPreference mHwKeyDisable;
|
||||
private SwitchPreference mNavbarVisibility;
|
||||
private SystemSettingSwitchPreference mNavbarInverse;
|
||||
private SystemSettingSwitchPreference mNavigationCompactLayout;
|
||||
|
||||
private boolean mIsNavSwitchingMode = false;
|
||||
private Handler mHandler;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -59,41 +102,157 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
|
||||
final Resources res = getResources();
|
||||
final ContentResolver resolver = getActivity().getContentResolver();
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
|
||||
mSwapCapacitiveKeys = findPreference(KEY_SWAP_CAPACITIVE_KEYS);
|
||||
if (mSwapCapacitiveKeys != null && !isKeySwapperSupported(getActivity())) {
|
||||
prefScreen.removePreference(mSwapCapacitiveKeys);
|
||||
mSwapCapacitiveKeys = null;
|
||||
}
|
||||
|
||||
final boolean needsNavbar = ActionUtils.hasNavbarByDefault(getActivity());
|
||||
mHwKeyCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_HWKEY);
|
||||
int keysDisabled = 0;
|
||||
if (!needsNavbar) {
|
||||
mHwKeyDisable = (SwitchPreference) findPreference(HWKEY_DISABLE);
|
||||
keysDisabled = Settings.System.getIntForUser(getContentResolver(),
|
||||
Settings.System.HARDWARE_KEYS_DISABLE, 0,
|
||||
UserHandle.USER_CURRENT);
|
||||
mHwKeyDisable.setChecked(keysDisabled != 0);
|
||||
mHwKeyDisable.setOnPreferenceChangeListener(this);
|
||||
} else {
|
||||
prefScreen.removePreference(mHwKeyCategory);
|
||||
}
|
||||
|
||||
// bits for hardware keys present on device
|
||||
final int deviceKeys = getResources().getInteger(
|
||||
com.android.internal.R.integer.config_deviceHardwareKeys);
|
||||
// read bits for present hardware keys
|
||||
final boolean hasHomeKey = (deviceKeys & KEY_MASK_HOME) != 0;
|
||||
final boolean hasBackKey = (deviceKeys & KEY_MASK_BACK) != 0;
|
||||
final boolean hasMenuKey = (deviceKeys & KEY_MASK_MENU) != 0;
|
||||
final boolean hasAssistKey = (deviceKeys & KEY_MASK_ASSIST) != 0;
|
||||
final boolean hasAppSwitchKey = (deviceKeys & KEY_MASK_APP_SWITCH) != 0;
|
||||
// load categories and init/remove preferences based on device
|
||||
// configuration
|
||||
final PreferenceCategory backCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_BACK);
|
||||
final PreferenceCategory homeCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_HOME);
|
||||
final PreferenceCategory menuCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_MENU);
|
||||
final PreferenceCategory assistCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_ASSIST);
|
||||
final PreferenceCategory appSwitchCategory = (PreferenceCategory) prefScreen
|
||||
.findPreference(CATEGORY_APPSWITCH);
|
||||
// back key
|
||||
if (!hasBackKey) {
|
||||
prefScreen.removePreference(backCategory);
|
||||
}
|
||||
// home key
|
||||
if (!hasHomeKey) {
|
||||
prefScreen.removePreference(homeCategory);
|
||||
}
|
||||
// App switch key (recents)
|
||||
if (!hasAppSwitchKey) {
|
||||
prefScreen.removePreference(appSwitchCategory);
|
||||
}
|
||||
// menu key
|
||||
if (!hasMenuKey) {
|
||||
prefScreen.removePreference(menuCategory);
|
||||
}
|
||||
// search/assist key
|
||||
if (!hasAssistKey) {
|
||||
prefScreen.removePreference(assistCategory);
|
||||
}
|
||||
// let super know we can load ActionPreferences
|
||||
onPreferenceScreenLoaded(ActionConstants.getDefaults(ActionConstants.HWKEYS));
|
||||
|
||||
// load preferences first
|
||||
setActionPreferencesEnabled(keysDisabled == 0);
|
||||
|
||||
final boolean isThreeButtonNavbarEnabled = CherishUtils.isThemeEnabled("com.android.internal.systemui.navbar.threebutton");
|
||||
mNavbarInverse = (SystemSettingSwitchPreference) findPreference(KEY_NAVBAR_INVERSE);
|
||||
mNavbarInverse.setEnabled(isThreeButtonNavbarEnabled);
|
||||
mNavigationCompactLayout = (SystemSettingSwitchPreference) findPreference(KEY_NAVIGATION_COMPACT_LAYOUT);
|
||||
mNavigationCompactLayout.setEnabled(isThreeButtonNavbarEnabled);
|
||||
|
||||
mNavbarVisibility = (SwitchPreference) findPreference(NAVBAR_VISIBILITY);
|
||||
|
||||
boolean showing = Settings.System.getIntForUser(resolver,
|
||||
Settings.System.FORCE_SHOW_NAVBAR,
|
||||
ActionUtils.hasNavbarByDefault(getActivity()) ? 1 : 0, UserHandle.USER_CURRENT) != 0;
|
||||
mNavbarVisibility.setChecked(showing);
|
||||
mNavbarVisibility.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
private static boolean isKeyDisablerSupported(Context context) {
|
||||
final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
|
||||
return hardware.isSupported(LineageHardwareManager.FEATURE_KEY_DISABLE);
|
||||
}
|
||||
|
||||
private static boolean isKeySwapperSupported(Context context) {
|
||||
final LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
|
||||
return hardware.isSupported(LineageHardwareManager.FEATURE_KEY_SWAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mHwKeyDisable) {
|
||||
boolean value = (Boolean) newValue;
|
||||
Settings.System.putInt(getContentResolver(), Settings.System.HARDWARE_KEYS_DISABLE,
|
||||
value ? 1 : 0);
|
||||
setActionPreferencesEnabled(!value);
|
||||
return true;
|
||||
} else if (preference == mNavbarVisibility) {
|
||||
if (mIsNavSwitchingMode) {
|
||||
return false;
|
||||
}
|
||||
mIsNavSwitchingMode = true;
|
||||
boolean showing = ((Boolean)newValue);
|
||||
Settings.System.putIntForUser(resolver, Settings.System.FORCE_SHOW_NAVBAR,
|
||||
showing ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
mNavbarVisibility.setChecked(showing);
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mIsNavSwitchingMode = false;
|
||||
}
|
||||
}, 1500);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
|
||||
boolean enabled) {
|
||||
ArrayList<SearchIndexableResource> result =
|
||||
new ArrayList<SearchIndexableResource>();
|
||||
SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.cherish_settings_button;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_button) {
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
||||
LineageHardwareManager mLineageHardware = LineageHardwareManager.getInstance(context);
|
||||
|
||||
if (!isKeyDisablerSupported(context)) {
|
||||
keys.add(HWKEY_DISABLE);
|
||||
keys.add(CATEGORY_HWKEY);
|
||||
keys.add(CATEGORY_BACK);
|
||||
keys.add(CATEGORY_HOME);
|
||||
keys.add(CATEGORY_MENU);
|
||||
keys.add(CATEGORY_ASSIST);
|
||||
keys.add(CATEGORY_APPSWITCH);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.fragment
|
||||
package com.cherish.settings.fragments
|
||||
|
||||
import androidx.preference.Preference
|
||||
|
||||
|
||||
229
src/com/cherish/settings/fragments/Clock.java
Normal file
229
src/com/cherish/settings/fragments/Clock.java
Normal file
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 The CherishOS 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.text.format.DateFormat;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import com.cherish.settings.fragments.Clock;
|
||||
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingSeekBarPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class Clock extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String TAG = "Clock";
|
||||
|
||||
private static final String STATUS_BAR_AM_PM = "status_bar_am_pm";
|
||||
private static final String CLOCK_DATE_DISPLAY = "status_bar_clock_date_display";
|
||||
private static final String CLOCK_DATE_POSITION = "status_bar_clock_date_position";
|
||||
private static final String CLOCK_DATE_STYLE = "status_bar_clock_date_style";
|
||||
private static final String CLOCK_DATE_FORMAT = "status_bar_clock_date_format";
|
||||
|
||||
private static final int CLOCK_DATE_STYLE_LOWERCASE = 1;
|
||||
private static final int CLOCK_DATE_STYLE_UPPERCASE = 2;
|
||||
private static final int CUSTOM_CLOCK_DATE_FORMAT_INDEX = 18;
|
||||
|
||||
private SystemSettingListPreference mStatusBarAmPm;
|
||||
private SystemSettingListPreference mClockDateDisplay;
|
||||
private SystemSettingListPreference mClockDatePosition;
|
||||
private SystemSettingListPreference mClockDateStyle;
|
||||
private ListPreference mClockDateFormat;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.cherish_settings_status_bar_clock);
|
||||
|
||||
final ContentResolver resolver = getActivity().getContentResolver();
|
||||
final Context mContext = getActivity().getApplicationContext();
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
|
||||
mStatusBarAmPm =
|
||||
(SystemSettingListPreference) findPreference(STATUS_BAR_AM_PM);
|
||||
|
||||
if (DateFormat.is24HourFormat(getActivity())) {
|
||||
mStatusBarAmPm.setEnabled(false);
|
||||
mStatusBarAmPm.setSummary(R.string.status_bar_am_pm_info);
|
||||
}
|
||||
|
||||
int dateDisplay = Settings.System.getIntForUser(resolver,
|
||||
Settings.System.STATUS_BAR_CLOCK_DATE_DISPLAY, 0, UserHandle.USER_CURRENT);
|
||||
|
||||
mClockDateDisplay = (SystemSettingListPreference) findPreference(CLOCK_DATE_DISPLAY);
|
||||
mClockDateDisplay.setOnPreferenceChangeListener(this);
|
||||
|
||||
mClockDatePosition = (SystemSettingListPreference) findPreference(CLOCK_DATE_POSITION);
|
||||
mClockDatePosition.setEnabled(dateDisplay > 0);
|
||||
mClockDatePosition.setOnPreferenceChangeListener(this);
|
||||
|
||||
mClockDateStyle = (SystemSettingListPreference) findPreference(CLOCK_DATE_STYLE);
|
||||
mClockDateStyle.setEnabled(dateDisplay > 0);
|
||||
mClockDateStyle.setOnPreferenceChangeListener(this);
|
||||
|
||||
mClockDateFormat = (ListPreference) findPreference(CLOCK_DATE_FORMAT);
|
||||
if (mClockDateFormat.getValue() == null) {
|
||||
mClockDateFormat.setValue("EEE");
|
||||
}
|
||||
parseClockDateFormats();
|
||||
mClockDateFormat.setEnabled(dateDisplay > 0);
|
||||
mClockDateFormat.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
AlertDialog dialog;
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mClockDateDisplay) {
|
||||
int val = Integer.parseInt((String) newValue);
|
||||
if (val == 0) {
|
||||
mClockDatePosition.setEnabled(false);
|
||||
mClockDateStyle.setEnabled(false);
|
||||
mClockDateFormat.setEnabled(false);
|
||||
} else {
|
||||
mClockDatePosition.setEnabled(true);
|
||||
mClockDateStyle.setEnabled(true);
|
||||
mClockDateFormat.setEnabled(true);
|
||||
}
|
||||
return true;
|
||||
} else if (preference == mClockDatePosition) {
|
||||
parseClockDateFormats();
|
||||
return true;
|
||||
} else if (preference == mClockDateStyle) {
|
||||
parseClockDateFormats();
|
||||
return true;
|
||||
} else if (preference == mClockDateFormat) {
|
||||
int index = mClockDateFormat.findIndexOfValue((String) newValue);
|
||||
|
||||
if (index == CUSTOM_CLOCK_DATE_FORMAT_INDEX) {
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
|
||||
alert.setTitle(R.string.status_bar_date_string_edittext_title);
|
||||
alert.setMessage(R.string.status_bar_date_string_edittext_summary);
|
||||
|
||||
final EditText input = new EditText(getActivity());
|
||||
String oldText = Settings.System.getString(
|
||||
resolver,
|
||||
Settings.System.STATUS_BAR_CLOCK_DATE_FORMAT);
|
||||
if (oldText != null) {
|
||||
input.setText(oldText);
|
||||
}
|
||||
alert.setView(input);
|
||||
|
||||
alert.setPositiveButton(R.string.menu_save, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialogInterface, int whichButton) {
|
||||
String value = input.getText().toString();
|
||||
if (value.equals("")) {
|
||||
return;
|
||||
}
|
||||
Settings.System.putString(resolver,
|
||||
Settings.System.STATUS_BAR_CLOCK_DATE_FORMAT, value);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
alert.setNegativeButton(R.string.menu_cancel,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialogInterface, int which) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
dialog = alert.create();
|
||||
dialog.show();
|
||||
} else {
|
||||
if ((String) newValue != null) {
|
||||
Settings.System.putString(resolver,
|
||||
Settings.System.STATUS_BAR_CLOCK_DATE_FORMAT, (String) newValue);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void parseClockDateFormats() {
|
||||
String[] dateEntries = getResources().getStringArray(
|
||||
R.array.status_bar_date_format_entries_values);
|
||||
CharSequence parsedDateEntries[];
|
||||
parsedDateEntries = new String[dateEntries.length];
|
||||
Date now = new Date();
|
||||
|
||||
int lastEntry = dateEntries.length - 1;
|
||||
int dateFormat = Settings.System.getIntForUser(getActivity()
|
||||
.getContentResolver(), Settings.System.STATUS_BAR_CLOCK_DATE_STYLE, 0, UserHandle.USER_CURRENT);
|
||||
for (int i = 0; i < dateEntries.length; i++) {
|
||||
if (i == lastEntry) {
|
||||
parsedDateEntries[i] = dateEntries[i];
|
||||
} else {
|
||||
String newDate;
|
||||
CharSequence dateString = DateFormat.format(dateEntries[i], now);
|
||||
if (dateFormat == CLOCK_DATE_STYLE_LOWERCASE) {
|
||||
newDate = dateString.toString().toLowerCase();
|
||||
} else if (dateFormat == CLOCK_DATE_STYLE_UPPERCASE) {
|
||||
newDate = dateString.toString().toUpperCase();
|
||||
} else {
|
||||
newDate = dateString.toString();
|
||||
}
|
||||
|
||||
parsedDateEntries[i] = newDate;
|
||||
}
|
||||
}
|
||||
mClockDateFormat.setEntries(parsedDateEntries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_status_bar_clock);
|
||||
}
|
||||
71
src/com/cherish/settings/fragments/EdgeLightSettings.java
Normal file
71
src/com/cherish/settings/fragments/EdgeLightSettings.java
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 The CherishOS Projects
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class EdgeLightSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.cherish_settings_edge_light);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_edge_light);
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.internal.util.cherish.udfps.UdfpsUtils;
|
||||
import com.android.internal.util.cherish.CherishUtils;
|
||||
import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
import com.cherish.settings.preferences.CustomSeekBarPreference;
|
||||
@@ -50,22 +51,53 @@ import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Collections;
|
||||
import java.io.FileDescriptor;
|
||||
import java.util.Arrays;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import static android.os.UserHandle.USER_SYSTEM;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import static android.os.UserHandle.USER_CURRENT;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class LockScreenSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String AOD_SCHEDULE_KEY = "always_on_display_schedule";
|
||||
private static final String CUSTOM_CLOCK_FACE = Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE;
|
||||
private static final String DEFAULT_CLOCK = "com.android.keyguard.clock.DefaultClockController";
|
||||
private static final String UDFPS_CATEGORY = "udfps_category";
|
||||
private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture";
|
||||
private static final String KG_CUSTOM_CLOCK_COLOR_ENABLED = "kg_custom_clock_color_enabled";
|
||||
|
||||
static final int MODE_DISABLED = 0;
|
||||
static final int MODE_NIGHT = 1;
|
||||
static final int MODE_TIME = 2;
|
||||
static final int MODE_MIXED_SUNSET = 3;
|
||||
static final int MODE_MIXED_SUNRISE = 4;
|
||||
|
||||
private ListPreference mLockClockStyles;
|
||||
private PreferenceCategory mUdfpsCategory;
|
||||
private Context mContext;
|
||||
private ListPreference mTorchPowerButton;
|
||||
private SwitchPreference mKGCustomClockColor;
|
||||
|
||||
Preference mAODPref;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.cherish_settings_lockscreen);
|
||||
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
Resources resources = getResources();
|
||||
final ContentResolver resolver = getActivity().getContentResolver();
|
||||
final PreferenceScreen prefSet = getPreferenceScreen();
|
||||
|
||||
Resources res = null;
|
||||
Context ctx = getContext();
|
||||
@@ -76,17 +108,113 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mUdfpsCategory = findPreference(UDFPS_CATEGORY);
|
||||
if (!UdfpsUtils.hasUdfpsSupport(getContext())) {
|
||||
prefSet.removePreference(mUdfpsCategory);
|
||||
}
|
||||
|
||||
mAODPref = findPreference(AOD_SCHEDULE_KEY);
|
||||
updateAlwaysOnSummary();
|
||||
|
||||
mLockClockStyles = (ListPreference) findPreference(CUSTOM_CLOCK_FACE);
|
||||
String mLockClockStylesValue = getLockScreenCustomClockFace();
|
||||
mLockClockStyles.setValue(mLockClockStylesValue);
|
||||
mLockClockStyles.setSummary(mLockClockStyles.getEntry());
|
||||
mLockClockStyles.setOnPreferenceChangeListener(this);
|
||||
mKGCustomClockColor = (SwitchPreference) findPreference(KG_CUSTOM_CLOCK_COLOR_ENABLED);
|
||||
boolean mKGCustomClockColorEnabled = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.KG_CUSTOM_CLOCK_COLOR_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
mKGCustomClockColor.setChecked(mKGCustomClockColorEnabled);
|
||||
mKGCustomClockColor.setOnPreferenceChangeListener(this);
|
||||
|
||||
// screen off torch
|
||||
mTorchPowerButton = (ListPreference) findPreference(TORCH_POWER_BUTTON_GESTURE);
|
||||
int mTorchPowerButtonValue = Settings.System.getInt(resolver,
|
||||
Settings.System.TORCH_POWER_BUTTON_GESTURE, 0);
|
||||
mTorchPowerButton.setValue(Integer.toString(mTorchPowerButtonValue));
|
||||
mTorchPowerButton.setSummary(mTorchPowerButton.getEntry());
|
||||
mTorchPowerButton.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateAlwaysOnSummary();
|
||||
}
|
||||
|
||||
private void updateAlwaysOnSummary() {
|
||||
if (mAODPref == null) return;
|
||||
int mode = Settings.Secure.getIntForUser(getActivity().getContentResolver(),
|
||||
Settings.Secure.DOZE_ALWAYS_ON_AUTO_MODE, 0, UserHandle.USER_CURRENT);
|
||||
switch (mode) {
|
||||
default:
|
||||
case MODE_DISABLED:
|
||||
mAODPref.setSummary(R.string.disabled);
|
||||
break;
|
||||
case MODE_NIGHT:
|
||||
mAODPref.setSummary(R.string.night_display_auto_mode_twilight);
|
||||
break;
|
||||
case MODE_TIME:
|
||||
mAODPref.setSummary(R.string.night_display_auto_mode_custom);
|
||||
break;
|
||||
case MODE_MIXED_SUNSET:
|
||||
mAODPref.setSummary(R.string.always_on_display_schedule_mixed_sunset);
|
||||
break;
|
||||
case MODE_MIXED_SUNRISE:
|
||||
mAODPref.setSummary(R.string.always_on_display_schedule_mixed_sunrise);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mLockClockStyles) {
|
||||
setLockScreenCustomClockFace((String) newValue);
|
||||
int index = mLockClockStyles.findIndexOfValue((String) newValue);
|
||||
mLockClockStyles.setSummary(mLockClockStyles.getEntries()[index]);
|
||||
return true;
|
||||
} else if (preference == mTorchPowerButton) {
|
||||
int mTorchPowerButtonValue = Integer.valueOf((String) newValue);
|
||||
int index = mTorchPowerButton.findIndexOfValue((String) newValue);
|
||||
mTorchPowerButton.setSummary(
|
||||
mTorchPowerButton.getEntries()[index]);
|
||||
Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE,
|
||||
mTorchPowerButtonValue);
|
||||
return true;
|
||||
} else if (preference == mKGCustomClockColor) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.KG_CUSTOM_CLOCK_COLOR_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getLockScreenCustomClockFace() {
|
||||
mContext = getActivity();
|
||||
String value = Settings.Secure.getStringForUser(mContext.getContentResolver(),
|
||||
CUSTOM_CLOCK_FACE, USER_CURRENT);
|
||||
|
||||
if (value == null || value.isEmpty()) value = DEFAULT_CLOCK;
|
||||
|
||||
try {
|
||||
JSONObject json = new JSONObject(value);
|
||||
return json.getString("clock");
|
||||
} catch (JSONException ex) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private void setLockScreenCustomClockFace(String value) {
|
||||
try {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("clock", value);
|
||||
Settings.Secure.putStringForUser(mContext.getContentResolver(), CUSTOM_CLOCK_FACE,
|
||||
json.toString(), USER_CURRENT);
|
||||
} catch (JSONException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.UserHandle;
|
||||
import android.os.SystemProperties;
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.Resources;
|
||||
@@ -31,19 +32,37 @@ import java.util.HashSet;
|
||||
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingEditTextPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingMasterSwitchPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.development.SystemPropPoker;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.cherish.settings.fragments.SmartCharging;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
@SearchIndexable
|
||||
public class MiscSettings extends SettingsPreferenceFragment implements
|
||||
OnPreferenceChangeListener {
|
||||
private static final String KEY_GAMES_SPOOF = "use_games_spoof";
|
||||
private static final String KEY_PHOTOS_SPOOF = "use_photos_spoof";
|
||||
private static final String KEY_NETFLIX_SPOOF = "use_netflix_spoof";
|
||||
|
||||
private static final String SYS_GAMES_SPOOF = "persist.sys.pixelprops.games";
|
||||
private static final String SYS_PHOTOS_SPOOF = "persist.sys.pixelprops.gphotos";
|
||||
private static final String SYS_NETFLIX_SPOOF = "persist.sys.spoof_netflix";
|
||||
|
||||
private static final String SMART_CHARGING = "smart_charging";
|
||||
|
||||
private SwitchPreference mGamesSpoof;
|
||||
private SwitchPreference mPhotosSpoof;
|
||||
private Preference mSmartCharging;
|
||||
private SwitchPreference mNetFlixSpoof;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
@@ -51,21 +70,48 @@ public class MiscSettings extends SettingsPreferenceFragment implements
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
|
||||
addPreferencesFromResource(R.xml.cherish_settings_misc);
|
||||
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
final Resources res = getResources();
|
||||
|
||||
Resources res = null;
|
||||
Context ctx = getContext();
|
||||
float density = Resources.getSystem().getDisplayMetrics().density;
|
||||
mGamesSpoof = (SwitchPreference) findPreference(KEY_GAMES_SPOOF);
|
||||
mGamesSpoof.setChecked(SystemProperties.getBoolean(SYS_GAMES_SPOOF, false));
|
||||
mGamesSpoof.setOnPreferenceChangeListener(this);
|
||||
|
||||
mPhotosSpoof = (SwitchPreference) findPreference(KEY_PHOTOS_SPOOF);
|
||||
mPhotosSpoof.setChecked(SystemProperties.getBoolean(SYS_PHOTOS_SPOOF, true));
|
||||
mPhotosSpoof.setOnPreferenceChangeListener(this);
|
||||
|
||||
try {
|
||||
res = ctx.getPackageManager().getResourcesForApplication("com.android.systemui");
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mNetFlixSpoof = (SwitchPreference) findPreference(KEY_NETFLIX_SPOOF);
|
||||
mNetFlixSpoof.setChecked(SystemProperties.getBoolean(SYS_NETFLIX_SPOOF, false));
|
||||
mNetFlixSpoof.setOnPreferenceChangeListener(this);
|
||||
|
||||
mSmartCharging = (Preference) prefScreen.findPreference(SMART_CHARGING);
|
||||
boolean mSmartChargingSupported = res.getBoolean(
|
||||
com.android.internal.R.bool.config_smartChargingAvailable);
|
||||
if (!mSmartChargingSupported)
|
||||
prefScreen.removePreference(mSmartCharging);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (preference == mGamesSpoof) {
|
||||
boolean value = (Boolean) newValue;
|
||||
SystemProperties.set(SYS_GAMES_SPOOF, value ? "true" : "false");
|
||||
SystemPropPoker.getInstance().poke();
|
||||
return true;
|
||||
} else if (preference == mPhotosSpoof) {
|
||||
boolean value = (Boolean) newValue;
|
||||
SystemProperties.set(SYS_PHOTOS_SPOOF, value ? "true" : "false");
|
||||
SystemPropPoker.getInstance().poke();
|
||||
return true;
|
||||
} else if (preference == mNetFlixSpoof) {
|
||||
boolean value = (Boolean) newValue;
|
||||
SystemProperties.set(SYS_NETFLIX_SPOOF, value ? "true" : "false");
|
||||
SystemPropPoker.getInstance().poke();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,29 +120,19 @@ public class MiscSettings extends SettingsPreferenceFragment implements
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
|
||||
boolean enabled) {
|
||||
ArrayList<SearchIndexableResource> result =
|
||||
new ArrayList<SearchIndexableResource>();
|
||||
SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.cherish_settings_misc;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_misc) {
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
||||
boolean mSmartChargingSupported = context.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_smartChargingAvailable);
|
||||
if (!mSmartChargingSupported)
|
||||
keys.add(SMART_CHARGING);
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +38,14 @@ import java.util.List;
|
||||
public class NotificationSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener{
|
||||
|
||||
private static final String INCALL_VIB_OPTIONS = "incall_vib_options";
|
||||
private Preference mChargingLeds;
|
||||
private static final String ALERT_SLIDER_PREF = "alert_slider_notifications";
|
||||
|
||||
private static final String NEW_RETICKER = "new_reticker";
|
||||
private static final String NEW_RETICKER_ANIMATION = "new_reticker_animation";
|
||||
|
||||
private Preference mChargingLeds;
|
||||
private Preference mAlertSlider;
|
||||
private SystemSettingSwitchPreference mNewReticker, mNewRetickerAnimation;
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
@@ -47,7 +54,13 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
final Resources res = getResources();
|
||||
|
||||
|
||||
mAlertSlider = (Preference) prefScreen.findPreference(ALERT_SLIDER_PREF);
|
||||
boolean mAlertSliderAvailable = res.getBoolean(
|
||||
com.android.internal.R.bool.config_hasAlertSlider);
|
||||
if (!mAlertSliderAvailable)
|
||||
prefScreen.removePreference(mAlertSlider);
|
||||
|
||||
mChargingLeds = (Preference) findPreference("charging_light");
|
||||
if (mChargingLeds != null
|
||||
&& !getResources().getBoolean(
|
||||
@@ -59,11 +72,20 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
if (!CherishUtils.isVoiceCapable(getActivity())) {
|
||||
prefScreen.removePreference(incallVibCategory);
|
||||
}
|
||||
|
||||
mNewReticker = (SystemSettingSwitchPreference) findPreference(NEW_RETICKER);
|
||||
mNewReticker.setOnPreferenceChangeListener(this);
|
||||
mNewRetickerAnimation = (SystemSettingSwitchPreference) findPreference(NEW_RETICKER_ANIMATION);
|
||||
mNewRetickerAnimation.setOnPreferenceChangeListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (preference == mNewReticker || preference == mNewRetickerAnimation) {
|
||||
CherishUtils.showSystemUiRestartDialog(getActivity());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,6 +116,10 @@ public class NotificationSettings extends SettingsPreferenceFragment implements
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
final Resources res = context.getResources();
|
||||
boolean mAlertSliderAvailable = res.getBoolean(
|
||||
com.android.internal.R.bool.config_hasAlertSlider);
|
||||
if (!mAlertSliderAvailable)
|
||||
keys.add(ALERT_SLIDER_PREF);
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
|
||||
189
src/com/cherish/settings/fragments/OmniJawsSettings.java
Normal file
189
src/com/cherish/settings/fragments/OmniJawsSettings.java
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The OmniROM Project
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class OmniJawsSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener, Indexable {
|
||||
private static final String TAG = "OmniJawsSettings";
|
||||
private static final String CATEGORY_WEATHER = "weather_category";
|
||||
private static final String WEATHER_ICON_PACK = "weather_icon_pack";
|
||||
private static final String DEFAULT_WEATHER_ICON_PACKAGE = "org.omnirom.omnijaws";
|
||||
private static final String DEFAULT_WEATHER_ICON_PREFIX = "outline";
|
||||
private static final String WEATHER_SERVICE_PACKAGE = "org.omnirom.omnijaws";
|
||||
private static final String CHRONUS_ICON_PACK_INTENT = "com.dvtonder.chronus.ICON_PACK";
|
||||
|
||||
private PreferenceCategory mWeatherCategory;
|
||||
private ListPreference mWeatherIconPack;
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.omnijaws_settings);
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
|
||||
mWeatherCategory = (PreferenceCategory) prefScreen.findPreference(CATEGORY_WEATHER);
|
||||
if (mWeatherCategory != null) {
|
||||
prefScreen.removePreference(mWeatherCategory);
|
||||
} else {
|
||||
String settingHeaderPackage = Settings.System.getString(getContentResolver(),
|
||||
Settings.System.OMNIJAWS_WEATHER_ICON_PACK);
|
||||
if (settingHeaderPackage == null) {
|
||||
settingHeaderPackage = DEFAULT_WEATHER_ICON_PACKAGE + "." + DEFAULT_WEATHER_ICON_PREFIX;
|
||||
}
|
||||
mWeatherIconPack = (ListPreference) findPreference(WEATHER_ICON_PACK);
|
||||
|
||||
List<String> entries = new ArrayList<String>();
|
||||
List<String> values = new ArrayList<String>();
|
||||
getAvailableWeatherIconPacks(entries, values);
|
||||
mWeatherIconPack.setEntries(entries.toArray(new String[entries.size()]));
|
||||
mWeatherIconPack.setEntryValues(values.toArray(new String[values.size()]));
|
||||
|
||||
int valueIndex = mWeatherIconPack.findIndexOfValue(settingHeaderPackage);
|
||||
if (valueIndex == -1) {
|
||||
// no longer found
|
||||
settingHeaderPackage = DEFAULT_WEATHER_ICON_PACKAGE + "." + DEFAULT_WEATHER_ICON_PREFIX;
|
||||
Settings.System.putString(getContentResolver(),
|
||||
Settings.System.OMNIJAWS_WEATHER_ICON_PACK, settingHeaderPackage);
|
||||
valueIndex = mWeatherIconPack.findIndexOfValue(settingHeaderPackage);
|
||||
}
|
||||
mWeatherIconPack.setValueIndex(valueIndex >= 0 ? valueIndex : 0);
|
||||
mWeatherIconPack.setSummary(mWeatherIconPack.getEntry());
|
||||
mWeatherIconPack.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||
if (preference == mWeatherIconPack) {
|
||||
String value = (String) objValue;
|
||||
Settings.System.putString(getContentResolver(),
|
||||
Settings.System.OMNIJAWS_WEATHER_ICON_PACK, value);
|
||||
int valueIndex = mWeatherIconPack.findIndexOfValue(value);
|
||||
mWeatherIconPack.setSummary(mWeatherIconPack.getEntries()[valueIndex]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void getAvailableWeatherIconPacks(List<String> entries, List<String> values) {
|
||||
Intent i = new Intent();
|
||||
PackageManager packageManager = getPackageManager();
|
||||
i.setAction("org.omnirom.WeatherIconPack");
|
||||
for (ResolveInfo r : packageManager.queryIntentActivities(i, 0)) {
|
||||
String packageName = r.activityInfo.packageName;
|
||||
if (packageName.equals(DEFAULT_WEATHER_ICON_PACKAGE)) {
|
||||
values.add(0, r.activityInfo.name);
|
||||
} else {
|
||||
values.add(r.activityInfo.name);
|
||||
}
|
||||
String label = r.activityInfo.loadLabel(getPackageManager()).toString();
|
||||
if (label == null) {
|
||||
label = r.activityInfo.packageName;
|
||||
}
|
||||
if (packageName.equals(DEFAULT_WEATHER_ICON_PACKAGE)) {
|
||||
entries.add(0, label);
|
||||
} else {
|
||||
entries.add(label);
|
||||
}
|
||||
}
|
||||
i = new Intent(Intent.ACTION_MAIN);
|
||||
i.addCategory(CHRONUS_ICON_PACK_INTENT);
|
||||
for (ResolveInfo r : packageManager.queryIntentActivities(i, 0)) {
|
||||
String packageName = r.activityInfo.packageName;
|
||||
values.add(packageName + ".weather");
|
||||
String label = r.activityInfo.loadLabel(getPackageManager()).toString();
|
||||
if (label == null) {
|
||||
label = r.activityInfo.packageName;
|
||||
}
|
||||
entries.add(label);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOmniJawsEnabled() {
|
||||
final Uri SETTINGS_URI
|
||||
= Uri.parse("content://org.omnirom.omnijaws.provider/settings");
|
||||
|
||||
final String[] SETTINGS_PROJECTION = new String[] {
|
||||
"enabled"
|
||||
};
|
||||
|
||||
final Cursor c = getContentResolver().query(SETTINGS_URI, SETTINGS_PROJECTION,
|
||||
null, null, null);
|
||||
if (c != null) {
|
||||
int count = c.getCount();
|
||||
if (count == 1) {
|
||||
c.moveToPosition(0);
|
||||
boolean enabled = c.getInt(0) == 1;
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
|
||||
boolean enabled) {
|
||||
ArrayList<SearchIndexableResource> result =
|
||||
new ArrayList<SearchIndexableResource>();
|
||||
|
||||
SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.omnijaws_settings;
|
||||
result.add(sir);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
68
src/com/cherish/settings/fragments/SmartCharging.java
Normal file
68
src/com/cherish/settings/fragments/SmartCharging.java
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 The CherishOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
public class SmartCharging extends SettingsPreferenceFragment {
|
||||
|
||||
private static final String TAG = "SmartCharging";
|
||||
private static final String SMART_CHARGING_FOOTER = "smart_charging_footer";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
addPreferencesFromResource(R.xml.smart_charging);
|
||||
|
||||
findPreference(SMART_CHARGING_FOOTER).setTitle(R.string.smart_charging_footer);
|
||||
}
|
||||
|
||||
public static void reset(Context mContext) {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
Settings.System.putIntForUser(resolver,
|
||||
Settings.System.SMART_CHARGING, 0, UserHandle.USER_CURRENT);
|
||||
Settings.System.putIntForUser(resolver,
|
||||
Settings.System.SMART_CHARGING_RESET_STATS, 0, UserHandle.USER_CURRENT);
|
||||
Settings.System.putIntForUser(resolver,
|
||||
Settings.System.SMART_CHARGING_LEVEL, 80, UserHandle.USER_CURRENT);
|
||||
Settings.System.putIntForUser(resolver,
|
||||
Settings.System.SMART_CHARGING_RESUME_LEVEL, 60, UserHandle.USER_CURRENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cherish.settings.fragments;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import static android.os.UserHandle.USER_SYSTEM;
|
||||
import static android.os.UserHandle.USER_CURRENT;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
@@ -59,7 +60,9 @@ import android.provider.SearchIndexableResource;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
import android.database.ContentObserver;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import com.android.internal.util.cherish.CherishUtils;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.cherish.settings.preferences.SystemSettingListPreference;
|
||||
@@ -68,14 +71,27 @@ import net.margaritov.preference.colorpicker.ColorPickerPreference;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class ThemeSettings extends DashboardFragment implements OnPreferenceChangeListener {
|
||||
|
||||
private static final String ALT_SETTINGS_LAYOUT = "alt_settings_layout";
|
||||
private static final String SETTINGS_DASHBOARD_STYLE = "settings_dashboard_style";
|
||||
private static final String USE_STOCK_LAYOUT = "use_stock_layout";
|
||||
private static final String DISABLE_USERCARD = "disable_usercard";
|
||||
private static final String QS_PANEL_STYLE = "qs_panel_style";
|
||||
|
||||
public static final String TAG = "ThemeSettings";
|
||||
static final int DEFAULT_QS_PANEL_COLOR = 0xffffffff;
|
||||
static final int DEFAULT = 0xff1a73e8;
|
||||
private Context mContext;
|
||||
|
||||
private Handler mHandler;
|
||||
private IOverlayManager mOverlayManager;
|
||||
private IOverlayManager mOverlayService;
|
||||
private SystemSettingListPreference mQsStyle;
|
||||
private UiModeManager mUiModeManager;
|
||||
private SystemSettingListPreference mSettingsDashBoardStyle;
|
||||
private SystemSettingSwitchPreference mAltSettingsLayout;
|
||||
private SystemSettingSwitchPreference mUseStockLayout;
|
||||
private SystemSettingSwitchPreference mDisableUserCard;
|
||||
|
||||
@Override
|
||||
protected String getLogTag() {
|
||||
@@ -105,19 +121,120 @@ public class ThemeSettings extends DashboardFragment implements OnPreferenceChan
|
||||
|
||||
PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
final Resources res = getResources();
|
||||
mContext = getActivity();
|
||||
final Resources res = getResources();
|
||||
mContext = getActivity();
|
||||
|
||||
mSettingsDashBoardStyle = (SystemSettingListPreference) findPreference(SETTINGS_DASHBOARD_STYLE);
|
||||
mSettingsDashBoardStyle.setOnPreferenceChangeListener(this);
|
||||
mAltSettingsLayout = (SystemSettingSwitchPreference) findPreference(ALT_SETTINGS_LAYOUT);
|
||||
mAltSettingsLayout.setOnPreferenceChangeListener(this);
|
||||
mUseStockLayout = (SystemSettingSwitchPreference) findPreference(USE_STOCK_LAYOUT);
|
||||
mUseStockLayout.setOnPreferenceChangeListener(this);
|
||||
mDisableUserCard = (SystemSettingSwitchPreference) findPreference(DISABLE_USERCARD);
|
||||
mDisableUserCard.setOnPreferenceChangeListener(this);
|
||||
|
||||
mOverlayService = IOverlayManager.Stub
|
||||
.asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE));
|
||||
|
||||
mQsStyle = (SystemSettingListPreference) findPreference(QS_PANEL_STYLE);
|
||||
mCustomSettingsObserver.observe();
|
||||
}
|
||||
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private CustomSettingsObserver mCustomSettingsObserver = new CustomSettingsObserver(mHandler);
|
||||
private class CustomSettingsObserver extends ContentObserver {
|
||||
|
||||
CustomSettingsObserver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
void observe() {
|
||||
Context mContext = getContext();
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
resolver.registerContentObserver(Settings.System.getUriFor(
|
||||
Settings.System.QS_PANEL_STYLE),
|
||||
false, this, UserHandle.USER_ALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChange(boolean selfChange, Uri uri) {
|
||||
if (uri.equals(Settings.System.getUriFor(Settings.System.QS_PANEL_STYLE))) {
|
||||
updateQsStyle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mSettingsDashBoardStyle) {
|
||||
CherishUtils.showSettingsRestartDialog(getContext());
|
||||
return true;
|
||||
} else if (preference == mAltSettingsLayout) {
|
||||
CherishUtils.showSettingsRestartDialog(getContext());
|
||||
return true;
|
||||
} else if (preference == mUseStockLayout) {
|
||||
CherishUtils.showSettingsRestartDialog(getContext());
|
||||
return true;
|
||||
} else if (preference == mDisableUserCard) {
|
||||
CherishUtils.showSettingsRestartDialog(getContext());
|
||||
return true;
|
||||
} else if (preference == mQsStyle) {
|
||||
mCustomSettingsObserver.observe();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateQsStyle() {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
|
||||
int qsPanelStyle = Settings.System.getIntForUser(getContext().getContentResolver(),
|
||||
Settings.System.QS_PANEL_STYLE , 0, UserHandle.USER_CURRENT);
|
||||
|
||||
if (qsPanelStyle == 0) {
|
||||
setDefaultStyle(mOverlayService);
|
||||
} else if (qsPanelStyle == 1) {
|
||||
setQsStyle(mOverlayService, "com.android.system.qs.outline");
|
||||
} else if (qsPanelStyle == 2 || qsPanelStyle == 3) {
|
||||
setQsStyle(mOverlayService, "com.android.system.qs.twotoneaccent");
|
||||
}
|
||||
}
|
||||
|
||||
public static void setDefaultStyle(IOverlayManager overlayManager) {
|
||||
for (int i = 0; i < QS_STYLES.length; i++) {
|
||||
String qsStyles = QS_STYLES[i];
|
||||
try {
|
||||
overlayManager.setEnabled(qsStyles, false, USER_SYSTEM);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setQsStyle(IOverlayManager overlayManager, String overlayName) {
|
||||
try {
|
||||
for (int i = 0; i < QS_STYLES.length; i++) {
|
||||
String qsStyles = QS_STYLES[i];
|
||||
try {
|
||||
overlayManager.setEnabled(qsStyles, false, USER_SYSTEM);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
overlayManager.setEnabled(overlayName, true, USER_SYSTEM);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static final String[] QS_STYLES = {
|
||||
"com.android.system.qs.outline",
|
||||
"com.android.system.qs.twotoneaccent"
|
||||
};
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
|
||||
176
src/com/cherish/settings/fragments/Udfps.java
Normal file
176
src/com/cherish/settings/fragments/Udfps.java
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 The CherishOS Projects
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.UserHandle;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import com.cherish.settings.fragments.UdfpsIconPicker;
|
||||
import android.text.TextUtils;
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.SwitchPreference;
|
||||
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.internal.util.cherish.CherishUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.util.Arrays;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class Udfps extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String UDFPS_CUSTOMIZATION = "udfps_customization";
|
||||
private static final String CUSTOM_FOD_ICON_KEY = "custom_fp_icon_enabled";
|
||||
private static final String CUSTOM_FP_FILE_SELECT = "custom_fp_file_select";
|
||||
private static final int REQUEST_PICK_IMAGE = 0;
|
||||
|
||||
private PreferenceCategory mUdfpsCustomization;
|
||||
private Preference mCustomFPImage;
|
||||
private SystemSettingSwitchPreference mCustomFodIcon;
|
||||
private Preference mUdfpsIconPicker;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
addPreferencesFromResource(R.xml.cherish_settings_udfps);
|
||||
|
||||
final PreferenceScreen prefSet = getPreferenceScreen();
|
||||
Resources resources = getResources();
|
||||
|
||||
final boolean udfpsResPkgInstalled = CherishUtils.isPackageInstalled(getContext(),
|
||||
"com.cherish.udfps.resources");
|
||||
mUdfpsCustomization = (PreferenceCategory) findPreference(UDFPS_CUSTOMIZATION);
|
||||
if (!udfpsResPkgInstalled) {
|
||||
prefSet.removePreference(mUdfpsCustomization);
|
||||
}
|
||||
mUdfpsIconPicker = (Preference) prefSet.findPreference("udfps_icon_picker");
|
||||
|
||||
mCustomFPImage = findPreference(CUSTOM_FP_FILE_SELECT);
|
||||
final String customIconURI = Settings.System.getString(getContext().getContentResolver(),
|
||||
Settings.System.OMNI_CUSTOM_FP_ICON);
|
||||
if (!TextUtils.isEmpty(customIconURI)) {
|
||||
setPickerIcon(customIconURI);
|
||||
}
|
||||
|
||||
mCustomFodIcon = (SystemSettingSwitchPreference) findPreference(CUSTOM_FOD_ICON_KEY);
|
||||
boolean val = Settings.System.getIntForUser(getActivity().getContentResolver(),
|
||||
Settings.System.OMNI_CUSTOM_FP_ICON_ENABLED, 0, UserHandle.USER_CURRENT) == 1;
|
||||
mCustomFodIcon.setOnPreferenceChangeListener(this);
|
||||
if (val) {
|
||||
mUdfpsIconPicker.setEnabled(false);
|
||||
} else {
|
||||
mUdfpsIconPicker.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getActivity().getContentResolver();
|
||||
if (preference == mCustomFodIcon) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.System.putIntForUser(getActivity().getContentResolver(),
|
||||
Settings.System.OMNI_CUSTOM_FP_ICON_ENABLED, val ? 1 : 0,
|
||||
UserHandle.USER_CURRENT);
|
||||
if (val) {
|
||||
mUdfpsIconPicker.setEnabled(false);
|
||||
} else {
|
||||
mUdfpsIconPicker.setEnabled(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(Preference preference) {
|
||||
if (preference == mCustomFPImage) {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK);
|
||||
intent.setType("image/*");
|
||||
startActivityForResult(intent, REQUEST_PICK_IMAGE);
|
||||
return true;
|
||||
}
|
||||
return super.onPreferenceTreeClick(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent result) {
|
||||
if (requestCode == REQUEST_PICK_IMAGE && resultCode == Activity.RESULT_OK) {
|
||||
Uri uri = null;
|
||||
if (result != null) {
|
||||
uri = result.getData();
|
||||
setPickerIcon(uri.toString());
|
||||
Settings.System.putString(getContentResolver(), Settings.System.OMNI_CUSTOM_FP_ICON,
|
||||
uri.toString());
|
||||
}
|
||||
} else if (requestCode == REQUEST_PICK_IMAGE && resultCode == Activity.RESULT_CANCELED) {
|
||||
mCustomFPImage.setIcon(new ColorDrawable(Color.TRANSPARENT));
|
||||
Settings.System.putString(getContentResolver(), Settings.System.OMNI_CUSTOM_FP_ICON, "");
|
||||
}
|
||||
}
|
||||
|
||||
private void setPickerIcon(String uri) {
|
||||
try {
|
||||
ParcelFileDescriptor parcelFileDescriptor =
|
||||
getContext().getContentResolver().openFileDescriptor(Uri.parse(uri), "r");
|
||||
FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
|
||||
Bitmap image = BitmapFactory.decodeFileDescriptor(fileDescriptor);
|
||||
parcelFileDescriptor.close();
|
||||
Drawable d = new BitmapDrawable(getResources(), image);
|
||||
mCustomFPImage.setIcon(d);
|
||||
}
|
||||
catch (Exception e) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_udfps);
|
||||
}
|
||||
257
src/com/cherish/settings/fragments/UdfpsAnimation.java
Normal file
257
src/com/cherish/settings/fragments/UdfpsAnimation.java
Normal file
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (C) 2021 AospExtended ROM 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.widget.SettingsMainSwitchBar;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class UdfpsAnimation extends SettingsPreferenceFragment implements
|
||||
OnMainSwitchChangeListener {
|
||||
|
||||
private Switch mSwitch;
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private String mPkg = "com.cherish.udfps.resources";
|
||||
private AnimationDrawable animation;
|
||||
|
||||
private Resources udfpsRes;
|
||||
|
||||
private String[] mAnims;
|
||||
private String[] mAnimPreviews;
|
||||
private String[] mTitles;
|
||||
|
||||
private boolean mEnabled;
|
||||
private UdfpsAnimAdapter mUdfpsAnimAdapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getActivity().setTitle(R.string.udfps_recog_animation_effect_title);
|
||||
|
||||
loadResources();
|
||||
}
|
||||
|
||||
private void loadResources() {
|
||||
try {
|
||||
PackageManager pm = getActivity().getPackageManager();
|
||||
udfpsRes = pm.getResourcesForApplication(mPkg);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mAnims = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_animation_styles",
|
||||
"array", mPkg));
|
||||
mAnimPreviews = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_animation_previews",
|
||||
"array", mPkg));
|
||||
mTitles = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_animation_titles",
|
||||
"array", mPkg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(
|
||||
R.layout.item_view, container, false);
|
||||
|
||||
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
mRecyclerView.setLayoutManager(gridLayoutManager);
|
||||
mUdfpsAnimAdapter = new UdfpsAnimAdapter(getActivity());
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
final SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
|
||||
mSwitch = switchBar.getSwitch();
|
||||
mEnabled = Settings.System.getInt(getActivity().getContentResolver(),
|
||||
Settings.System.UDFPS_ANIM, 0) == 1;
|
||||
mSwitch.setChecked(mEnabled);
|
||||
setEnabled(mEnabled);
|
||||
switchBar.setTitle(getActivity().getString(R.string.udfps_recog_animation));
|
||||
switchBar.addOnSwitchChangeListener(this);
|
||||
switchBar.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwitchChanged(Switch switchView, boolean isChecked) {
|
||||
Settings.System.putInt(getActivity().getContentResolver(),
|
||||
Settings.System.UDFPS_ANIM, isChecked ? 1 : 0);
|
||||
mSwitch.setChecked(isChecked);
|
||||
setEnabled(isChecked);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
if (enabled) {
|
||||
mRecyclerView.setAdapter(mUdfpsAnimAdapter);
|
||||
} else {
|
||||
mRecyclerView.setAdapter(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public class UdfpsAnimAdapter extends RecyclerView.Adapter<UdfpsAnimAdapter.UdfpsAnimViewHolder> {
|
||||
Context context;
|
||||
String mSelectedAnim;
|
||||
String mAppliedAnim;
|
||||
|
||||
public UdfpsAnimAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdfpsAnimViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_option, parent, false);
|
||||
UdfpsAnimViewHolder vh = new UdfpsAnimViewHolder(v);
|
||||
return vh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(UdfpsAnimViewHolder holder, final int position) {
|
||||
String animName = mAnims[position];
|
||||
|
||||
Glide.with(holder.image.getContext())
|
||||
.load("")
|
||||
.placeholder(getDrawable(holder.image.getContext(), mAnimPreviews[position]))
|
||||
.into(holder.image);
|
||||
|
||||
holder.name.setText(mTitles[position]);
|
||||
|
||||
if (position == Settings.System.getInt(context.getContentResolver(),
|
||||
Settings.System.UDFPS_ANIM_STYLE, 0)) {
|
||||
mAppliedAnim = animName;
|
||||
if (mSelectedAnim == null) {
|
||||
mSelectedAnim = animName;
|
||||
}
|
||||
}
|
||||
|
||||
holder.itemView.setActivated(animName == mSelectedAnim);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
updateActivatedStatus(mSelectedAnim, false);
|
||||
updateActivatedStatus(animName, true);
|
||||
mSelectedAnim = animName;
|
||||
holder.image.setBackgroundDrawable(getDrawable(v.getContext(), mAnims[position]));
|
||||
animation = (AnimationDrawable) holder.image.getBackground();
|
||||
animation.setOneShot(true);
|
||||
animation.start();
|
||||
Settings.System.putInt(getActivity().getContentResolver(),
|
||||
Settings.System.UDFPS_ANIM_STYLE, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mAnims.length;
|
||||
}
|
||||
|
||||
public class UdfpsAnimViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView name;
|
||||
ImageView image;
|
||||
public UdfpsAnimViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
name = (TextView) itemView.findViewById(R.id.option_label);
|
||||
image = (ImageView) itemView.findViewById(R.id.option_thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActivatedStatus(String anim, boolean isActivated) {
|
||||
int index = Arrays.asList(mAnims).indexOf(anim);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(index);
|
||||
if (holder != null && holder.itemView != null) {
|
||||
holder.itemView.setActivated(isActivated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable getDrawable(Context context, String drawableName) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
Resources res = pm.getResourcesForApplication(mPkg);
|
||||
return res.getDrawable(res.getIdentifier(drawableName, "drawable", mPkg));
|
||||
}
|
||||
catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
210
src/com/cherish/settings/fragments/UdfpsIconPicker.java
Normal file
210
src/com/cherish/settings/fragments/UdfpsIconPicker.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (C) 2021 AospExtended ROM 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.net.Uri;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class UdfpsIconPicker extends SettingsPreferenceFragment {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
|
||||
private Resources udfpsRes;
|
||||
|
||||
private String mPkg = "com.cherish.udfps.resources";
|
||||
|
||||
private String[] mIcons;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getActivity().setTitle(R.string.udfps_icon_picker_title);
|
||||
|
||||
loadResources();
|
||||
}
|
||||
|
||||
private void loadResources() {
|
||||
try {
|
||||
PackageManager pm = getActivity().getPackageManager();
|
||||
udfpsRes = pm.getResourcesForApplication(mPkg);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mIcons = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_icons",
|
||||
"array", mPkg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(
|
||||
R.layout.item_view, container, false);
|
||||
|
||||
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
mRecyclerView.setLayoutManager(gridLayoutManager);
|
||||
UdfpsIconAdapter mUdfpsIconAdapter = new UdfpsIconAdapter(getActivity());
|
||||
mRecyclerView.setAdapter(mUdfpsIconAdapter);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public class UdfpsIconAdapter extends RecyclerView.Adapter<UdfpsIconAdapter.UdfpsIconViewHolder> {
|
||||
Context context;
|
||||
String mSelectedIcon;
|
||||
String mAppliedIcon;
|
||||
|
||||
public UdfpsIconAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdfpsIconViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_option, parent, false);
|
||||
UdfpsIconViewHolder vh = new UdfpsIconViewHolder(v);
|
||||
return vh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(UdfpsIconViewHolder holder, final int position) {
|
||||
String iconRes = mIcons[position];
|
||||
|
||||
Glide.with(holder.image.getContext())
|
||||
.load("")
|
||||
.placeholder(getDrawable(holder.image.getContext(), mIcons[position]))
|
||||
.into(holder.image);
|
||||
|
||||
holder.image.setPadding(20,20,20,20);
|
||||
|
||||
holder.name.setVisibility(View.GONE);
|
||||
|
||||
if (position == Settings.System.getInt(context.getContentResolver(),
|
||||
Settings.System.UDFPS_ICON, 0)) {
|
||||
mAppliedIcon = iconRes;
|
||||
if (mSelectedIcon == null) {
|
||||
mSelectedIcon = iconRes;
|
||||
}
|
||||
}
|
||||
holder.itemView.setActivated(iconRes == mSelectedIcon);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
updateActivatedStatus(mSelectedIcon, false);
|
||||
updateActivatedStatus(iconRes, true);
|
||||
mSelectedIcon = iconRes;
|
||||
Settings.System.putInt(getActivity().getContentResolver(),
|
||||
Settings.System.UDFPS_ICON, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mIcons.length;
|
||||
}
|
||||
|
||||
public class UdfpsIconViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView name;
|
||||
ImageView image;
|
||||
public UdfpsIconViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
name = (TextView) itemView.findViewById(R.id.option_label);
|
||||
image = (ImageView) itemView.findViewById(R.id.option_thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActivatedStatus(String icon, boolean isActivated) {
|
||||
int index = Arrays.asList(mIcons).indexOf(icon);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(index);
|
||||
if (holder != null && holder.itemView != null) {
|
||||
holder.itemView.setActivated(isActivated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable getDrawable(Context context, String drawableName) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
Resources res = pm.getResourcesForApplication(mPkg);
|
||||
Context ctx = context.createPackageContext(
|
||||
mPkg, Context.CONTEXT_IGNORE_SECURITY);
|
||||
return ctx.getDrawable(res.getIdentifier(drawableName, "drawable", mPkg));
|
||||
}
|
||||
catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
210
src/com/cherish/settings/fragments/UdfpsPressedIconPicker.java
Normal file
210
src/com/cherish/settings/fragments/UdfpsPressedIconPicker.java
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (C) 2021 AospExtended ROM 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.net.Uri;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class UdfpsPressedIconPicker extends SettingsPreferenceFragment {
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
|
||||
private Resources udfpsRes;
|
||||
|
||||
private String mPkg = "com.cherish.udfps.resources";
|
||||
|
||||
private String[] mIcons;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getActivity().setTitle(R.string.udfps_pressed_color_title);
|
||||
|
||||
loadResources();
|
||||
}
|
||||
|
||||
private void loadResources() {
|
||||
try {
|
||||
PackageManager pm = getActivity().getPackageManager();
|
||||
udfpsRes = pm.getResourcesForApplication(mPkg);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mIcons = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_pressedicons",
|
||||
"array", mPkg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(
|
||||
R.layout.item_view, container, false);
|
||||
|
||||
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
|
||||
mRecyclerView.setLayoutManager(gridLayoutManager);
|
||||
UdfpsPressedIconAdapter mUdfpsPressedIconAdapter = new UdfpsPressedIconAdapter(getActivity());
|
||||
mRecyclerView.setAdapter(mUdfpsPressedIconAdapter);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
public class UdfpsPressedIconAdapter extends RecyclerView.Adapter<UdfpsPressedIconAdapter.UdfpsPressedIconViewHolder> {
|
||||
Context context;
|
||||
String mSelectedIcon;
|
||||
String mAppliedIcon;
|
||||
|
||||
public UdfpsPressedIconAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdfpsPressedIconViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_option, parent, false);
|
||||
UdfpsPressedIconViewHolder vh = new UdfpsPressedIconViewHolder(v);
|
||||
return vh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(UdfpsPressedIconViewHolder holder, final int position) {
|
||||
String iconRes = mIcons[position];
|
||||
|
||||
Glide.with(holder.image.getContext())
|
||||
.load("")
|
||||
.placeholder(getDrawable(holder.image.getContext(), mIcons[position]))
|
||||
.into(holder.image);
|
||||
|
||||
holder.image.setPadding(20,20,20,20);
|
||||
|
||||
holder.name.setVisibility(View.GONE);
|
||||
|
||||
if (position == Settings.System.getInt(context.getContentResolver(),
|
||||
Settings.System.UDFPS_COLOR, 0)) {
|
||||
mAppliedIcon = iconRes;
|
||||
if (mSelectedIcon == null) {
|
||||
mSelectedIcon = iconRes;
|
||||
}
|
||||
}
|
||||
holder.itemView.setActivated(iconRes == mSelectedIcon);
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
updateActivatedStatus(mSelectedIcon, false);
|
||||
updateActivatedStatus(iconRes, true);
|
||||
mSelectedIcon = iconRes;
|
||||
Settings.System.putInt(getActivity().getContentResolver(),
|
||||
Settings.System.UDFPS_COLOR, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mIcons.length;
|
||||
}
|
||||
|
||||
public class UdfpsPressedIconViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView name;
|
||||
ImageView image;
|
||||
public UdfpsPressedIconViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
name = (TextView) itemView.findViewById(R.id.option_label);
|
||||
image = (ImageView) itemView.findViewById(R.id.option_thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActivatedStatus(String icon, boolean isActivated) {
|
||||
int index = Arrays.asList(mIcons).indexOf(icon);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(index);
|
||||
if (holder != null && holder.itemView != null) {
|
||||
holder.itemView.setActivated(isActivated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Drawable getDrawable(Context context, String drawableName) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
Resources res = pm.getResourcesForApplication(mPkg);
|
||||
Context ctx = context.createPackageContext(
|
||||
mPkg, Context.CONTEXT_IGNORE_SECURITY);
|
||||
return ctx.getDrawable(res.getIdentifier(drawableName, "drawable", mPkg));
|
||||
}
|
||||
catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +1,194 @@
|
||||
package com.cherish.settings.fragments;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import android.preference.SwitchPreference;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.SettingNotFoundException;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceFragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settingslib.search.SearchIndexable;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
||||
public class VolumeRockerSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
private static final String TAG = "VolumeSteps";
|
||||
private static final String VOLUME_STEP_DEFAULTS = "volume_step_defaults";
|
||||
private static final String FIRST_RUN_KEY = "first_run";
|
||||
|
||||
// base map of all preference keys and the associated stream
|
||||
private static final Map<String, Integer> volume_map = new HashMap<String, Integer>();
|
||||
static {
|
||||
volume_map.put("volume_steps_alarm", new Integer(AudioManager.STREAM_ALARM));
|
||||
volume_map.put("volume_steps_dtmf", new Integer(AudioManager.STREAM_DTMF));
|
||||
volume_map.put("volume_steps_music", new Integer(AudioManager.STREAM_MUSIC));
|
||||
volume_map.put("volume_steps_notification", new Integer(AudioManager.STREAM_NOTIFICATION));
|
||||
volume_map.put("volume_steps_ring", new Integer(AudioManager.STREAM_RING));
|
||||
volume_map.put("volume_steps_system", new Integer(AudioManager.STREAM_SYSTEM));
|
||||
volume_map.put("volume_steps_voice_call", new Integer(AudioManager.STREAM_VOICE_CALL));
|
||||
}
|
||||
|
||||
// entries to remove on non-telephony devices
|
||||
private static final Set<String> telephony_set = new HashSet<String>();
|
||||
static {
|
||||
telephony_set.add("volume_steps_dtmf");
|
||||
telephony_set.add("volume_steps_ring");
|
||||
telephony_set.add("volume_steps_voice_call");
|
||||
}
|
||||
|
||||
// set of available pref keys after device configuration filter
|
||||
private Set<String> mAvailableKeys = new HashSet<String>();
|
||||
private AudioManager mAudioManager;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.cherish_settings_volume);
|
||||
mAudioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
|
||||
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
mAvailableKeys = volume_map.keySet();
|
||||
|
||||
// remove invalid audio stream prefs
|
||||
boolean isPhone = TelephonyManager.getDefault().getCurrentPhoneType() != TelephonyManager.PHONE_TYPE_NONE;
|
||||
|
||||
if (!isPhone) {
|
||||
// remove telephony keys from available set
|
||||
mAvailableKeys.removeAll(telephony_set);
|
||||
for (String key : telephony_set) {
|
||||
Preference toRemove = prefScreen.findPreference(key);
|
||||
if (toRemove != null) {
|
||||
prefScreen.removePreference(toRemove);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check prefs for initial run of this fragment
|
||||
final boolean firstRun = checkForFirstRun();
|
||||
|
||||
// entries array isn't translatable ugh
|
||||
final String defEntry = getString(R.string.volume_steps_reset);
|
||||
|
||||
// initialize prefs: set defaults if first run, set listeners and update values
|
||||
for (String key : mAvailableKeys) {
|
||||
Preference pref = prefScreen.findPreference(key);
|
||||
if (pref == null || !(pref instanceof ListPreference)) {
|
||||
continue;
|
||||
}
|
||||
final ListPreference listPref = (ListPreference) pref;
|
||||
int steps = mAudioManager.getStreamMaxVolume(volume_map.get(key));
|
||||
if (firstRun) {
|
||||
saveDefaultSteps(listPref, steps);
|
||||
}
|
||||
final int defSteps = getDefaultSteps(listPref);
|
||||
CharSequence[] entries = new CharSequence[listPref.getEntries().length + 1];
|
||||
CharSequence[] values = new CharSequence[listPref.getEntryValues().length + 1];
|
||||
|
||||
for (int i = 0; i < entries.length; i++) {
|
||||
if (i == 0) {
|
||||
entries[i] = defEntry;
|
||||
values[i] = String.valueOf(defSteps);
|
||||
continue;
|
||||
}
|
||||
entries[i] = listPref.getEntries()[i - 1];
|
||||
values[i] = listPref.getEntryValues()[i - 1];
|
||||
}
|
||||
listPref.setEntries(entries);
|
||||
listPref.setEntryValues(values);
|
||||
updateVolumeStepPrefs(listPref, steps);
|
||||
listPref.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||
if (preference.hasKey() && mAvailableKeys.contains(preference.getKey())) {
|
||||
commitVolumeSteps(preference, Integer.parseInt(objValue.toString()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private SharedPreferences getDefaultStepsPrefs() {
|
||||
return getActivity().getSharedPreferences(VOLUME_STEP_DEFAULTS,
|
||||
Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
// test for initial run of this fragment
|
||||
private boolean checkForFirstRun() {
|
||||
String isFirstRun = getDefaultStepsPrefs().getString(FIRST_RUN_KEY, null);
|
||||
if (isFirstRun == null) {
|
||||
getDefaultStepsPrefs().edit().putString(FIRST_RUN_KEY, "first_run_initialized").commit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int getDefaultSteps(Preference pref) {
|
||||
if (pref == null || !(pref instanceof ListPreference)) {
|
||||
// unlikely
|
||||
return -1;
|
||||
}
|
||||
String key = pref.getKey();
|
||||
String value = getDefaultStepsPrefs().getString(key, null);
|
||||
if (value == null) {
|
||||
// unlikely
|
||||
return -1;
|
||||
}
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
|
||||
// on the initial run, let's store true device defaults in sharedPrefs
|
||||
private void saveDefaultSteps(Preference volPref, int defaultSteps) {
|
||||
String key = volPref.getKey();
|
||||
getDefaultStepsPrefs().edit().putString(key, String.valueOf(defaultSteps)).commit();
|
||||
}
|
||||
|
||||
private void updateVolumeStepPrefs(Preference pref, int steps) {
|
||||
if (pref == null || !(pref instanceof ListPreference)) {
|
||||
return;
|
||||
}
|
||||
final ListPreference listPref = (ListPreference) pref;
|
||||
listPref.setSummary(String.valueOf(steps));
|
||||
listPref.setValue(String.valueOf(steps));
|
||||
}
|
||||
|
||||
private void commitVolumeSteps(Preference pref, int steps) {
|
||||
Settings.System.putInt(getActivity().getContentResolver(), pref.getKey(), steps);
|
||||
mAudioManager.setStreamMaxVolume(volume_map.get(pref.getKey()), steps);
|
||||
updateVolumeStepPrefs(pref, steps);
|
||||
Log.i(TAG, "Volume steps:" + pref.getKey() + "" + String.valueOf(steps));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* For Search.
|
||||
*/
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
|
||||
@Override
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
|
||||
boolean enabled) {
|
||||
ArrayList<SearchIndexableResource> result =
|
||||
new ArrayList<SearchIndexableResource>();
|
||||
SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = R.xml.cherish_settings_volume;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
}
|
||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider(R.xml.cherish_settings_volume);
|
||||
}
|
||||
221
src/com/cherish/settings/fragments/sound/PulseSettings.java
Normal file
221
src/com/cherish/settings/fragments/sound/PulseSettings.java
Normal file
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* Copyright (C) 2016-2021 crDroid Android 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.
|
||||
*/
|
||||
package com.cherish.settings.fragments.sound;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.Resources;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
import net.margaritov.preference.colorpicker.ColorPickerPreference;
|
||||
|
||||
public class PulseSettings extends SettingsPreferenceFragment implements
|
||||
Preference.OnPreferenceChangeListener {
|
||||
|
||||
private static final String TAG = PulseSettings.class.getSimpleName();
|
||||
|
||||
private static final String NAVBAR_PULSE_ENABLED_KEY = "navbar_pulse_enabled";
|
||||
private static final String LOCKSCREEN_PULSE_ENABLED_KEY = "lockscreen_pulse_enabled";
|
||||
private static final String AMBIENT_PULSE_ENABLED_KEY = "ambient_pulse_enabled";
|
||||
private static final String PULSE_SMOOTHING_KEY = "pulse_smoothing_enabled";
|
||||
private static final String PULSE_COLOR_MODE_KEY = "pulse_color_mode";
|
||||
private static final String PULSE_COLOR_MODE_CHOOSER_KEY = "pulse_color_user";
|
||||
private static final String PULSE_COLOR_MODE_LAVA_SPEED_KEY = "pulse_lavalamp_speed";
|
||||
private static final String PULSE_RENDER_CATEGORY_SOLID = "pulse_2";
|
||||
private static final String PULSE_RENDER_CATEGORY_FADING = "pulse_fading_bars_category";
|
||||
private static final String PULSE_RENDER_MODE_KEY = "pulse_render_style";
|
||||
private static final int RENDER_STYLE_FADING_BARS = 0;
|
||||
private static final int RENDER_STYLE_SOLID_LINES = 1;
|
||||
private static final int COLOR_TYPE_ACCENT = 0;
|
||||
private static final int COLOR_TYPE_USER = 1;
|
||||
private static final int COLOR_TYPE_LAVALAMP = 2;
|
||||
private static final int COLOR_TYPE_AUTO = 3;
|
||||
|
||||
private static final String PULSE_SETTINGS_FOOTER = "pulse_settings_footer";
|
||||
|
||||
private SwitchPreference mNavbarPulse;
|
||||
private SwitchPreference mLockscreenPulse;
|
||||
private SwitchPreference mAmbientPulse;
|
||||
private SwitchPreference mPulseSmoothing;
|
||||
private Preference mRenderMode;
|
||||
private ListPreference mColorModePref;
|
||||
private ColorPickerPreference mColorPickerPref;
|
||||
private Preference mLavaSpeedPref;
|
||||
private Preference mFooterPref;
|
||||
|
||||
private PreferenceCategory mFadingBarsCat;
|
||||
private PreferenceCategory mSolidBarsCat;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
addPreferencesFromResource(R.xml.pulse_settings);
|
||||
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
|
||||
mNavbarPulse = (SwitchPreference) findPreference(NAVBAR_PULSE_ENABLED_KEY);
|
||||
boolean navbarPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
mNavbarPulse.setChecked(navbarPulse);
|
||||
mNavbarPulse.setOnPreferenceChangeListener(this);
|
||||
|
||||
mLockscreenPulse = (SwitchPreference) findPreference(LOCKSCREEN_PULSE_ENABLED_KEY);
|
||||
boolean lockscreenPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
|
||||
mLockscreenPulse.setChecked(lockscreenPulse);
|
||||
mLockscreenPulse.setOnPreferenceChangeListener(this);
|
||||
|
||||
mAmbientPulse = (SwitchPreference) findPreference(AMBIENT_PULSE_ENABLED_KEY);
|
||||
boolean ambientPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.AMBIENT_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
mAmbientPulse.setChecked(ambientPulse);
|
||||
mAmbientPulse.setOnPreferenceChangeListener(this);
|
||||
|
||||
mColorModePref = (ListPreference) findPreference(PULSE_COLOR_MODE_KEY);
|
||||
mColorPickerPref = (ColorPickerPreference) findPreference(PULSE_COLOR_MODE_CHOOSER_KEY);
|
||||
mLavaSpeedPref = findPreference(PULSE_COLOR_MODE_LAVA_SPEED_KEY);
|
||||
mColorModePref.setOnPreferenceChangeListener(this);
|
||||
|
||||
mRenderMode = findPreference(PULSE_RENDER_MODE_KEY);
|
||||
mRenderMode.setOnPreferenceChangeListener(this);
|
||||
|
||||
mFadingBarsCat = (PreferenceCategory) findPreference(
|
||||
PULSE_RENDER_CATEGORY_FADING);
|
||||
mSolidBarsCat = (PreferenceCategory) findPreference(
|
||||
PULSE_RENDER_CATEGORY_SOLID);
|
||||
|
||||
mPulseSmoothing = (SwitchPreference) findPreference(PULSE_SMOOTHING_KEY);
|
||||
|
||||
mFooterPref = findPreference(PULSE_SETTINGS_FOOTER);
|
||||
mFooterPref.setTitle(R.string.pulse_help_policy_notice_summary);
|
||||
|
||||
updateAllPrefs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
if (preference == mNavbarPulse) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
updateAllPrefs();
|
||||
return true;
|
||||
} else if (preference == mLockscreenPulse) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
updateAllPrefs();
|
||||
return true;
|
||||
} else if (preference == mAmbientPulse) {
|
||||
boolean val = (Boolean) newValue;
|
||||
Settings.Secure.putIntForUser(resolver,
|
||||
Settings.Secure.AMBIENT_PULSE_ENABLED, val ? 1 : 0, UserHandle.USER_CURRENT);
|
||||
updateAllPrefs();
|
||||
return true;
|
||||
} else if (preference == mColorModePref) {
|
||||
updateColorPrefs(Integer.valueOf(String.valueOf(newValue)));
|
||||
return true;
|
||||
} else if (preference == mRenderMode) {
|
||||
updateRenderCategories(Integer.valueOf(String.valueOf(newValue)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void updateAllPrefs() {
|
||||
ContentResolver resolver = getContext().getContentResolver();
|
||||
|
||||
boolean navbarPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.NAVBAR_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
boolean lockscreenPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.LOCKSCREEN_PULSE_ENABLED, 1, UserHandle.USER_CURRENT) != 0;
|
||||
|
||||
boolean ambientPulse = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.AMBIENT_PULSE_ENABLED, 0, UserHandle.USER_CURRENT) != 0;
|
||||
|
||||
mPulseSmoothing.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
|
||||
mColorModePref.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
if (navbarPulse || lockscreenPulse) {
|
||||
int colorMode = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.PULSE_COLOR_MODE, COLOR_TYPE_LAVALAMP, UserHandle.USER_CURRENT);
|
||||
updateColorPrefs(colorMode);
|
||||
} else {
|
||||
mColorPickerPref.setEnabled(false);
|
||||
mLavaSpeedPref.setEnabled(false);
|
||||
}
|
||||
|
||||
mRenderMode.setEnabled(navbarPulse || lockscreenPulse || ambientPulse);
|
||||
if (navbarPulse || lockscreenPulse || ambientPulse) {
|
||||
int renderMode = Settings.Secure.getIntForUser(resolver,
|
||||
Settings.Secure.PULSE_RENDER_STYLE, RENDER_STYLE_SOLID_LINES, UserHandle.USER_CURRENT);
|
||||
updateRenderCategories(renderMode);
|
||||
} else {
|
||||
mFadingBarsCat.setEnabled(false);
|
||||
mSolidBarsCat.setEnabled(false);
|
||||
}
|
||||
|
||||
mFooterPref.setEnabled(navbarPulse || lockscreenPulse);
|
||||
}
|
||||
|
||||
private void updateColorPrefs(int val) {
|
||||
switch (val) {
|
||||
case COLOR_TYPE_ACCENT:
|
||||
mColorPickerPref.setEnabled(false);
|
||||
mLavaSpeedPref.setEnabled(false);
|
||||
break;
|
||||
case COLOR_TYPE_USER:
|
||||
mColorPickerPref.setEnabled(true);
|
||||
mLavaSpeedPref.setEnabled(false);
|
||||
break;
|
||||
case COLOR_TYPE_LAVALAMP:
|
||||
mColorPickerPref.setEnabled(false);
|
||||
mLavaSpeedPref.setEnabled(true);
|
||||
break;
|
||||
case COLOR_TYPE_AUTO:
|
||||
mColorPickerPref.setEnabled(false);
|
||||
mLavaSpeedPref.setEnabled(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateRenderCategories(int mode) {
|
||||
mFadingBarsCat.setEnabled(mode == RENDER_STYLE_FADING_BARS);
|
||||
mSolidBarsCat.setEnabled(mode == RENDER_STYLE_SOLID_LINES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
}
|
||||
261
src/com/cherish/settings/preferences/ActionFragment.java
Normal file
261
src/com/cherish/settings/preferences/ActionFragment.java
Normal file
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* Copyright (C) 2015 TeamEos 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.
|
||||
*
|
||||
* Handle assignable action dialogs and instances of the ActionPreference
|
||||
* class that holds target widget state
|
||||
*/
|
||||
|
||||
package com.cherish.settings.preferences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.internal.util.hwkeys.ActionConstants.Defaults;
|
||||
import com.android.internal.util.hwkeys.ActionHandler;
|
||||
import com.android.internal.util.hwkeys.Config;
|
||||
import com.android.internal.util.hwkeys.Config.ActionConfig;
|
||||
import com.android.internal.util.hwkeys.Config.ButtonConfig;
|
||||
|
||||
import com.cherish.settings.preferences.ShortcutPickHelper;
|
||||
import com.cherish.settings.preferences.ActionPreference;
|
||||
import com.cherish.settings.preferences.CustomActionListAdapter;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
public class ActionFragment extends SettingsPreferenceFragment implements
|
||||
ShortcutPickHelper.OnPickListener {
|
||||
|
||||
private static final int DIALOG_CATEGORY = 69;
|
||||
private static final int DIALOG_CUSTOM_ACTIONS = 70;
|
||||
private static final String KEY_FOCUSED_PREFERENCE = "key_focused_preference";
|
||||
|
||||
private ShortcutPickHelper mPicker;
|
||||
protected ArrayList<ActionPreference> mPrefHolder;
|
||||
private String mHolderTag;
|
||||
private Defaults mDefaults;
|
||||
private ArrayList<ButtonConfig> mButtons;
|
||||
private ArrayList<ButtonConfig> mDefaultButtons;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
if (icicle != null) {
|
||||
String holderTag = icicle.getString(KEY_FOCUSED_PREFERENCE);
|
||||
if (holderTag != null) {
|
||||
mHolderTag = holderTag;
|
||||
}
|
||||
}
|
||||
mPicker = new ShortcutPickHelper(getActivity(), this);
|
||||
mPrefHolder = new ArrayList<ActionPreference>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
mPicker.onActivityResult(requestCode, resultCode, data);
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shortcutPicked(String uri, String friendlyName, boolean isApplication) {
|
||||
// activity dialogs pass null here if they are dismissed
|
||||
// if null, do nothing, no harm
|
||||
if (uri == null) {
|
||||
return;
|
||||
}
|
||||
findAndUpdatePreference(new ActionConfig(getActivity(), uri), mHolderTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(Preference preference) {
|
||||
if (preference instanceof ActionPreference) {
|
||||
mHolderTag = ((ActionPreference)preference).getTag();
|
||||
showDialog(DIALOG_CATEGORY);
|
||||
return true;
|
||||
}
|
||||
return super.onPreferenceTreeClick(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (mDefaults != null) {
|
||||
loadAndSetConfigs();
|
||||
onActionPolicyEnforced(mPrefHolder);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
if (mHolderTag != null) {
|
||||
outState.putString(KEY_FOCUSED_PREFERENCE, mHolderTag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DIALOG_CATEGORY: {
|
||||
Dialog dialog;
|
||||
final DialogInterface.OnClickListener categoryClickListener = new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item) {
|
||||
onTargetChange(getResources().getStringArray(R.array.action_dialog_values)[item]);
|
||||
dialog.dismiss();
|
||||
}
|
||||
};
|
||||
dialog = new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.choose_action_title)
|
||||
.setItems(getResources().getStringArray(R.array.action_dialog_entries),
|
||||
categoryClickListener)
|
||||
.setNegativeButton(getString(android.R.string.cancel), null)
|
||||
.create();
|
||||
return dialog;
|
||||
}
|
||||
case DIALOG_CUSTOM_ACTIONS: {
|
||||
Dialog dialog;
|
||||
final CustomActionListAdapter adapter = new CustomActionListAdapter(getActivity());
|
||||
if (!usesExtendedActionsList()) {
|
||||
adapter.removeAction(ActionHandler.SYSTEMUI_TASK_HOME);
|
||||
adapter.removeAction(ActionHandler.SYSTEMUI_TASK_BACK);
|
||||
}
|
||||
final DialogInterface.OnClickListener customActionClickListener = new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item) {
|
||||
findAndUpdatePreference(adapter.getItem(item), mHolderTag);
|
||||
dialog.dismiss();
|
||||
}
|
||||
};
|
||||
dialog = new AlertDialog.Builder(getActivity())
|
||||
.setTitle(getString(R.string.action_entry_custom_action))
|
||||
.setAdapter(adapter, customActionClickListener)
|
||||
.setNegativeButton(getString(android.R.string.cancel), null)
|
||||
.create();
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
return super.onCreateDialog(dialogId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDialogMetricsCategory(int dialogId) {
|
||||
switch (dialogId) {
|
||||
case DIALOG_CATEGORY:
|
||||
case DIALOG_CUSTOM_ACTIONS:
|
||||
return MetricsEvent.CHERISH_SETTINGS;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// subclass overrides to include back and home actions
|
||||
protected boolean usesExtendedActionsList() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void onActionPolicyEnforced(ArrayList<ActionPreference> prefs) {
|
||||
}
|
||||
|
||||
protected void setActionPreferencesEnabled(boolean enabled) {
|
||||
for (ActionPreference pref : mPrefHolder) {
|
||||
pref.setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load our button lists and ActionPreferences map button action targets from preference keys
|
||||
* and defaults config maps subclass is required to set desired Defaults interface int
|
||||
* ActionContants
|
||||
*/
|
||||
protected void onPreferenceScreenLoaded(Defaults defaults) {
|
||||
mDefaults = defaults;
|
||||
final PreferenceScreen prefScreen = getPreferenceScreen();
|
||||
for (int i = 0; i < prefScreen.getPreferenceCount(); i++) {
|
||||
Preference pref = prefScreen.getPreference(i);
|
||||
if (pref instanceof PreferenceCategory) {
|
||||
PreferenceCategory cat = (PreferenceCategory) pref;
|
||||
for (int j = 0; j < cat.getPreferenceCount(); j++) {
|
||||
Preference child = cat.getPreference(j);
|
||||
if (child instanceof ActionPreference) {
|
||||
mPrefHolder.add((ActionPreference) child);
|
||||
}
|
||||
}
|
||||
} else if (pref instanceof ActionPreference) {
|
||||
mPrefHolder.add((ActionPreference) pref);
|
||||
}
|
||||
}
|
||||
loadAndSetConfigs();
|
||||
}
|
||||
|
||||
protected void loadAndSetConfigs() {
|
||||
mButtons = Config.getConfig(getActivity(), mDefaults);
|
||||
mDefaultButtons = Config.getDefaultConfig(getActivity(), mDefaults);
|
||||
for (ActionPreference pref : mPrefHolder) {
|
||||
pref.setDefaults(mDefaults);
|
||||
ButtonConfig button = mButtons.get(pref.getConfigMap().button);
|
||||
ActionConfig action = button.getActionConfig(pref.getConfigMap().action);
|
||||
pref.setActionConfig(action);
|
||||
ButtonConfig defButton = mDefaultButtons.get(pref.getConfigMap().button);
|
||||
ActionConfig defAction = defButton.getActionConfig(pref.getConfigMap().action);
|
||||
pref.setDefaultActionConfig(defAction);
|
||||
}
|
||||
}
|
||||
|
||||
private void onTargetChange(String uri) {
|
||||
if (uri == null) {
|
||||
return;
|
||||
} else if (uri.equals(getString(R.string.action_value_default_action))) {
|
||||
findAndUpdatePreference(null, mHolderTag);
|
||||
} else if (uri.equals(getString(R.string.action_value_select_app))) {
|
||||
mPicker.pickShortcut(null, null, getId());
|
||||
} else if (uri.equals(getString(R.string.action_value_custom_action))) {
|
||||
showDialog(DIALOG_CUSTOM_ACTIONS);
|
||||
}
|
||||
}
|
||||
|
||||
protected void findAndUpdatePreference(ActionConfig action, String tag) {
|
||||
for (ActionPreference pref : mPrefHolder) {
|
||||
if (pref.getTag().equals(mHolderTag)) {
|
||||
if (action == null) {
|
||||
action = pref.getDefaultActionConfig();
|
||||
}
|
||||
pref.setActionConfig(action);
|
||||
ButtonConfig button = mButtons.get(pref.getConfigMap().button);
|
||||
ActionConfig newAction = pref.getActionConfig();
|
||||
button.setActionConfig(newAction, pref.getConfigMap().action);
|
||||
mButtons = Config.replaceButtonAtPosition(mButtons, button, pref.getConfigMap());
|
||||
Config.setConfig(getActivity(), mDefaults, mButtons);
|
||||
onActionPolicyEnforced(mPrefHolder);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
|
||||
}
|
||||
}
|
||||
134
src/com/cherish/settings/preferences/ActionPreference.java
Normal file
134
src/com/cherish/settings/preferences/ActionPreference.java
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright (C) 2015 TeamEos 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.
|
||||
*
|
||||
* Simple preference class implementing ActionHolder interface to assign
|
||||
* actions to buttons. It is ABSOLUTELY IMPERITIVE that the preference
|
||||
* key is identical to the target ConfigMap tag in ActionConstants
|
||||
*/
|
||||
|
||||
package com.cherish.settings.preferences;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.android.internal.util.hwkeys.ActionConstants.ConfigMap;
|
||||
import com.android.internal.util.hwkeys.ActionConstants.Defaults;
|
||||
import com.android.internal.util.hwkeys.ActionHolder;
|
||||
import com.android.internal.util.hwkeys.Config.ActionConfig;
|
||||
import com.android.internal.util.hwkeys.Config.ButtonConfig;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.preference.Preference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class ActionPreference extends Preference implements ActionHolder {
|
||||
private Defaults mDefaults;
|
||||
private ConfigMap mMap;
|
||||
private ActionConfig mAction;
|
||||
private ActionConfig mDefaultAction;
|
||||
|
||||
public ActionPreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public ActionPreference(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public ActionPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public ActionPreference(Context context, AttributeSet attrs, int defStyleAttr,
|
||||
int defStyleRes) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return this.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTag(String tag) {
|
||||
this.setKey(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Defaults getDefaults() {
|
||||
return mDefaults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaults(Defaults defaults) {
|
||||
mDefaults = defaults;
|
||||
final String tag = this.getKey();
|
||||
for (Map.Entry<String, ConfigMap> entry : defaults.getActionMap().entrySet()) {
|
||||
if (((String) entry.getKey()).equals(tag)) {
|
||||
mMap = entry.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigMap getConfigMap() {
|
||||
return mMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfigMap(ConfigMap map) {
|
||||
mMap = map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ButtonConfig getButtonConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setButtonConfig(ButtonConfig button) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionConfig getActionConfig() {
|
||||
return mAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActionConfig(ActionConfig action) {
|
||||
mAction = action;
|
||||
this.setSummary(action.getLabel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ButtonConfig getDefaultButtonConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultButtonConfig(ButtonConfig button) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionConfig getDefaultActionConfig() {
|
||||
return mDefaultAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultActionConfig(ActionConfig action) {
|
||||
mDefaultAction = action;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (C) 2015 TeamEos 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.
|
||||
*
|
||||
* Adapter for displaying custom actions in a list
|
||||
*/
|
||||
|
||||
package com.cherish.settings.preferences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.util.hwkeys.ActionHandler;
|
||||
import com.android.internal.util.hwkeys.Config.ActionConfig;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
public class CustomActionListAdapter extends BaseAdapter {
|
||||
private LayoutInflater mInflater;
|
||||
private Context mContext;
|
||||
private List<ActionConfig> mCustomActions = new ArrayList<ActionConfig>();
|
||||
|
||||
public CustomActionListAdapter(Context context) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
reloadActions();
|
||||
}
|
||||
|
||||
private void reloadActions() {
|
||||
mCustomActions.clear();
|
||||
mCustomActions.addAll(ActionHandler.getSystemActions(mContext));
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removeAction(String action) {
|
||||
int index = -1;
|
||||
for (int i = 0; i < mCustomActions.size(); i++) {
|
||||
if (TextUtils.equals(mCustomActions.get(i).getAction(), action)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index > -1) {
|
||||
mCustomActions.remove(index);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mCustomActions.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionConfig getItem(int position) {
|
||||
return mCustomActions.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ViewHolder holder;
|
||||
final Context ctx = mContext;
|
||||
if (convertView != null) {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
} else {
|
||||
convertView = mInflater.inflate(R.layout.custom_action_item, null, false);
|
||||
holder = new ViewHolder();
|
||||
convertView.setTag(holder);
|
||||
holder.title = (TextView) convertView.findViewById(com.android.internal.R.id.title);
|
||||
holder.summary = (TextView) convertView
|
||||
.findViewById(com.android.internal.R.id.summary);
|
||||
holder.icon = (ImageView) convertView.findViewById(R.id.icon);
|
||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) holder.icon.getLayoutParams();
|
||||
params.width = holder.icon.getMaxWidth();
|
||||
params.height = holder.icon.getMaxHeight();
|
||||
holder.icon.setLayoutParams(params);
|
||||
holder.icon.setScaleType(ScaleType.CENTER);
|
||||
holder.icon.setCropToPadding(true);
|
||||
}
|
||||
|
||||
ActionConfig config = getItem(position);
|
||||
holder.title.setText(config.getLabel());
|
||||
holder.icon.setBackgroundResource(R.drawable.fab_accent);
|
||||
holder.icon.setImageDrawable(config.getDefaultIcon(ctx));
|
||||
holder.summary.setVisibility(View.GONE);
|
||||
|
||||
return convertView;
|
||||
|
||||
}
|
||||
|
||||
private static class ViewHolder {
|
||||
TextView title;
|
||||
TextView summary;
|
||||
ImageView icon;
|
||||
}
|
||||
}
|
||||
327
src/com/cherish/settings/preferences/ShortcutPickHelper.java
Normal file
327
src/com/cherish/settings/preferences/ShortcutPickHelper.java
Normal file
@@ -0,0 +1,327 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The CyanogenMod 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.preferences;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.Intent.ShortcutIconResource;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.cherish.settings.preferences.ShortcutPickHelper.AppExpandableAdapter.GroupInfo;
|
||||
|
||||
public class ShortcutPickHelper {
|
||||
|
||||
private FragmentActivity mParent;
|
||||
private AlertDialog mAlertDialog;
|
||||
private OnPickListener mListener;
|
||||
private PackageManager mPackageManager;
|
||||
private static final int REQUEST_PICK_SHORTCUT = 100;
|
||||
private static final int REQUEST_PICK_APPLICATION = 101;
|
||||
private static final int REQUEST_CREATE_SHORTCUT = 102;
|
||||
private int lastFragmentId;
|
||||
|
||||
public interface OnPickListener {
|
||||
void shortcutPicked(String uri, String friendlyName, boolean isApplication);
|
||||
}
|
||||
|
||||
public ShortcutPickHelper(FragmentActivity parent, OnPickListener listener) {
|
||||
mParent = parent;
|
||||
mPackageManager = mParent.getPackageManager();
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == FragmentActivity.RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
case REQUEST_PICK_APPLICATION:
|
||||
completeSetCustomApp(data);
|
||||
break;
|
||||
case REQUEST_CREATE_SHORTCUT:
|
||||
completeSetCustomShortcut(data);
|
||||
break;
|
||||
case REQUEST_PICK_SHORTCUT:
|
||||
processShortcut(data, REQUEST_PICK_APPLICATION, REQUEST_CREATE_SHORTCUT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void pickShortcut(String[] names, ShortcutIconResource[] icons, int fragmentId) {
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
ArrayList<String> shortcutNames = new ArrayList<String>();
|
||||
if (names != null) {
|
||||
for (String s : names) {
|
||||
shortcutNames.add(s);
|
||||
}
|
||||
}
|
||||
shortcutNames.add(mParent.getString(R.string.profile_applist_title));
|
||||
shortcutNames.add(mParent.getString(R.string.picker_activities));
|
||||
bundle.putStringArrayList(Intent.EXTRA_SHORTCUT_NAME, shortcutNames);
|
||||
|
||||
ArrayList<ShortcutIconResource> shortcutIcons = new ArrayList<ShortcutIconResource>();
|
||||
if (icons != null) {
|
||||
for (ShortcutIconResource s : icons) {
|
||||
shortcutIcons.add(s);
|
||||
}
|
||||
}
|
||||
shortcutIcons.add(ShortcutIconResource.fromContext(mParent, android.R.drawable.sym_def_app_icon));
|
||||
shortcutIcons.add(ShortcutIconResource.fromContext(mParent, R.drawable.activities_icon));
|
||||
bundle.putParcelableArrayList(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, shortcutIcons);
|
||||
|
||||
Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
|
||||
pickIntent.putExtra(Intent.EXTRA_INTENT, new Intent(Intent.ACTION_CREATE_SHORTCUT));
|
||||
pickIntent.putExtra(Intent.EXTRA_TITLE, mParent.getText(R.string.select_custom_app_title));
|
||||
pickIntent.putExtras(bundle);
|
||||
lastFragmentId = fragmentId;
|
||||
startFragmentOrActivity(pickIntent, REQUEST_PICK_SHORTCUT);
|
||||
}
|
||||
|
||||
private void startFragmentOrActivity(Intent pickIntent, int requestCode) {
|
||||
if (lastFragmentId == 0) {
|
||||
mParent.startActivityForResult(pickIntent, requestCode);
|
||||
} else {
|
||||
Fragment cFrag = mParent.getSupportFragmentManager().findFragmentById(lastFragmentId);
|
||||
if (cFrag != null) {
|
||||
mParent.startActivityFromFragment(cFrag, pickIntent, requestCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processShortcut(final Intent intent, int requestCodeApplication, int requestCodeShortcut) {
|
||||
// Handle case where user selected "Applications"
|
||||
String applicationName = mParent.getString(R.string.profile_applist_title);
|
||||
String application2name = mParent.getString(R.string.picker_activities);
|
||||
String shortcutName = intent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
|
||||
if (applicationName != null && applicationName.equals(shortcutName)) {
|
||||
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
|
||||
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
|
||||
Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
|
||||
pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);
|
||||
startFragmentOrActivity(pickIntent, requestCodeApplication);
|
||||
} else if (application2name != null && application2name.equals(shortcutName)){
|
||||
final List<PackageInfo> pInfos = mPackageManager.getInstalledPackages(PackageManager.GET_ACTIVITIES);
|
||||
ExpandableListView appListView = new ExpandableListView(mParent);
|
||||
AppExpandableAdapter appAdapter = new AppExpandableAdapter(pInfos, mParent);
|
||||
appListView.setAdapter(appAdapter);
|
||||
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v,
|
||||
int groupPosition, int childPosition, long id) {
|
||||
Intent shortIntent = new Intent(Intent.ACTION_MAIN);
|
||||
String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition))
|
||||
.info.packageName;
|
||||
String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition))
|
||||
.info.activities[childPosition].name;
|
||||
shortIntent.setClassName(pkgName, actName);
|
||||
completeSetCustomApp(shortIntent);
|
||||
mAlertDialog.dismiss();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
Builder builder = new Builder(mParent);
|
||||
builder.setView(appListView);
|
||||
mAlertDialog = builder.create();
|
||||
mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title));
|
||||
mAlertDialog.show();
|
||||
mAlertDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
mListener.shortcutPicked(null, null, false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
startFragmentOrActivity(intent, requestCodeShortcut);
|
||||
}
|
||||
}
|
||||
|
||||
public class AppExpandableAdapter extends BaseExpandableListAdapter {
|
||||
|
||||
ArrayList<GroupInfo> allList = new ArrayList<GroupInfo>();
|
||||
final int groupPadding;
|
||||
|
||||
public class LabelCompare implements Comparator<GroupInfo>{
|
||||
@Override
|
||||
public int compare(GroupInfo item1, GroupInfo item2) {
|
||||
String rank1 = item1.label.toLowerCase();
|
||||
String rank2 = item2.label.toLowerCase();
|
||||
int result = rank1.compareTo(rank2);
|
||||
if(result == 0) {
|
||||
return 0;
|
||||
} else if(result < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return +1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GroupInfo {
|
||||
String label;
|
||||
PackageInfo info;
|
||||
GroupInfo (String l, PackageInfo p) {
|
||||
label = l;
|
||||
info = p;
|
||||
}
|
||||
}
|
||||
|
||||
public AppExpandableAdapter(List<PackageInfo> pInfos, Context context) {
|
||||
for (PackageInfo i : pInfos) {
|
||||
allList.add(new GroupInfo(i.applicationInfo.loadLabel(mPackageManager).toString(), i));
|
||||
}
|
||||
Collections.sort(allList, new LabelCompare());
|
||||
groupPadding = context.getResources().getDimensionPixelSize(R.dimen.shortcut_picker_left_padding);
|
||||
}
|
||||
|
||||
public String getChild(int groupPosition, int childPosition) {
|
||||
return allList.get(groupPosition).info.activities[childPosition].name;
|
||||
}
|
||||
|
||||
public long getChildId(int groupPosition, int childPosition) {
|
||||
return childPosition;
|
||||
}
|
||||
|
||||
public int getChildrenCount(int groupPosition) {
|
||||
if (allList.get(groupPosition).info.activities != null) {
|
||||
return allList.get(groupPosition).info.activities.length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
|
||||
View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = View.inflate(mParent, android.R.layout.simple_list_item_1, null);
|
||||
convertView.setPadding(groupPadding, 0, 0, 0);
|
||||
|
||||
}
|
||||
TextView textView = (TextView)convertView.findViewById(android.R.id.text1);
|
||||
textView.setText(getChild(groupPosition, childPosition).replaceFirst(allList.get(groupPosition).info.packageName + ".", ""));
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public GroupInfo getGroup(int groupPosition) {
|
||||
return allList.get(groupPosition);
|
||||
}
|
||||
|
||||
public int getGroupCount() {
|
||||
return allList.size();
|
||||
}
|
||||
|
||||
public long getGroupId(int groupPosition) {
|
||||
return groupPosition;
|
||||
}
|
||||
|
||||
public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
|
||||
ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = View.inflate(mParent, android.R.layout.simple_list_item_1, null);
|
||||
convertView.setPadding(70, 0, 0, 0);
|
||||
}
|
||||
TextView textView = (TextView)convertView.findViewById(android.R.id.text1);
|
||||
textView.setText(getGroup(groupPosition).label.toString());
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasStableIds() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void completeSetCustomApp(Intent data) {
|
||||
mListener.shortcutPicked(data.toUri(0), getFriendlyActivityName(data, false), true);
|
||||
}
|
||||
|
||||
private void completeSetCustomShortcut(Intent data) {
|
||||
Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
|
||||
if (intent == null) return;
|
||||
// preserve shortcut name, we want to restore it later
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME));
|
||||
// standardize the uri scheme to be sure we can launch it
|
||||
// TODO: add compatibility for apps that use ACTION_CONFIRM_PIN_SHORTCUT (drag widget on the home screen)
|
||||
String appUri = intent.toUri(Intent.URI_INTENT_SCHEME);
|
||||
appUri = appUri.replaceAll("com.android.contacts.action.QUICK_CONTACT", "android.intent.action.VIEW");
|
||||
mListener.shortcutPicked(appUri, getFriendlyShortcutName(intent), false);
|
||||
}
|
||||
|
||||
private String getFriendlyActivityName(Intent intent, boolean labelOnly) {
|
||||
ActivityInfo ai = intent.resolveActivityInfo(mPackageManager, PackageManager.GET_ACTIVITIES);
|
||||
String friendlyName = null;
|
||||
if (ai != null) {
|
||||
friendlyName = ai.loadLabel(mPackageManager).toString();
|
||||
if (friendlyName == null && !labelOnly) {
|
||||
friendlyName = ai.name;
|
||||
}
|
||||
}
|
||||
return friendlyName != null || labelOnly ? friendlyName : intent.toUri(0);
|
||||
}
|
||||
|
||||
private String getFriendlyShortcutName(Intent intent) {
|
||||
String activityName = getFriendlyActivityName(intent, true);
|
||||
String name = intent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
|
||||
|
||||
if (activityName != null && name != null) {
|
||||
return activityName + ": " + name;
|
||||
}
|
||||
return name != null ? name : intent.toUri(0);
|
||||
}
|
||||
|
||||
public String getFriendlyNameForUri(String uri) {
|
||||
if (uri == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Intent intent = Intent.parseUri(uri, 0);
|
||||
if (Intent.ACTION_MAIN.equals(intent.getAction())) {
|
||||
return getFriendlyActivityName(intent, false);
|
||||
}
|
||||
return getFriendlyShortcutName(intent);
|
||||
} catch (URISyntaxException e) {
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2022 cherishOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
import android.hardware.biometrics.BiometricManager
|
||||
import android.hardware.biometrics.BiometricManager.Authenticators.BIOMETRIC_STRONG
|
||||
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
||||
import com.cherish.settings.CherishTogglePreferenceController
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
private const val KEY = "app_lock_biometrics_allowed"
|
||||
|
||||
class AppLockBiometricPreferenceController(
|
||||
context: Context,
|
||||
private val coroutineScope: CoroutineScope
|
||||
) : CherishTogglePreferenceController(context, KEY) {
|
||||
|
||||
private val appLockManager = context.getSystemService(AppLockManager::class.java)
|
||||
private val biometricManager = context.getSystemService(BiometricManager::class.java)
|
||||
|
||||
private var preference: Preference? = null
|
||||
private var isBiometricsAllowed = false
|
||||
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
isBiometricsAllowed = withContext(Dispatchers.Default) {
|
||||
appLockManager.isBiometricsAllowed()
|
||||
}
|
||||
preference?.let {
|
||||
updateState(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAvailabilityStatus(): Int {
|
||||
val result = biometricManager.canAuthenticate(BIOMETRIC_STRONG)
|
||||
return if (result == BiometricManager.BIOMETRIC_SUCCESS) AVAILABLE else CONDITIONALLY_UNAVAILABLE
|
||||
}
|
||||
|
||||
override fun isChecked() = isBiometricsAllowed
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (isBiometricsAllowed == checked) return false
|
||||
isBiometricsAllowed = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
appLockManager.setBiometricsAllowed(isBiometricsAllowed)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun displayPreference(screen: PreferenceScreen) {
|
||||
super.displayPreference(screen)
|
||||
preference = screen.findPreference(preferenceKey)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.hardware.biometrics.BiometricConstants
|
||||
import android.hardware.biometrics.BiometricManager.Authenticators
|
||||
import android.hardware.biometrics.BiometricPrompt
|
||||
import android.hardware.biometrics.BiometricPrompt.AuthenticationCallback
|
||||
import android.hardware.biometrics.PromptInfo
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.UserHandle.USER_NULL
|
||||
import android.os.UserManager
|
||||
import android.util.Log
|
||||
import android.view.WindowManager
|
||||
|
||||
import androidx.fragment.app.commit
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
||||
import com.android.internal.widget.LockPatternUtils
|
||||
import com.android.settings.R
|
||||
import com.android.settings.password.BiometricFragment
|
||||
import com.android.settings.password.ConfirmDeviceCredentialUtils
|
||||
|
||||
class AppLockCredentialActivity : FragmentActivity() {
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
private lateinit var lockPatternUtils: LockPatternUtils
|
||||
private lateinit var userManager: UserManager
|
||||
private lateinit var appLockManager: AppLockManager
|
||||
|
||||
private var packageName: String? = null
|
||||
private var title: String? = null
|
||||
private var userId: Int = USER_NULL
|
||||
private var biometricFragment: BiometricFragment? = null
|
||||
private var goingToBackground = false
|
||||
private var waitingForBiometricCallback = false
|
||||
|
||||
private val authenticationCallback = object : AuthenticationCallback() {
|
||||
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
|
||||
if (!goingToBackground) {
|
||||
waitingForBiometricCallback = false
|
||||
if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED
|
||||
|| errorCode == BiometricPrompt.BIOMETRIC_ERROR_CANCELED) {
|
||||
finish()
|
||||
}
|
||||
} else if (waitingForBiometricCallback) { // goingToBackground is true
|
||||
waitingForBiometricCallback = false
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
||||
waitingForBiometricCallback = false
|
||||
appLockManager.unlockPackage(packageName)
|
||||
ConfirmDeviceCredentialUtils.checkForPendingIntent(this@AppLockCredentialActivity)
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onAuthenticationFailed() {
|
||||
waitingForBiometricCallback = false
|
||||
}
|
||||
|
||||
override fun onSystemEvent(event: Int) {
|
||||
if (event == BiometricConstants.BIOMETRIC_SYSTEM_EVENT_EARLY_USER_CANCEL) {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override protected fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
window.apply {
|
||||
addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
||||
statusBarColor = Color.TRANSPARENT
|
||||
}
|
||||
|
||||
appLockManager = getSystemService(AppLockManager::class.java)
|
||||
userManager = UserManager.get(this)
|
||||
lockPatternUtils = LockPatternUtils(this)
|
||||
|
||||
packageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME)
|
||||
if (packageName == null) {
|
||||
Log.e(TAG, "Failed to get package name, aborting unlock")
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
title = intent.getStringExtra(AppLockManager.EXTRA_PACKAGE_LABEL)
|
||||
|
||||
userId = intent.getIntExtra(Intent.EXTRA_USER_ID, USER_NULL)
|
||||
if (userId == USER_NULL) {
|
||||
Log.e(TAG, "Invalid user id, aborting")
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
val biometricsAllowed = intent.getBooleanExtra(
|
||||
AppLockManager.EXTRA_ALLOW_BIOMETRICS,
|
||||
AppLockManager.DEFAULT_BIOMETRICS_ALLOWED
|
||||
)
|
||||
var authenticators = Authenticators.DEVICE_CREDENTIAL
|
||||
if (biometricsAllowed) {
|
||||
authenticators = authenticators or Authenticators.BIOMETRIC_STRONG
|
||||
}
|
||||
|
||||
val promptInfo = PromptInfo().also {
|
||||
it.title = getString(com.android.internal.R.string.unlock_application, title)
|
||||
it.isDisallowBiometricsIfPolicyExists = true
|
||||
it.authenticators = authenticators
|
||||
}
|
||||
|
||||
if (isBiometricAllowed()) {
|
||||
// Don't need to check if biometrics / pin/pattern/pass are enrolled. It will go to
|
||||
// onAuthenticationError and do the right thing automatically.
|
||||
showBiometricPrompt(promptInfo)
|
||||
waitingForBiometricCallback = true
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override protected fun onStart() {
|
||||
super.onStart()
|
||||
// Translucent activity that is "visible", so it doesn't complain about finish()
|
||||
// not being called before onResume().
|
||||
setVisible(true)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (!isChangingConfigurations()) {
|
||||
goingToBackground = true
|
||||
if (!waitingForBiometricCallback) {
|
||||
finish()
|
||||
}
|
||||
} else {
|
||||
goingToBackground = false
|
||||
}
|
||||
}
|
||||
|
||||
// User could be locked while Effective user is unlocked even though the effective owns the
|
||||
// credential. Otherwise, biometric can't unlock fbe/keystore through
|
||||
// verifyTiedProfileChallenge. In such case, we also wanna show the user message that
|
||||
// biometric is disabled due to device restart.
|
||||
private fun isStrongAuthRequired() =
|
||||
!lockPatternUtils.isBiometricAllowedForUser(userId) ||
|
||||
!userManager.isUserUnlocked(userId)
|
||||
|
||||
private fun isBiometricAllowed() =
|
||||
!isStrongAuthRequired() && !lockPatternUtils.hasPendingEscrowToken(userId)
|
||||
|
||||
private fun showBiometricPrompt(promptInfo: PromptInfo) {
|
||||
biometricFragment = supportFragmentManager.findFragmentByTag(TAG_BIOMETRIC_FRAGMENT)
|
||||
as? BiometricFragment
|
||||
var newFragment = false
|
||||
if (biometricFragment == null) {
|
||||
biometricFragment = BiometricFragment.newInstance(promptInfo)
|
||||
newFragment = true
|
||||
}
|
||||
biometricFragment?.also {
|
||||
it.setCallbacks({
|
||||
handler.post(it)
|
||||
}, authenticationCallback)
|
||||
it.setUser(userId)
|
||||
}
|
||||
if (newFragment) {
|
||||
biometricFragment?.let {
|
||||
supportFragmentManager.commit {
|
||||
add(it, TAG_BIOMETRIC_FRAGMENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AppLockCredentialActivity"
|
||||
private const val TAG_BIOMETRIC_FRAGMENT = "fragment"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
||||
import com.cherish.settings.CherishTogglePreferenceController
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
private const val KEY = "redact_notifications"
|
||||
|
||||
class AppLockNotificationRedactionPC(
|
||||
context: Context,
|
||||
private val packageName: String,
|
||||
private val coroutineScope: CoroutineScope
|
||||
) : CherishTogglePreferenceController(context, KEY) {
|
||||
|
||||
private val appLockManager = context.getSystemService(AppLockManager::class.java)
|
||||
private var shouldRedactNotification = false
|
||||
private var preference: Preference? = null
|
||||
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
shouldRedactNotification = withContext(Dispatchers.Default) {
|
||||
appLockManager.packageData.find {
|
||||
it.packageName == packageName
|
||||
}?.shouldRedactNotification == true
|
||||
}
|
||||
preference?.let {
|
||||
updateState(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAvailabilityStatus() = AVAILABLE
|
||||
|
||||
override fun isChecked() = shouldRedactNotification
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (shouldRedactNotification == checked) return false
|
||||
shouldRedactNotification = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
appLockManager.setShouldRedactNotification(packageName, checked)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun displayPreference(screen: PreferenceScreen) {
|
||||
super.displayPreference(screen)
|
||||
preference = screen.findPreference(preferenceKey)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
||||
import com.android.settings.R
|
||||
import com.android.settings.widget.EntityHeaderController
|
||||
import com.android.settingslib.core.AbstractPreferenceController
|
||||
import com.android.settingslib.widget.LayoutPreference
|
||||
import com.cherish.settings.fragments.CherishDashboardFragment
|
||||
|
||||
private val TAG = AppLockPackageConfigFragment::class.simpleName
|
||||
private const val KEY_HEADER = "header_view"
|
||||
|
||||
class AppLockPackageConfigFragment : CherishDashboardFragment() {
|
||||
|
||||
private lateinit var pm: PackageManager
|
||||
private lateinit var packageInfo: PackageInfo
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
pm = context.packageManager
|
||||
packageInfo = arguments?.getParcelable(PACKAGE_INFO, PackageInfo::class.java)!!
|
||||
super.onAttach(context)
|
||||
}
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey)
|
||||
val header = preferenceScreen.findPreference<LayoutPreference>(KEY_HEADER)
|
||||
EntityHeaderController.newInstance(
|
||||
requireActivity(),
|
||||
this,
|
||||
header?.findViewById(R.id.entity_header)
|
||||
).setRecyclerView(listView, settingsLifecycle)
|
||||
.setPackageName(packageInfo.packageName)
|
||||
.setButtonActions(
|
||||
EntityHeaderController.ActionType.ACTION_NONE,
|
||||
EntityHeaderController.ActionType.ACTION_NONE
|
||||
)
|
||||
.bindHeaderButtons()
|
||||
.setLabel(getLabel(packageInfo))
|
||||
.setIcon(getIcon(packageInfo))
|
||||
.done(requireActivity(), false /* rebindActions */)
|
||||
}
|
||||
|
||||
private fun getLabel(packageInfo: PackageInfo) =
|
||||
packageInfo.applicationInfo.loadLabel(pm).toString()
|
||||
|
||||
private fun getIcon(packageInfo: PackageInfo) =
|
||||
packageInfo.applicationInfo.loadIcon(pm)
|
||||
|
||||
override protected fun createPreferenceControllers(
|
||||
context: Context
|
||||
) : List<AbstractPreferenceController> = listOf(
|
||||
AppLockPackageProtectionPC(context, packageInfo.packageName, lifecycleScope),
|
||||
AppLockNotificationRedactionPC(context, packageInfo.packageName, lifecycleScope),
|
||||
)
|
||||
|
||||
override protected fun getPreferenceScreenResId() = R.xml.app_lock_package_config_settings
|
||||
|
||||
override protected fun getLogTag() = TAG
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.PackageManager.PackageInfoFlags
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.forEach
|
||||
|
||||
import com.android.settings.R
|
||||
import com.android.settings.core.SubSettingLauncher
|
||||
import com.android.settingslib.PrimarySwitchPreference
|
||||
import com.android.settingslib.widget.TwoTargetPreference.ICON_SIZE_SMALL
|
||||
import com.cherish.settings.fragments.CherishDashboardFragment
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
private val TAG = AppLockPackageListFragment::class.simpleName
|
||||
internal const val PACKAGE_INFO = "package_info"
|
||||
|
||||
class AppLockPackageListFragment : CherishDashboardFragment() {
|
||||
|
||||
private lateinit var appLockManager: AppLockManager
|
||||
private lateinit var pm: PackageManager
|
||||
private lateinit var whiteListedPackages: Array<String>
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
appLockManager = context.getSystemService(AppLockManager::class.java)
|
||||
pm = context.packageManager
|
||||
whiteListedPackages = resources.getStringArray(
|
||||
com.android.internal.R.array.config_appLockAllowedSystemApps)
|
||||
}
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey)
|
||||
lifecycleScope.launch {
|
||||
val selectedPackages = getSelectedPackages()
|
||||
val preferences = withContext(Dispatchers.Default) {
|
||||
pm.getInstalledPackages(
|
||||
PackageInfoFlags.of(PackageManager.MATCH_ALL.toLong())
|
||||
).filter {
|
||||
!it.applicationInfo.isSystemApp() || whiteListedPackages.contains(it.packageName)
|
||||
}.sortedWith { first, second ->
|
||||
getLabel(first).compareTo(getLabel(second))
|
||||
}
|
||||
}.map { packageInfo ->
|
||||
createPreference(packageInfo, selectedPackages.contains(packageInfo.packageName))
|
||||
}
|
||||
preferenceScreen?.let {
|
||||
preferences.forEach { pref ->
|
||||
it.addPreference(pref)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
lifecycleScope.launch {
|
||||
val selectedPackages = getSelectedPackages()
|
||||
preferenceScreen?.forEach {
|
||||
if (it is PrimarySwitchPreference) {
|
||||
it.isChecked = selectedPackages.contains(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getSelectedPackages(): Set<String> {
|
||||
return withContext(Dispatchers.IO) {
|
||||
appLockManager.packageData.map { it.packageName }.toSet()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getLabel(packageInfo: PackageInfo) =
|
||||
packageInfo.applicationInfo.loadLabel(pm).toString()
|
||||
|
||||
private fun createPreference(packageInfo: PackageInfo, isProtected: Boolean): Preference {
|
||||
val label = getLabel(packageInfo)
|
||||
return PrimarySwitchPreference(requireContext()).apply {
|
||||
key = packageInfo.packageName
|
||||
title = label
|
||||
icon = packageInfo.applicationInfo.loadIcon(pm)
|
||||
setIconSize(ICON_SIZE_SMALL)
|
||||
isChecked = isProtected
|
||||
setOnPreferenceChangeListener { _, newValue ->
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
if (newValue as Boolean) {
|
||||
appLockManager.addPackage(packageInfo.packageName)
|
||||
} else {
|
||||
appLockManager.removePackage(packageInfo.packageName)
|
||||
}
|
||||
}
|
||||
return@setOnPreferenceChangeListener true
|
||||
}
|
||||
setOnPreferenceClickListener {
|
||||
SubSettingLauncher(requireContext())
|
||||
.setDestination(AppLockPackageConfigFragment::class.qualifiedName)
|
||||
.setSourceMetricsCategory(metricsCategory)
|
||||
.setTitleText(label)
|
||||
.setArguments(
|
||||
Bundle(1).apply {
|
||||
putParcelable(PACKAGE_INFO, packageInfo)
|
||||
}
|
||||
)
|
||||
.launch()
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override protected fun getPreferenceScreenResId() = R.xml.app_lock_package_list_settings
|
||||
|
||||
override protected fun getLogTag() = TAG
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
||||
import com.cherish.settings.CherishTogglePreferenceController
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
private const val KEY = "main_switch"
|
||||
|
||||
class AppLockPackageProtectionPC(
|
||||
context: Context,
|
||||
private val packageName: String,
|
||||
private val coroutineScope: CoroutineScope
|
||||
) : CherishTogglePreferenceController(context, KEY) {
|
||||
|
||||
private val appLockManager = context.getSystemService(AppLockManager::class.java)
|
||||
private var isProtected = false
|
||||
private var preference: Preference? = null
|
||||
|
||||
init {
|
||||
coroutineScope.launch {
|
||||
isProtected = withContext(Dispatchers.Default) {
|
||||
appLockManager.packageData.any {
|
||||
it.packageName == packageName
|
||||
}
|
||||
}
|
||||
preference?.let {
|
||||
updateState(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAvailabilityStatus() = AVAILABLE
|
||||
|
||||
override fun isChecked() = isProtected
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (isProtected == checked) return false
|
||||
isProtected = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
if (isProtected) {
|
||||
appLockManager.addPackage(packageName)
|
||||
} else {
|
||||
appLockManager.removePackage(packageName)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun displayPreference(screen: PreferenceScreen) {
|
||||
super.displayPreference(screen)
|
||||
preference = screen.findPreference(preferenceKey)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemProperties
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
||||
import com.android.settings.R
|
||||
import com.android.settings.search.BaseSearchIndexProvider
|
||||
import com.android.settingslib.core.AbstractPreferenceController
|
||||
import com.android.settingslib.search.SearchIndexable
|
||||
import com.cherish.settings.fragments.CherishDashboardFragment
|
||||
|
||||
@SearchIndexable
|
||||
class AppLockSettingsFragment : CherishDashboardFragment(),
|
||||
MenuItem.OnMenuItemClickListener {
|
||||
|
||||
private var debugEnabled = SystemProperties.get(DEBUG_PROPERTY, null) == LEVEL_DEBUG
|
||||
private var handledClick = false
|
||||
|
||||
override protected fun getPreferenceScreenResId() = R.xml.cherish_settings_app_lock
|
||||
|
||||
override protected fun getLogTag() = TAG
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) {
|
||||
super.onCreateOptionsMenu(menu, menuInflater)
|
||||
menu.add(
|
||||
0 /* groupId */,
|
||||
MENU_ITEM_DEBUG_ID,
|
||||
0 /* order */,
|
||||
getDebugMenuItemTitle(),
|
||||
).setOnMenuItemClickListener(this)
|
||||
}
|
||||
|
||||
private fun getDebugMenuItemTitle(): Int =
|
||||
if (debugEnabled) R.string.disable_debugging else R.string.enable_debugging
|
||||
|
||||
override fun onMenuItemClick(item: MenuItem): Boolean {
|
||||
if (item.itemId == MENU_ITEM_DEBUG_ID) {
|
||||
debugEnabled = !debugEnabled
|
||||
SystemProperties.set(DEBUG_PROPERTY, if (debugEnabled) LEVEL_DEBUG else null)
|
||||
item.setTitle(getDebugMenuItemTitle())
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override protected fun createPreferenceControllers(
|
||||
context: Context
|
||||
) : List<AbstractPreferenceController> = listOf(
|
||||
AppLockBiometricPreferenceController(context, lifecycleScope)
|
||||
)
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AppLockSettingsFragment"
|
||||
|
||||
private const val DEBUG_PROPERTY = "log.tag.AppLockManagerService"
|
||||
private const val LEVEL_DEBUG = "DEBUG"
|
||||
private const val MENU_ITEM_DEBUG_ID = 101
|
||||
|
||||
@JvmField
|
||||
val SEARCH_INDEX_DATA_PROVIDER = BaseSearchIndexProvider(R.xml.cherish_settings_app_lock)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.AppLockManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.UserHandle
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
||||
import com.android.internal.widget.LockPatternUtils
|
||||
import com.android.settings.R
|
||||
import com.android.settings.core.SubSettingLauncher
|
||||
import com.android.settings.dashboard.DashboardFragment
|
||||
import com.android.settings.password.ConfirmDeviceCredentialActivity
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle
|
||||
import com.android.settingslib.transition.SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE
|
||||
import com.android.settings.core.BasePreferenceController
|
||||
|
||||
import com.android.settings.SettingsActivity
|
||||
import com.android.settings.core.SettingsBaseActivity
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider
|
||||
|
||||
class AppLockSettingsPreferenceController(
|
||||
context: Context,
|
||||
preferenceKey: String,
|
||||
lifecycle: Lifecycle?,
|
||||
private val host: DashboardFragment?
|
||||
) : BasePreferenceController(context, preferenceKey),
|
||||
LifecycleEventObserver {
|
||||
|
||||
private val lockPatternUtils = LockPatternUtils(context)
|
||||
private val appLockManager = context.getSystemService(AppLockManager::class.java)
|
||||
private var preference: Preference? = null
|
||||
private val securityPromptLauncher: ActivityResultLauncher<Intent>?
|
||||
|
||||
init {
|
||||
lifecycle?.addObserver(this)
|
||||
securityPromptLauncher = host?.registerForActivityResult(
|
||||
StartActivityForResult()
|
||||
) {
|
||||
if (it?.resultCode == Activity.RESULT_OK) {
|
||||
val intent = SubSettingLauncher(mContext)
|
||||
.setDestination(AppLockSettingsFragment::class.qualifiedName)
|
||||
.setSourceMetricsCategory(host.metricsCategory)
|
||||
.setTransitionType(TRANSITION_SLIDE)
|
||||
.toIntent()
|
||||
intent.setClass(mContext, AppLockSubSettings::class.java)
|
||||
mContext.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAvailabilityStatus() =
|
||||
if (lockPatternUtils.isSecure(UserHandle.myUserId()))
|
||||
AVAILABLE
|
||||
else
|
||||
DISABLED_DEPENDENT_SETTING
|
||||
|
||||
override fun onStateChanged(owner: LifecycleOwner, event: Event) {
|
||||
if (event == Event.ON_START) {
|
||||
preference?.let {
|
||||
updateState(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun displayPreference(screen: PreferenceScreen) {
|
||||
super.displayPreference(screen)
|
||||
preference = screen.findPreference(preferenceKey)
|
||||
}
|
||||
|
||||
override fun updateState(preference: Preference) {
|
||||
preference.apply {
|
||||
if (getAvailabilityStatus() == AVAILABLE) {
|
||||
setEnabled(true)
|
||||
summary = getSummaryForListSize(appLockManager.packageData.size)
|
||||
} else {
|
||||
setEnabled(false)
|
||||
summary = mContext.getString(R.string.disabled_because_no_backup_security)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getSummaryForListSize(size: Int): CharSequence? =
|
||||
if (size == 0) {
|
||||
null
|
||||
} else {
|
||||
mContext.resources.getQuantityString(R.plurals.app_lock_summary, size, size)
|
||||
}
|
||||
|
||||
override fun handlePreferenceTreeClick(preference: Preference): Boolean {
|
||||
if (preference.key == preferenceKey && securityPromptLauncher != null) {
|
||||
securityPromptLauncher.launch(
|
||||
ConfirmDeviceCredentialActivity.createIntent(
|
||||
mContext.getString(R.string.app_lock_authentication_dialog_title),
|
||||
null /* details */,
|
||||
)
|
||||
)
|
||||
return true
|
||||
}
|
||||
return super.handlePreferenceTreeClick(preference)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2022 FlamingoOS 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.
|
||||
*/
|
||||
|
||||
package com.cherish.settings.security.applock
|
||||
|
||||
import com.android.settings.SettingsActivity
|
||||
|
||||
class AppLockSubSettings : SettingsActivity() {
|
||||
|
||||
override protected fun isValidFragment(fragmentName: String): Boolean {
|
||||
return AppLockSettingsFragment::class.qualifiedName == fragmentName
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user