Increase touch region for checkbox in letterbox restart dialog

Make the touch region to toggle the checkbox state a minimum of 48x48dp
around the checkbox itself as well as the text and parent container
associated with the checkbox. Thus making the new touch region 48dp high
and the width of the parent container

Fixes: 278589504
Test: atest WMShellUnitTests:LetterboxEduDialogLayoutTest
Test: atest WMShellUnitTests:LetterboxEduWindowManagerTest
Test: atest WMShellUnitTests:CompatUIControllerTest
Change-Id: Ia124897f92717eea4ddef3b2431a43adedde0f8c
This commit is contained in:
Eghosa Ewansiha-Vlachavas
2023-04-21 15:45:30 +00:00
parent 820fe8475a
commit 844bbfac2a
2 changed files with 7 additions and 1 deletions

View File

@@ -73,11 +73,13 @@
android:textAlignment="center"/>
<LinearLayout
android:id="@+id/letterbox_restart_dialog_checkbox_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="14dp"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
android:layout_marginVertical="32dp">
android:layout_marginVertical="18dp">
<CheckBox
android:id="@+id/letterbox_restart_dialog_checkbox"

View File

@@ -95,6 +95,9 @@ public class RestartDialogLayout extends ConstraintLayout implements DialogConta
@Override
protected void onFinishInflate() {
super.onFinishInflate();
final View checkboxContainer = findViewById(
R.id.letterbox_restart_dialog_checkbox_container);
final CheckBox checkbox = findViewById(R.id.letterbox_restart_dialog_checkbox);
mDialogContainer = findViewById(R.id.letterbox_restart_dialog_container);
mDialogTitle = findViewById(R.id.letterbox_restart_dialog_title);
mBackgroundDim = getBackground().mutate();
@@ -103,5 +106,6 @@ public class RestartDialogLayout extends ConstraintLayout implements DialogConta
// We add a no-op on-click listener to the dialog container so that clicks on it won't
// propagate to the listener of the layout (which represents the background dim).
mDialogContainer.setOnClickListener(view -> {});
checkboxContainer.setOnClickListener(view -> checkbox.performClick());
}
}