Lines Matching defs:ColorStateList

39  * {@link android.content.res.ColorStateList}s are created from XML resource files defined in the
62 public class ColorStateList implements Parcelable {
69 private static final SparseArray<WeakReference<ColorStateList>> sCache =
70 new SparseArray<WeakReference<ColorStateList>>();
72 private ColorStateList() { }
75 * Creates a ColorStateList that returns the specified mapping from
78 public ColorStateList(int[][] states, int[] colors) {
94 * Creates or retrieves a ColorStateList that always returns a single color.
96 public static ColorStateList valueOf(int color) {
99 WeakReference<ColorStateList> ref = sCache.get(color);
100 ColorStateList csl = ref != null ? ref.get() : null;
106 csl = new ColorStateList(EMPTY, new int[] { color });
107 sCache.put(color, new WeakReference<ColorStateList>(csl));
113 * Create a ColorStateList from an XML document, given a set of {@link Resources}.
115 public static ColorStateList createFromXml(Resources r, XmlPullParser parser)
133 * a tag in an XML document, tries to create a ColorStateList from that tag.
134 * Returns null if the tag is not a valid ColorStateList.
136 private static ColorStateList createFromXmlInner(Resources r, XmlPullParser parser,
139 ColorStateList colorStateList;
144 colorStateList = new ColorStateList();
155 * Creates a new ColorStateList that has the same states and
159 public ColorStateList withAlpha(int alpha) {
167 return new ColorStateList(mStateSpecs, colors);
268 * {@link ColorStateList} that matches the stateSet.
270 * @return the color associated with that set of states in this {@link ColorStateList}.
284 * Return the default color in this {@link ColorStateList}.
286 * @return the default color in this {@link ColorStateList}.
293 return "ColorStateList{" +
312 public static final Parcelable.Creator<ColorStateList> CREATOR =
313 new Parcelable.Creator<ColorStateList>() {
314 public ColorStateList[] newArray(int size) {
315 return new ColorStateList[size];
318 public ColorStateList createFromParcel(Parcel source) {
325 return new ColorStateList(stateSpecs, colors);