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

Commit d1f13586 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 10bd4106: am baed0a8f: am 56fd88d8: am ab12f0f7: Merge "Implement resolving...

am 10bd4106: am baed0a8f: am 56fd88d8: am ab12f0f7: Merge "Implement resolving of icon attributes to resIds in AlertController"

* commit '10bd4106':
  Implement resolving of icon attributes to resIds in AlertController
parents d02341d0 10bd4106
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -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) {
    public void setInverseBackgroundForced(boolean forceInverseBackground) {
        mForceInverseBackground = forceInverseBackground;
        mForceInverseBackground = forceInverseBackground;
    }
    }
@@ -740,6 +752,7 @@ public class AlertController {
        
        
        public int mIconId = 0;
        public int mIconId = 0;
        public Drawable mIcon;
        public Drawable mIcon;
        public int mIconAttrId = 0;
        public CharSequence mTitle;
        public CharSequence mTitle;
        public View mCustomTitleView;
        public View mCustomTitleView;
        public CharSequence mMessage;
        public CharSequence mMessage;
@@ -807,6 +820,9 @@ public class AlertController {
                if (mIconId >= 0) {
                if (mIconId >= 0) {
                    dialog.setIcon(mIconId);
                    dialog.setIcon(mIconId);
                }
                }
                if (mIconAttrId > 0) {
                    dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId));
                }
            }
            }
            if (mMessage != null) {
            if (mMessage != null) {
                dialog.setMessage(mMessage);
                dialog.setMessage(mMessage);