diff options
Diffstat (limited to 'layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java')
-rw-r--r-- | layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java | 37 |
1 files changed, 37 insertions, 0 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 ea572bc..8ccbd69 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 @@ -93,7 +93,10 @@ public class RenderResources { * * @param itemName the name of the item to search for. * @return the {@link ResourceValue} object or <code>null</code> + * + * @deprecated Use {@link #findItemInTheme(String, boolean)} */ + @Deprecated public ResourceValue findItemInTheme(String itemName) { StyleResourceValue currentTheme = getCurrentTheme(); if (currentTheme != null) { @@ -104,18 +107,52 @@ public class RenderResources { } /** + * Returns the {@link ResourceValue} matching a given attribute in the current theme. If the + * item is not directly available in the theme, the method looks in its parent theme. + * + * @param attrName the name of the attribute to search for. + * @param isFrameworkAttr whether the attribute is a framework attribute + * @return the {@link ResourceValue} object or <code>null</code> + */ + public ResourceValue findItemInTheme(String attrName, boolean isFrameworkAttr) { + StyleResourceValue currentTheme = getCurrentTheme(); + if (currentTheme != null) { + return findItemInStyle(currentTheme, attrName, isFrameworkAttr); + } + + return null; + } + + /** * 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. * * @param style the style to search in * @param itemName the name of the item to search for. * @return the {@link ResourceValue} object or <code>null</code> + * + * @Deprecated Use {@link #findItemInStyle(StyleResourceValue, String, boolean)} */ + @Deprecated public ResourceValue findItemInStyle(StyleResourceValue style, String itemName) { return null; } /** + * Returns the {@link ResourceValue} matching a given attribute in a given style. If the + * item is not directly available in the style, the method looks in its parent style. + * + * @param style the style to search in + * @param attrName the name of the attribute to search for. + * @param isFrameworkAttr whether the attribute is a framework attribute + * @return the {@link ResourceValue} object or <code>null</code> + */ + public ResourceValue findItemInStyle(StyleResourceValue style, String attrName, + boolean isFrameworkAttr) { + return null; + } + + /** * Searches for, and returns a {@link ResourceValue} by its reference. * <p/> * The reference format can be: |