From da28101757e62602a743b95488f4670f9759bb26 Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Wed, 9 Jul 2014 17:27:07 -0700 Subject: Fix style resolution for styles with '.' [DO NOT MERGE] Bug: b.android.com/72698 Change-Id: I96fb549cf5787d9e8cde2245524a8173471a60ca (cherry picked from commit f2fa79e9b56b71f8aa30e6675255df69f88a173d) --- .../android/layoutlib/bridge/android/BridgeContext.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'tools') 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 efcb35c..736d2fa 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 @@ -613,19 +613,16 @@ 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( -- cgit v1.1