summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
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:47:41 +0000
commite2370f092f1648afd28c007c48e560fc2f7736cd (patch)
tree09bc93320c1b864aa8b715c5127df43793b76a77 /tools/layoutlib
parent59eedf528ca29a32b6d7f358f5076929f8fbb164 (diff)
downloadframeworks_base-e2370f092f1648afd28c007c48e560fc2f7736cd.zip
frameworks_base-e2370f092f1648afd28c007c48e560fc2f7736cd.tar.gz
frameworks_base-e2370f092f1648afd28c007c48e560fc2f7736cd.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')
-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;
}
}