diff options
author | Xavier Ducrohet <xav@android.com> | 2011-01-26 19:24:43 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-01-26 19:27:31 -0800 |
commit | b4f5eb9edc970809c3ef2ab4272e3fb3e24f89db (patch) | |
tree | 005fd291f49016b7db4a95d9d23db667632fe64b /layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java | |
parent | 6aeb047ea010de8f3e820dab6625aef762418de6 (diff) | |
download | sdk-b4f5eb9edc970809c3ef2ab4272e3fb3e24f89db.zip sdk-b4f5eb9edc970809c3ef2ab4272e3fb3e24f89db.tar.gz sdk-b4f5eb9edc970809c3ef2ab4272e3fb3e24f89db.tar.bz2 |
Add more theme query APIs to RenderResources
Change-Id: Iebde7536a0007898387dc7bb5d943e3767140a3c
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 | 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; |