From 58658eaa642012733a36676b01f6d53b2f662e06 Mon Sep 17 00:00:00 2001 From: Diego Perez Date: Tue, 20 Sep 2016 20:04:26 +0100 Subject: [PATCH] Fix themed attributes resolution If an attribute is not an actual theme reference, the call to Resources.Theme.resolveAttribute will fail in layoutlib. This would happen for example for color values. The call in the Android framework simply returns the value. Bug: 31553972 Change-Id: Idda768a659d94a6c3f848dc960303cf4241325c3 --- .../com/android/layoutlib/bridge/android/BridgeContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 8d93b7f32100b..ff9ad9fe1af93 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 @@ -373,7 +373,9 @@ public final class BridgeContext extends Context { return true; } - return false; + // If the value is not a valid reference, fallback to pass the value as a string. + outValue.string = value.getValue(); + return true; }