Refine AccessibilityGestureNavigationTutorial button type

Root cause: It is weird to display positive text for the negative button.
Solution: Change to the positive button.

Bug: 216189516
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityGestureNavigationTutorialTest
Change-Id: I8ffc6b7b5b510fab159a23af83bca4426f2dc81d
This commit is contained in:
menghanli
2022-07-22 15:11:30 +08:00
parent 2675dbf54a
commit 755d691183
2 changed files with 25 additions and 11 deletions

View File

@@ -95,18 +95,20 @@ public final class AccessibilityGestureNavigationTutorial {
* Displays a dialog that guides users to use accessibility features with accessibility
* gestures under system gesture navigation mode.
*/
public static void showGestureNavigationTutorialDialog(Context context,
public static AlertDialog showGestureNavigationTutorialDialog(Context context,
DialogInterface.OnDismissListener onDismissListener) {
final AlertDialog alertDialog = new AlertDialog.Builder(context)
.setView(createTutorialDialogContentView(context,
DialogType.GESTURE_NAVIGATION_SETTINGS))
.setNegativeButton(R.string.accessibility_tutorial_dialog_button, mOnClickListener)
.setPositiveButton(R.string.accessibility_tutorial_dialog_button, mOnClickListener)
.setOnDismissListener(onDismissListener)
.create();
alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
return alertDialog;
}
static AlertDialog showAccessibilityGestureTutorialDialog(Context context) {
@@ -128,10 +130,10 @@ public final class AccessibilityGestureNavigationTutorial {
.launch();
final AlertDialog alertDialog = new AlertDialog.Builder(context)
.setNegativeButton(R.string.accessibility_tutorial_dialog_link_button,
linkButtonListener)
.setPositiveButton(R.string.accessibility_tutorial_dialog_button,
actionButtonListener)
.setNegativeButton(R.string.accessibility_tutorial_dialog_link_button,
linkButtonListener)
.create();
final TutorialPageChangeListener.OnPageSelectedCallback callback =
@@ -194,7 +196,7 @@ public final class AccessibilityGestureNavigationTutorial {
private static AlertDialog createDialog(Context context, int dialogType) {
final AlertDialog alertDialog = new AlertDialog.Builder(context)
.setView(createTutorialDialogContentView(context, dialogType))
.setNegativeButton(R.string.accessibility_tutorial_dialog_button, mOnClickListener)
.setPositiveButton(R.string.accessibility_tutorial_dialog_button, mOnClickListener)
.create();
alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);