summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-05-18 22:04:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-18 22:04:23 +0000
commit9354a3ac006001b10c3a3de59737798034794c89 (patch)
tree3da9025488eaede02751ace68add81800c9dbab4 /tools
parent8783d3fe761ab943ad73e7c58252806df9e401da (diff)
parent5f1bf496948fb6383ae17e5467a26a00489d7564 (diff)
downloadframeworks_base-9354a3ac006001b10c3a3de59737798034794c89.zip
frameworks_base-9354a3ac006001b10c3a3de59737798034794c89.tar.gz
frameworks_base-9354a3ac006001b10c3a3de59737798034794c89.tar.bz2
Merge "Show better error message for color attr not found." into mnc-dev
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
index 677c744..a3fde866 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
@@ -16,6 +16,7 @@
package com.android.layoutlib.bridge.impl;
+import com.android.SdkConstants;
import com.android.annotations.NonNull;
import com.android.ide.common.rendering.api.DensityBasedResourceValue;
import com.android.ide.common.rendering.api.LayoutLog;
@@ -70,6 +71,10 @@ public final class ResourceHelper {
public static int getColor(String value) {
if (value != null) {
if (!value.startsWith("#")) {
+ if (value.startsWith(SdkConstants.PREFIX_THEME_REF)) {
+ throw new NumberFormatException(String.format(
+ "Attribute '%s' not found. Are you using the right theme?", value));
+ }
throw new NumberFormatException(
String.format("Color value '%s' must start with #", value));
}