Loading api/current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } } api/system-current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } } api/test-current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } } core/java/android/content/res/ColorStateList.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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) { Loading core/java/android/content/res/ComplexColor.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -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. Loading Loading @@ -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
api/current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } }
api/system-current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } }
api/test-current.txt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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(); } }
core/java/android/content/res/ColorStateList.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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) { Loading
core/java/android/content/res/ComplexColor.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -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. Loading Loading @@ -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; } } }