From 6a9c6c6baedb994a619573388056c95475f84abf Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Tue, 19 Aug 2014 16:15:37 -0700 Subject: [PATCH] Fix "@null" resource values in LayoutLib. [DO NOT MERGE] Bug: http://b.android.com/74072 Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542 (cherry picked from commit c9cd725f1013bed27e6f6594b176c10a6a4c0f16) --- tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java index 446d139b2161..0530828b20c1 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java @@ -91,7 +91,7 @@ public final class BridgeTypedArray extends TypedArray { // first count the array size int count = 0; for (ResourceValue data : mResourceData) { - if (data != null) { + if (data != null && !RenderResources.REFERENCE_NULL.equals(data.getValue())) { count++; } } @@ -103,7 +103,8 @@ public final class BridgeTypedArray extends TypedArray { // fill the array with the indices. int index = 1; for (int i = 0 ; i < mResourceData.length ; i++) { - if (mResourceData[i] != null) { + if (mResourceData[i] != null + && !RenderResources.REFERENCE_NULL.equals(mResourceData[i].getValue())) { mIndices[index++] = i; } } -- 2.11.0