diff options
author | Alan Viverette <alanv@google.com> | 2014-01-24 17:20:12 -0800 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-01-24 17:20:12 -0800 |
commit | ef259e4484deb69ada76970e26f2b2542b1fe4c1 (patch) | |
tree | 8956f568e7f4bb9f1ac8d399451b553cdb034b89 /core/java/android/view/LayoutInflater.java | |
parent | 8435cf0d8b9e24715d5b310ed569fda918dcaa46 (diff) | |
download | frameworks_base-ef259e4484deb69ada76970e26f2b2542b1fe4c1.zip frameworks_base-ef259e4484deb69ada76970e26f2b2542b1fe4c1.tar.gz frameworks_base-ef259e4484deb69ada76970e26f2b2542b1fe4c1.tar.bz2 |
Allow specification of View theme override as a theme attribute
WE MUST GO DEEPER.
Change-Id: I492c3750e108d01d6f8d325ccc2bedb1ade5b91b
Diffstat (limited to 'core/java/android/view/LayoutInflater.java')
-rw-r--r-- | core/java/android/view/LayoutInflater.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index ed75850..aaa8b8c 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -91,7 +91,8 @@ public abstract class LayoutInflater { private static final String TAG_1995 = "blink"; private static final String TAG_REQUEST_FOCUS = "requestFocus"; - private static final String ATTR_THEME = "theme"; + private static final int[] ATTRS_THEME = new int[] { + com.android.internal.R.attr.theme }; /** * Hook to allow clients of the LayoutInflater to restrict the set of Views that are allowed @@ -689,10 +690,12 @@ public abstract class LayoutInflater { } // Apply a theme wrapper, if requested. - final int themeResId = attrs.getAttributeResourceValue(null, ATTR_THEME, 0); + final TypedArray ta = viewContext.obtainStyledAttributes(attrs, ATTRS_THEME); + final int themeResId = ta.getResourceId(0, 0); if (themeResId != 0) { viewContext = new ContextThemeWrapper(viewContext, themeResId); } + ta.recycle(); if (name.equals(TAG_1995)) { // Let's party like it's 1995! |