diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2014-07-09 17:17:02 -0700 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2014-07-09 17:17:02 -0700 |
commit | 4f8ce228195be123eeb9b5f066a6abc92b8d923a (patch) | |
tree | 3b95cd42cdcb6ce69d96f92f242741f23b54bc80 /tools/layoutlib/bridge | |
parent | 274a6049edcd99346b0d07e3a4f9f61cd2d84c3e (diff) | |
download | frameworks_base-4f8ce228195be123eeb9b5f066a6abc92b8d923a.zip frameworks_base-4f8ce228195be123eeb9b5f066a6abc92b8d923a.tar.gz frameworks_base-4f8ce228195be123eeb9b5f066a6abc92b8d923a.tar.bz2 |
Fix style resolution for styles with '.'
Bug: b.android.com/72698
Change-Id: I96fb549cf5787d9e8cde2245524a8173471a60ca
Diffstat (limited to 'tools/layoutlib/bridge')
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java | 25 |
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); } } |