Loading core/java/com/android/internal/app/AlertController.java +16 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,18 @@ public class AlertController { } } /** * @param attrId the attributeId of the theme-specific drawable * to resolve the resourceId for. * * @return resId the resourceId of the theme-specific drawable */ public int getIconAttributeResId(int attrId) { TypedValue out = new TypedValue(); mContext.getTheme().resolveAttribute(attrId, out, true); return out.resourceId; } public void setInverseBackgroundForced(boolean forceInverseBackground) { mForceInverseBackground = forceInverseBackground; } Loading Loading @@ -740,6 +752,7 @@ public class AlertController { public int mIconId = 0; public Drawable mIcon; public int mIconAttrId = 0; public CharSequence mTitle; public View mCustomTitleView; public CharSequence mMessage; Loading Loading @@ -806,6 +819,9 @@ public class AlertController { if (mIconId >= 0) { dialog.setIcon(mIconId); } if (mIconAttrId > 0) { dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId)); } } if (mMessage != null) { dialog.setMessage(mMessage); Loading Loading
core/java/com/android/internal/app/AlertController.java +16 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,18 @@ public class AlertController { } } /** * @param attrId the attributeId of the theme-specific drawable * to resolve the resourceId for. * * @return resId the resourceId of the theme-specific drawable */ public int getIconAttributeResId(int attrId) { TypedValue out = new TypedValue(); mContext.getTheme().resolveAttribute(attrId, out, true); return out.resourceId; } public void setInverseBackgroundForced(boolean forceInverseBackground) { mForceInverseBackground = forceInverseBackground; } Loading Loading @@ -740,6 +752,7 @@ public class AlertController { public int mIconId = 0; public Drawable mIcon; public int mIconAttrId = 0; public CharSequence mTitle; public View mCustomTitleView; public CharSequence mMessage; Loading Loading @@ -806,6 +819,9 @@ public class AlertController { if (mIconId >= 0) { dialog.setIcon(mIconId); } if (mIconAttrId > 0) { dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId)); } } if (mMessage != null) { dialog.setMessage(mMessage); Loading