Cherish:Add some button settings

Hardware key: Customization support[2/2]

Volume Rocker Wake [2/2]

Volume key cursor control (2/2)

Co-authored-by: jhenrique09 <jhsv09@gmail.com>
Co-authored-by: Max <xyyx@mail.ru>
Co-authored-by: bigrushdog <randall.rushing@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Hưng Phan
2022-09-05 23:10:11 +07:00
parent b6c4c176e5
commit 135aefde28
13 changed files with 1671 additions and 83 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View 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>

View 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>

View File

@@ -186,5 +186,51 @@
<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>
</resources>

View File

@@ -113,9 +113,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>
@@ -355,4 +352,119 @@
<!-- 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>
<!-- 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>
</resources>

View File

@@ -18,10 +18,28 @@
android:title="@string/button_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory
<!-- SwitchPreference
android:key="navbar_visibility"
android:title="@string/navigation_bar_title"
android:summary="@string/navigation_bar_summary" />-->
<PreferenceCategory
android:key="navigation_keys"
android:title="@string/navigation_bar_category">
<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"
@@ -36,5 +54,210 @@
</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>

View File

@@ -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>