Loading core/java/android/app/AlertDialog.java +1 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class AlertDialog extends Dialog implements DialogInterface { createContextThemeWrapper); mWindow.alwaysReadCloseOnTouchAttr(); mAlert = new AlertController(getContext(), this, getWindow()); mAlert = AlertController.create(getContext(), this, getWindow()); } static int resolveDialogTheme(Context context, int themeResId) { Loading core/java/com/android/internal/app/AlertActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public abstract class AlertActivity extends Activity implements DialogInterface protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAlert = new AlertController(this, this, getWindow()); mAlert = AlertController.create(this, this, getWindow()); mAlertParams = new AlertController.AlertParams(this); } Loading core/java/com/android/internal/app/AlertController.java +19 −7 Original line number Diff line number Diff line Loading @@ -64,11 +64,11 @@ public class AlertController { private final Context mContext; private final DialogInterface mDialogInterface; private final Window mWindow; protected final Window mWindow; private CharSequence mTitle; private CharSequence mMessage; private ListView mListView; protected CharSequence mMessage; protected ListView mListView; private View mView; private int mViewLayoutResId; Loading @@ -91,14 +91,14 @@ public class AlertController { private CharSequence mButtonNeutralText; private Message mButtonNeutralMessage; private ScrollView mScrollView; protected ScrollView mScrollView; private int mIconId = 0; private Drawable mIcon; private ImageView mIconView; private TextView mTitleView; private TextView mMessageView; protected TextView mMessageView; private View mCustomTitleView; private boolean mForceInverseBackground; Loading Loading @@ -176,7 +176,19 @@ public class AlertController { return outValue.data != 0; } public AlertController(Context context, DialogInterface di, Window window) { public static final AlertController create(Context context, DialogInterface di, Window window) { final TypedArray a = context.obtainStyledAttributes( null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); int controllerType = a.getInt(R.styleable.AlertDialog_controllerType, 0); a.recycle(); switch (controllerType) { default: return new AlertController(context, di, window); } } protected AlertController(Context context, DialogInterface di, Window window) { mContext = context; mDialogInterface = di; mWindow = window; Loading Loading @@ -643,7 +655,7 @@ public class AlertController { } } private void setupContent(ViewGroup contentPanel) { protected void setupContent(ViewGroup contentPanel) { mScrollView = (ScrollView) contentPanel.findViewById(R.id.scrollView); mScrollView.setFocusable(false); Loading core/res/res/values/attrs.xml +7 −0 Original line number Diff line number Diff line Loading @@ -2046,6 +2046,13 @@ i <attr name="showTitle" format="boolean" /> <!-- @hide Whether fullDark, etc. should use default values if null. --> <attr name="needsDefaultBackgrounds" format="boolean" /> <!-- @hide Workaround until we replace AlertController with custom layout. --> <attr name="controllerType"> <!-- The default controller. --> <enum name="normal" value="0" /> <!-- Controller for micro specific layout. --> <enum name="micro" value="1" /> </attr> </declare-styleable> <!-- @hide --> Loading services/core/java/com/android/server/policy/GlobalActions.java +1 −1 Original line number Diff line number Diff line Loading @@ -1145,7 +1145,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac public GlobalActionsDialog(Context context, AlertParams params) { super(context, getDialogTheme(context)); mContext = getContext(); mAlert = new AlertController(mContext, this, getWindow()); mAlert = AlertController.create(mContext, this, getWindow()); mAdapter = (MyAdapter) params.mAdapter; mWindowTouchSlop = ViewConfiguration.get(context).getScaledWindowTouchSlop(); params.apply(mAlert); Loading Loading
core/java/android/app/AlertDialog.java +1 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class AlertDialog extends Dialog implements DialogInterface { createContextThemeWrapper); mWindow.alwaysReadCloseOnTouchAttr(); mAlert = new AlertController(getContext(), this, getWindow()); mAlert = AlertController.create(getContext(), this, getWindow()); } static int resolveDialogTheme(Context context, int themeResId) { Loading
core/java/com/android/internal/app/AlertActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public abstract class AlertActivity extends Activity implements DialogInterface protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAlert = new AlertController(this, this, getWindow()); mAlert = AlertController.create(this, this, getWindow()); mAlertParams = new AlertController.AlertParams(this); } Loading
core/java/com/android/internal/app/AlertController.java +19 −7 Original line number Diff line number Diff line Loading @@ -64,11 +64,11 @@ public class AlertController { private final Context mContext; private final DialogInterface mDialogInterface; private final Window mWindow; protected final Window mWindow; private CharSequence mTitle; private CharSequence mMessage; private ListView mListView; protected CharSequence mMessage; protected ListView mListView; private View mView; private int mViewLayoutResId; Loading @@ -91,14 +91,14 @@ public class AlertController { private CharSequence mButtonNeutralText; private Message mButtonNeutralMessage; private ScrollView mScrollView; protected ScrollView mScrollView; private int mIconId = 0; private Drawable mIcon; private ImageView mIconView; private TextView mTitleView; private TextView mMessageView; protected TextView mMessageView; private View mCustomTitleView; private boolean mForceInverseBackground; Loading Loading @@ -176,7 +176,19 @@ public class AlertController { return outValue.data != 0; } public AlertController(Context context, DialogInterface di, Window window) { public static final AlertController create(Context context, DialogInterface di, Window window) { final TypedArray a = context.obtainStyledAttributes( null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); int controllerType = a.getInt(R.styleable.AlertDialog_controllerType, 0); a.recycle(); switch (controllerType) { default: return new AlertController(context, di, window); } } protected AlertController(Context context, DialogInterface di, Window window) { mContext = context; mDialogInterface = di; mWindow = window; Loading Loading @@ -643,7 +655,7 @@ public class AlertController { } } private void setupContent(ViewGroup contentPanel) { protected void setupContent(ViewGroup contentPanel) { mScrollView = (ScrollView) contentPanel.findViewById(R.id.scrollView); mScrollView.setFocusable(false); Loading
core/res/res/values/attrs.xml +7 −0 Original line number Diff line number Diff line Loading @@ -2046,6 +2046,13 @@ i <attr name="showTitle" format="boolean" /> <!-- @hide Whether fullDark, etc. should use default values if null. --> <attr name="needsDefaultBackgrounds" format="boolean" /> <!-- @hide Workaround until we replace AlertController with custom layout. --> <attr name="controllerType"> <!-- The default controller. --> <enum name="normal" value="0" /> <!-- Controller for micro specific layout. --> <enum name="micro" value="1" /> </attr> </declare-styleable> <!-- @hide --> Loading
services/core/java/com/android/server/policy/GlobalActions.java +1 −1 Original line number Diff line number Diff line Loading @@ -1145,7 +1145,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac public GlobalActionsDialog(Context context, AlertParams params) { super(context, getDialogTheme(context)); mContext = getContext(); mAlert = new AlertController(mContext, this, getWindow()); mAlert = AlertController.create(mContext, this, getWindow()); mAdapter = (MyAdapter) params.mAdapter; mWindowTouchSlop = ViewConfiguration.get(context).getScaledWindowTouchSlop(); params.apply(mAlert); Loading