diff options
author | Xavier Ducrohet <xav@android.com> | 2011-01-27 10:00:54 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-01-27 10:00:54 -0800 |
commit | 0ba459dbf09bd6c37cd5c348158ad55e67702bef (patch) | |
tree | 971cd5c7533fbb9ff54d3a4fae95cd0c7729ca06 /layoutlib_api/src | |
parent | b99e620f8f98421c10b38c9ac5a43aa2ced7765d (diff) | |
parent | b4f5eb9edc970809c3ef2ab4272e3fb3e24f89db (diff) | |
download | sdk-0ba459dbf09bd6c37cd5c348158ad55e67702bef.zip sdk-0ba459dbf09bd6c37cd5c348158ad55e67702bef.tar.gz sdk-0ba459dbf09bd6c37cd5c348158ad55e67702bef.tar.bz2 |
Merge "Add more theme query APIs to RenderResources"
Diffstat (limited to 'layoutlib_api/src')
-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; |