diff options
| author | 2015-01-05 21:48:58 +0000 | |
|---|---|---|
| committer | 2015-01-05 21:48:58 +0000 | |
| commit | 74882cb0e3810ab1d77bc85a9ed1fa2b024a0159 (patch) | |
| tree | cd7f2ed84b534d01c66ec099433d87d25979a6d0 | |
| parent | 336c46668d790c31b936d32081d002d3f490b5ab (diff) | |
| parent | bf80d2737fc59e8ae04875edddf1534c6a7739bc (diff) | |
am bf80d273: am 74890242: Merge "Don\'t override dialog icon drawable unless valid resource ID was set" into lmp-mr1-dev
* commit 'bf80d2737fc59e8ae04875edddf1534c6a7739bc':
Don't override dialog icon drawable unless valid resource ID was set
| -rw-r--r-- | core/java/android/app/AlertDialog.java | 8 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/AlertController.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java index 4ce78357f352..3c6458fc2674 100644 --- a/core/java/android/app/AlertDialog.java +++ b/core/java/android/app/AlertDialog.java @@ -466,6 +466,8 @@ public class AlertDialog extends Dialog implements DialogInterface { /** * Set the resource id of the {@link Drawable} to be used in the title. + * <p> + * Takes precedence over values set using {@link #setIcon(Drawable)}. * * @return This Builder object to allow for chaining of calls to set methods */ @@ -485,7 +487,11 @@ public class AlertDialog extends Dialog implements DialogInterface { } /** - * Set an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon + * Set an icon as supplied by a theme attribute. e.g. + * {@link android.R.attr#alertDialogIcon}. + * <p> + * Takes precedence over values set using {@link #setIcon(int)} or + * {@link #setIcon(Drawable)}. * * @param attrId ID of a theme attribute that points to a drawable resource. */ diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index 35e03c3b7a80..20d209f081dd 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -955,10 +955,10 @@ public class AlertController { if (mIcon != null) { dialog.setIcon(mIcon); } - if (mIconId >= 0) { + if (mIconId != 0) { dialog.setIcon(mIconId); } - if (mIconAttrId > 0) { + if (mIconAttrId != 0) { dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId)); } } |