diff options
author | Alan Viverette <alanv@google.com> | 2014-07-07 14:06:15 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-07-07 22:54:22 +0000 |
commit | 8e5e11b99fac942122ee2d6cdd30af51564861ae (patch) | |
tree | 5bd6c6c59b064108597043beff12d21d17c11537 /core/java/android/content/res | |
parent | 0e73e532963ce0b11dade9471a78a69fdf6666aa (diff) | |
download | frameworks_base-8e5e11b99fac942122ee2d6cdd30af51564861ae.zip frameworks_base-8e5e11b99fac942122ee2d6cdd30af51564861ae.tar.gz frameworks_base-8e5e11b99fac942122ee2d6cdd30af51564861ae.tar.bz2 |
Handle configuration changes in drawable attributes
Adds themeable attribute support to InsetDrawable, adds support
for attribute configuration changes to all themable drawables.
BUG: 16045735
Change-Id: I3dc62d28801760ac69d303be81b6c78bb9bb5aca
Diffstat (limited to 'core/java/android/content/res')
-rw-r--r-- | core/java/android/content/res/TypedArray.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java index d2146ac..645f7df 100644 --- a/core/java/android/content/res/TypedArray.java +++ b/core/java/android/content/res/TypedArray.java @@ -927,6 +927,30 @@ public class TypedArray { return attrs; } + /** + * Return a mask of the configuration parameters for which the values in + * this typed array may change. + * + * @return Returns a mask of the changing configuration parameters, as + * defined by {@link android.content.pm.ActivityInfo}. + * @see android.content.pm.ActivityInfo + */ + public int getChangingConfigurations() { + int changingConfig = 0; + + final int[] data = mData; + final int N = length(); + for (int i = 0; i < N; i++) { + final int index = i * AssetManager.STYLE_NUM_ENTRIES; + final int type = data[index + AssetManager.STYLE_TYPE]; + if (type == TypedValue.TYPE_NULL) { + continue; + } + changingConfig |= data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS]; + } + return changingConfig; + } + private boolean getValueAt(int index, TypedValue outValue) { final int[] data = mData; final int type = data[index+AssetManager.STYLE_TYPE]; |