OSDN Git Service

[Network Connection] Don't dismiss dialog when touching outside of
authorcosmohsieh <cosmohsieh@google.com>
Wed, 20 Mar 2019 06:48:32 +0000 (14:48 +0800)
committercosmohsieh <cosmohsieh@google.com>
Thu, 21 Mar 2019 05:22:36 +0000 (13:22 +0800)
dialog

To Improve user experience, prevent dialog dismissing from touching outside
of the dialog

Bug: 128877712
Test: atest NetworkRequestDialogFragment
Change-Id: Idfa90c3647f5cf766aaa63fdb8a829fec5db5934

src/com/android/settings/wifi/NetworkRequestDialogFragment.java

index 09360e4..bfd8d1c 100644 (file)
@@ -138,6 +138,10 @@ public class NetworkRequestDialogFragment extends InstrumentedDialogFragment imp
                 .setOnItemClickListener(
                         (parent, view, position, id) -> this.onClick(dialog, position));
 
+        // Don't dismiss dialog when touching outside. User report it is easy to touch outside.
+        // This causes dialog to close. Which is concerned as a bad UX (b/128877712).
+        dialog.setCanceledOnTouchOutside(false);
+
         dialog.setOnShowListener((dialogInterface) -> {
             // Replace NeutralButton onClickListener to avoid closing dialog
             final Button neutralBtn = dialog.getButton(AlertDialog.BUTTON_NEUTRAL);