Add Autoclick cursor area size settings dialog

Replace Autoclick sliderbar with an alert dialog
and radio group to match the new UI requirement.

Screenshot:
 - Click area column:
   go/screenshot-5AfdF7FGghsdiXk
 - Alert dialog:
   go/screenshot-4dgtojcc6lvjtyy

Bug: 390460480
Test: ToggleAutoclickCustomSeekbarControllerTest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: Ic79f8833e69dde8d8eb3e945e5acd551d2ee9ff5
This commit is contained in:
Yuhan Yang
2025-02-04 07:33:49 +00:00
parent 43dc7840ef
commit 7630d396a6
6 changed files with 226 additions and 135 deletions

View File

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 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/autoclick_cursor_area_size_dialog_title"
android:text="@string/autoclick_cursor_area_size_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="26dp"
android:textSize="20sp"
android:textColor="?android:attr/textColorPrimary"
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
/>
<TextView
android:id="@+id/autoclick_cursor_area_size_dialog_subtitle"
android:text="@string/autoclick_cursor_area_size_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="26dp"
android:layout_marginTop="8dp"
android:textSize="16sp"
android:textColor="?android:attr/textColorSecondary"
/>
<RadioGroup
android:id="@+id/autoclick_cursor_area_size_value_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="16dp">
<RadioButton
android:id="@+id/autoclick_cursor_area_size_value_extra_small"
android:text="@string/autoclick_cursor_area_size_dialog_option_extra_small"
style="@style/AutoclickDialogRadioButton"/>
<RadioButton
android:id="@+id/autoclick_cursor_area_size_value_small"
android:text="@string/autoclick_cursor_area_size_dialog_option_small"
style="@style/AutoclickDialogRadioButton"/>
<RadioButton
android:id="@+id/autoclick_cursor_area_size_value_default"
android:text="@string/autoclick_cursor_area_size_dialog_option_default"
style="@style/AutoclickDialogRadioButton"/>
<RadioButton
android:id="@+id/autoclick_cursor_area_size_value_large"
android:text="@string/autoclick_cursor_area_size_dialog_option_large"
style="@style/AutoclickDialogRadioButton"/>
<RadioButton
android:id="@+id/autoclick_cursor_area_size_value_extra_large"
android:text="@string/autoclick_cursor_area_size_dialog_option_extra_large"
style="@style/AutoclickDialogRadioButton"/>
</RadioGroup>
</LinearLayout>