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

Commit d0e73fb6 authored by The Android Open Source Project's avatar The Android Open Source Project Committed by Android Git Automerger
Browse files

am d3844bcf: merge from froyo-plus-aosp

Merge commit 'd3844bcf'

* commit 'd3844bcf':
  Support custom themes with AlertDialog.Builder
parents 77010419 d3844bcf
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -23711,6 +23711,18 @@
<parameter name="context" type="android.content.Context">
</parameter>
</constructor>
<constructor name="AlertDialog.Builder"
 type="android.app.AlertDialog.Builder"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="theme" type="int">
</parameter>
</constructor>
<method name="create"
 return="android.app.AlertDialog"
 abstract="false"
+11 −1
Original line number Diff line number Diff line
@@ -265,12 +265,22 @@ public class AlertDialog extends Dialog implements DialogInterface {
    
    public static class Builder {
        private final AlertController.AlertParams P;
        private int mTheme;
        
        /**
         * Constructor using a context for this builder and the {@link AlertDialog} it creates.
         */
        public Builder(Context context) {
            this(context, com.android.internal.R.style.Theme_Dialog_Alert);
        }

        /**
         * Constructor using a context and theme for this builder and
         * the {@link AlertDialog} it creates.
         */
        public Builder(Context context, int theme) {
            P = new AlertController.AlertParams(context);
            mTheme = theme;
        }
        
        /**
@@ -783,7 +793,7 @@ public class AlertDialog extends Dialog implements DialogInterface {
         * to do and want this to be created and displayed.
         */
        public AlertDialog create() {
            final AlertDialog dialog = new AlertDialog(P.mContext);
            final AlertDialog dialog = new AlertDialog(P.mContext, mTheme);
            P.apply(dialog.mAlert);
            dialog.setCancelable(P.mCancelable);
            dialog.setOnCancelListener(P.mOnCancelListener);