[Physical Keyboard] Add slow keys dialog
demo: https://screenshot.googleplex.com/7CPpfHvAixe9Awr.png Add dialog for Slow keys, which have same set up with Bounce keys. Move dialog logic to InputSettingPreferenceController, to reuse it from slow keys controller. Bug: 346949547 Test: atest SettingsRoboTests Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled Change-Id: Ia4d74fcf3f20ed68cb252503e88d99ea79eae291
This commit is contained in:
committed by
Shaowei Shen
parent
9936dae2be
commit
7aefcf71b6
@@ -22,47 +22,45 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bounce_key_dialog_title"
|
||||
android:id="@+id/input_setting_keys_dialog_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/bounce_keys_dialog_title"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bounce_key_dialog_subtitle"
|
||||
android:id="@+id/input_setting_keys_dialog_subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="26dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center"
|
||||
android:text="@string/bounce_keys_dialog_subtitle"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/bounce_key_value_group"
|
||||
android:id="@+id/input_setting_keys_value_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/bounce_key_value_200"
|
||||
android:text="@string/bounce_keys_dialog_option_200"
|
||||
android:id="@+id/input_setting_keys_value_200"
|
||||
android:text="@string/input_setting_keys_dialog_option_200"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:background="@null"/>
|
||||
<RadioButton
|
||||
android:id="@+id/bounce_key_value_400"
|
||||
android:text="@string/bounce_keys_dialog_option_400"
|
||||
android:id="@+id/input_setting_keys_value_400"
|
||||
android:text="@string/input_setting_keys_dialog_option_400"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -70,8 +68,8 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@null"/>
|
||||
<RadioButton
|
||||
android:id="@+id/bounce_key_value_600"
|
||||
android:text="@string/bounce_keys_dialog_option_600"
|
||||
android:id="@+id/input_setting_keys_value_600"
|
||||
android:text="@string/input_setting_keys_dialog_option_600"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -85,14 +83,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="12dp">
|
||||
<RadioButton
|
||||
android:id="@+id/bounce_key_value_custom"
|
||||
android:id="@+id/input_setting_keys_value_custom"
|
||||
android:paddingStart="12dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/custom_value_option"
|
||||
android:id="@+id/input_setting_keys_custom_value_option"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -100,15 +98,15 @@
|
||||
android:gravity="center_vertical"
|
||||
android:paddingEnd="16dp">
|
||||
<TextView
|
||||
android:id="@+id/bounce_key_value_custom_title"
|
||||
android:text="Custom"
|
||||
android:id="@+id/input_setting_keys_value_custom_title"
|
||||
android:text="@string/input_setting_keys_custom_title"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"/>
|
||||
<TextView
|
||||
android:id="@+id/bounce_key_value_custom_value"
|
||||
android:text="custom value"
|
||||
android:id="@+id/input_setting_keys_value_custom_value"
|
||||
android:text="@string/input_setting_keys_custom_value"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -116,7 +114,7 @@
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone"/>
|
||||
<SeekBar
|
||||
android:id="@+id/bounce_key_value_custom_slider"
|
||||
android:id="@+id/input_setting_keys_value_custom_slider"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="36dp"
|
||||
android:min="1"
|
@@ -4525,12 +4525,17 @@
|
||||
<string name="bounce_keys_dialog_title">Bounce key threshold</string>
|
||||
<!-- Subtitle for the 'Bounce keys' threshold dialog. [CHAR LIMIT=300] -->
|
||||
<string name="bounce_keys_dialog_subtitle">Choose the duration of time your keyboard ignores repeated key presses</string>
|
||||
<!-- Option title for the 'Bounce keys' threshold dialog for 200 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="bounce_keys_dialog_option_200">0.2s</string>
|
||||
<!-- Option title for the 'Bounce keys' threshold dialog for 400 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="bounce_keys_dialog_option_400">0.4s</string>
|
||||
<!-- Option title for the 'Bounce keys' threshold dialog for 600 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="bounce_keys_dialog_option_600">0.6s</string>
|
||||
<!-- Option title for the input setting keys threshold dialog for 200 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="input_setting_keys_dialog_option_200">0.2s</string>
|
||||
<!-- Option title for the input setting keys threshold dialog for 400 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="input_setting_keys_dialog_option_400">0.4s</string>
|
||||
<!-- Option title for the input setting keys threshold dialog for 600 millisecond. [CHAR LIMIT=35] -->
|
||||
<string name="input_setting_keys_dialog_option_600">0.6s</string>
|
||||
<!-- Option title for the input setting keys threshold dialog for custom value. [CHAR LIMIT=35] -->
|
||||
<string name="input_setting_keys_custom_title">Custom</string>
|
||||
<!-- Option subtitle for the input setting keys threshold dialog for custom value. [CHAR LIMIT=35] -->
|
||||
<string name="input_setting_keys_custom_value">custom value</string>
|
||||
|
||||
<!-- Title for the 'Slow keys' preference switch. [CHAR LIMIT=35] -->
|
||||
<string name="slow_keys">Slow keys</string>
|
||||
<!-- Summary text for the 'Slow keys' preference sub-screen. [CHAR LIMIT=300] -->
|
||||
|
@@ -19,35 +19,35 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/keyboard_a11y_settings"
|
||||
android:key="physical_keyboard_a11y">
|
||||
android:key="physical_keyboard_a11y_page">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="keyboard_a11y_category"
|
||||
android:key="keyboard_a11y_page_category"
|
||||
android:title="@string/keyboard_a11y_category">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="accessibility_sticky_keys"
|
||||
android:key="keyboard_a11y_page_sticky_keys"
|
||||
android:title="@string/sticky_keys"
|
||||
android:summary="@string/sticky_keys_summary"
|
||||
android:defaultValue="false"
|
||||
settings:controller="com.android.settings.inputmethod.KeyboardAccessibilityStickyKeysController"/>
|
||||
|
||||
<com.android.settingslib.PrimarySwitchPreference
|
||||
android:key="accessibility_bounce_keys"
|
||||
android:key="keyboard_a11y_page_bounce_keys"
|
||||
android:title="@string/bounce_keys"
|
||||
android:summary="@string/bounce_keys_summary"
|
||||
android:defaultValue="false"
|
||||
settings:controller="com.android.settings.inputmethod.KeyboardAccessibilityBounceKeysController"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="accessibility_slow_keys"
|
||||
<com.android.settingslib.PrimarySwitchPreference
|
||||
android:key="keyboard_a11y_page_slow_keys"
|
||||
android:title="@string/slow_keys"
|
||||
android:defaultValue="false"
|
||||
android:summary="@string/slow_keys_summary"
|
||||
settings:controller="com.android.settings.inputmethod.KeyboardAccessibilitySlowKeysController" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="accessibility_mouse_keys"
|
||||
android:key="keyboard_a11y_page_mouse_keys"
|
||||
android:title="@string/mouse_keys"
|
||||
android:summary="@string/mouse_keys_summary"
|
||||
android:defaultValue="false"
|
||||
|
Reference in New Issue
Block a user