diff options
author | Xavier Ducrohet <xav@android.com> | 2012-05-16 11:35:07 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-05-16 11:35:07 -0700 |
commit | b9f706c82683c9e82197577b7ade91984cc6539a (patch) | |
tree | aa7d8edc80e5be627c0354f7aa8d01a993cc8880 /layoutlib_api/src | |
parent | 7911fa1ef67338907a2fb22d4fdb4203930a4549 (diff) | |
download | sdk-b9f706c82683c9e82197577b7ade91984cc6539a.zip sdk-b9f706c82683c9e82197577b7ade91984cc6539a.tar.gz sdk-b9f706c82683c9e82197577b7ade91984cc6539a.tar.bz2 |
Improve search of items into style for legacy layoutlibs.
Legacy versions uses the old API that doesn't specify the
namespace of the attribute being queried. The implementation
used the namespace of the style as the namespace of the attribute
but this make little sense.
At better implementation searches in the project's namespace
and, if the attribute is not found, then searches in the
framework namespace.
Change-Id: Ief43ecd45f108162de2b1512027d4eedf2c132db
Diffstat (limited to 'layoutlib_api/src')
-rw-r--r-- | layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java index 8ccbd69..f9e02d6 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java @@ -127,14 +127,18 @@ public class RenderResources { * Returns the {@link ResourceValue} matching a given name in a given style. If the * item is not directly available in the style, the method looks in its parent style. * + * This version of doesn't support providing the namespace of the attribute so it'll search + * in both the project's namespace and then in the android namespace. + * * @param style the style to search in - * @param itemName the name of the item to search for. + * @param attrName the name of the attribute to search for. * @return the {@link ResourceValue} object or <code>null</code> * - * @Deprecated Use {@link #findItemInStyle(StyleResourceValue, String, boolean)} + * @Deprecated Use {@link #findItemInStyle(StyleResourceValue, String, boolean)} since this + * method doesn't know the item namespace. */ @Deprecated - public ResourceValue findItemInStyle(StyleResourceValue style, String itemName) { + public ResourceValue findItemInStyle(StyleResourceValue style, String attrName) { return null; } |