summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib/bridge/src
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-08-19 16:15:37 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-08-26 00:48:18 +0000
commitffee9b2740986560a507fc9726c2e4e2eba5db7f (patch)
treef572fb765ce92eff677b9b46e49f0da175b72729 /tools/layoutlib/bridge/src
parent17b94b8a583849c769aab57644e6c3c289b79e55 (diff)
downloadframeworks_base-ffee9b2740986560a507fc9726c2e4e2eba5db7f.zip
frameworks_base-ffee9b2740986560a507fc9726c2e4e2eba5db7f.tar.gz
frameworks_base-ffee9b2740986560a507fc9726c2e4e2eba5db7f.tar.bz2
Fix "@null" resource values in LayoutLib. [DO NOT MERGE]
Bug: http://b.android.com/74072 Change-Id: Ib84906d86772ac3df2407e71ad2167797bec4542 (cherry picked from commit c9cd725f1013bed27e6f6594b176c10a6a4c0f16)
Diffstat (limited to 'tools/layoutlib/bridge/src')
-rw-r--r--tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java5
1 files 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 446d139..0530828 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;
}
}