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

Commit f068cff1 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Push flags from top-level TypedValue into ComplexColor changing configs" into nyc-dev

parents 0e48bc91 0b9295d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -10117,7 +10117,6 @@ package android.content.res {
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public int describeContents();
    method public int getChangingConfigurations();
    method public int getColorForState(int[], int);
    method public int getColorForState(int[], int);
    method public int getDefaultColor();
    method public int getDefaultColor();
    method public boolean isOpaque();
    method public boolean isOpaque();
@@ -10129,6 +10128,7 @@ package android.content.res {
  public abstract class ComplexColor {
  public abstract class ComplexColor {
    ctor public ComplexColor();
    ctor public ComplexColor();
    method public int getChangingConfigurations();
    method public abstract int getDefaultColor();
    method public abstract int getDefaultColor();
    method public boolean isStateful();
    method public boolean isStateful();
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -10512,7 +10512,6 @@ package android.content.res {
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public int describeContents();
    method public int getChangingConfigurations();
    method public int getColorForState(int[], int);
    method public int getColorForState(int[], int);
    method public int getDefaultColor();
    method public int getDefaultColor();
    method public boolean isOpaque();
    method public boolean isOpaque();
@@ -10524,6 +10523,7 @@ package android.content.res {
  public abstract class ComplexColor {
  public abstract class ComplexColor {
    ctor public ComplexColor();
    ctor public ComplexColor();
    method public int getChangingConfigurations();
    method public abstract int getDefaultColor();
    method public abstract int getDefaultColor();
    method public boolean isStateful();
    method public boolean isStateful();
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -10127,7 +10127,6 @@ package android.content.res {
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static deprecated android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
    method public int describeContents();
    method public int getChangingConfigurations();
    method public int getColorForState(int[], int);
    method public int getColorForState(int[], int);
    method public int getDefaultColor();
    method public int getDefaultColor();
    method public boolean isOpaque();
    method public boolean isOpaque();
@@ -10139,6 +10138,7 @@ package android.content.res {
  public abstract class ComplexColor {
  public abstract class ComplexColor {
    ctor public ComplexColor();
    ctor public ComplexColor();
    method public int getChangingConfigurations();
    method public abstract int getDefaultColor();
    method public abstract int getDefaultColor();
    method public boolean isStateful();
    method public boolean isStateful();
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -442,7 +442,7 @@ public class ColorStateList extends ComplexColor implements Parcelable {
     * @see android.content.pm.ActivityInfo
     * @see android.content.pm.ActivityInfo
     */
     */
    public @Config int getChangingConfigurations() {
    public @Config int getChangingConfigurations() {
        return mChangingConfigurations;
        return super.getChangingConfigurations() | mChangingConfigurations;
    }
    }


    private int modulateColorAlpha(int baseColor, float alphaMod) {
    private int modulateColorAlpha(int baseColor, float alphaMod) {
+22 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,8 @@ import android.graphics.Color;
 * {@link android.content.res.ColorStateList} or {@link android.content.res.GradientColor}
 * {@link android.content.res.ColorStateList} or {@link android.content.res.GradientColor}
 */
 */
public abstract class ComplexColor {
public abstract class ComplexColor {
    private int mChangingConfigurations;

    /**
    /**
     * @return {@code true}  if this ComplexColor changes color based on state, {@code false}
     * @return {@code true}  if this ComplexColor changes color based on state, {@code false}
     * otherwise.
     * otherwise.
@@ -52,4 +54,24 @@ public abstract class ComplexColor {
     * @hide only for resource preloading
     * @hide only for resource preloading
     */
     */
    public abstract ComplexColor obtainForTheme(Theme t);
    public abstract ComplexColor obtainForTheme(Theme t);

    /**
     * @hide only for resource preloading
     */
    final void setBaseChangingConfigurations(int changingConfigurations) {
        mChangingConfigurations = changingConfigurations;
    }

    /**
     * Returns a mask of the configuration parameters for which this color
     * may change, requiring that it be re-created.
     *
     * @return a mask of the changing configuration parameters, as defined by
     *         {@link android.content.pm.ActivityInfo}
     *
     * @see android.content.pm.ActivityInfo
     */
    public int getChangingConfigurations() {
        return mChangingConfigurations;
    }
}
}
Loading