diff options
Diffstat (limited to 'layoutlib_api/src/com/android/ide/common')
-rw-r--r-- | layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java | 32 |
1 files changed, 27 insertions, 5 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 e371d5a..ce86c9a 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 @@ -50,14 +50,35 @@ public class RenderResources { } /** - * Return the {@link StyleResourceValue} representing the current theme. - * @return the theme or null if there is no theme. + * Returns the {@link StyleResourceValue} representing the current theme. + * @return the theme or null if there is no current theme. */ - public StyleResourceValue getTheme() { + public StyleResourceValue getCurrentTheme() { return null; } /** + * Returns a theme by its name. + * + * @param name the name of the theme + * @param frameworkTheme whether the theme is a framework theme. + * @return the theme or null if there's no match + */ + public StyleResourceValue getTheme(String name, boolean frameworkTheme) { + return null; + } + + /** + * Returns whether a theme is a parent of a given theme. + * @param parentTheme the parent theme + * @param childTheme the child theme. + * @return true if the parent theme is indeed a parent theme of the child theme. + */ + public boolean themeIsParentOf(StyleResourceValue parentTheme, StyleResourceValue childTheme) { + return false; + } + + /** * Returns a framework resource by type and name. The returned resource is resolved. * @param resourceType the type of the resource * @param resourceName the name of the resource @@ -83,8 +104,9 @@ public class RenderResources { * @return the {@link ResourceValue} object or <code>null</code> */ public ResourceValue findItemInTheme(String itemName) { - if (getTheme() != null) { - return findItemInStyle(getTheme(), itemName); + StyleResourceValue currentTheme = getCurrentTheme(); + if (currentTheme != null) { + return findItemInStyle(currentTheme, itemName); } return null; |