summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-07-18 21:31:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-17 21:04:20 +0000
commit4f8500594f110e9ab36f5daefcec62324abb770a (patch)
tree932c46bccd52905d8d85d7fcb627ca4dd4d22cdf
parent76dd54b64f0f8a9e321cee157c7778e22adc982f (diff)
parent4f8ce228195be123eeb9b5f066a6abc92b8d923a (diff)
downloadframeworks_base-4f8500594f110e9ab36f5daefcec62324abb770a.zip
frameworks_base-4f8500594f110e9ab36f5daefcec62324abb770a.tar.gz
frameworks_base-4f8500594f110e9ab36f5daefcec62324abb770a.tar.bz2
Merge "Fix style resolution for styles with '.'" into lmp-preview-dev
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index efd55bf..bb67a1a 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -619,39 +619,36 @@ public final class BridgeContext extends Context {
}
if (value != null) {
- if ((value.getFirst() == ResourceType.STYLE)
- || (value.getFirst() == ResourceType.ATTR)) {
- // look for the style in the current theme, and its parent:
- ResourceValue item = mRenderResources.findItemInTheme(value.getSecond(),
+ if ((value.getFirst() == ResourceType.STYLE)) {
+ // look for the style in all resources:
+ StyleResourceValue item = mRenderResources.getStyle(value.getSecond(),
isFrameworkRes);
if (item != null) {
- if (item instanceof StyleResourceValue) {
- if (defaultPropMap != null) {
- defaultPropMap.put("style", item.getName());
- }
-
- defStyleValues = (StyleResourceValue)item;
+ if (defaultPropMap != null) {
+ defaultPropMap.put("style", item.getName());
}
+
+ defStyleValues = item;
} else {
Bridge.getLog().error(null,
String.format(
"Style with id 0x%x (resolved to '%s') does not exist.",
defStyleRes, value.getSecond()),
- null /*data*/);
+ null);
}
} else {
Bridge.getLog().error(null,
String.format(
- "Resouce id 0x%x is not of type STYLE (instead %s)",
+ "Resource id 0x%x is not of type STYLE (instead %s)",
defStyleRes, value.getFirst().toString()),
- null /*data*/);
+ null);
}
} else {
Bridge.getLog().error(null,
String.format(
"Failed to find style with id 0x%x in current theme",
defStyleRes),
- null /*data*/);
+ null);
}
}