Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef575758 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Okay, new plan for dialogs.

Don't dismiss by default when tapping outside, even for AlertDialog.

If AlertDialog doesn't have any buttons, tapping outside will dismiss it.

Applications can make their own dialogs (or activities looking like
dialogs) can use the existing and new APIs to control this behavior
themselves so that it does the right thing.

Change-Id: I02bfb9161e169de0033200211b3a7ec80080bd83
parent 36c84403
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -795,8 +795,11 @@ public abstract class Window {
    }
    
    /** @hide */
    public boolean hasSetCloseOnTouchOutside() {
        return mSetCloseOnTouchOutside;
    public void setCloseOnTouchOutsideIfNotSet(boolean close) {
        if (!mSetCloseOnTouchOutside) {
            mCloseOnTouchOutside = close;
            mSetCloseOnTouchOutside = true;
        }
    }
    
    /** @hide */
+1 −0
Original line number Diff line number Diff line
@@ -391,6 +391,7 @@ public class AlertController {
        View buttonPanel = mWindow.findViewById(R.id.buttonPanel);
        if (!hasButtons) {
            buttonPanel.setVisibility(View.GONE);
            mWindow.setCloseOnTouchOutsideIfNotSet(true);
        }

        FrameLayout customPanel = null;
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.internal.app;

import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
+0 −2
Original line number Diff line number Diff line
@@ -22,6 +22,4 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- see comment in values/config.xml -->
    <dimen name="config_prefDialogWidth">440dp</dimen>
    <!-- see comment in values/config.xml -->
    <bool name="config_closeDialogWhenTouchOutside">true</bool>
</resources>
+1 −2
Original line number Diff line number Diff line
@@ -82,8 +82,7 @@
    <dimen name="config_prefDialogWidth">0px</dimen>
    
    <!-- Whether dialogs should close automatically when the user touches outside
         of them.  This should not normally be modified; the default value will
         pick the correct behavior depending on the screen size. -->
         of them.  This should not normally be modified. -->
    <bool name="config_closeDialogWhenTouchOutside">false</bool>
    
    <!-- The duration (in milliseconds) that the radio will scan for a signal
Loading