[Physical Keyboard][A11y Page] Add Bounce keys dialog

1.Add dialog for adjust bounce key to different values.
demo video: b/346949547#comment24.
2.Update summary text.
3.When receive update from content uri, update toggle state directly.
4.Rename Controller to more suitable name.

Bug: 346949547
Test: atest SettingsRoboTests
Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled
Change-Id: I94d8d1a77528b13f59b2d67dfa30e17dd177e385
This commit is contained in:
shaoweishen
2024-08-22 10:36:47 +00:00
parent 7c6b213c73
commit f0a01c51dd
9 changed files with 262 additions and 41 deletions

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/bounce_key_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: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: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:paddingStart="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"/>
<RadioButton
android:id="@+id/bounce_key_value_400"
android:text="@string/bounce_keys_dialog_option_400"
android:paddingStart="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="16dp"
android:background="@null"/>
<RadioButton
android:id="@+id/bounce_key_value_600"
android:text="@string/bounce_keys_dialog_option_600"
android:paddingStart="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="16dp"
android:background="@null"/>
</RadioGroup>
</LinearLayout>