summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-08-26 20:18:04 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-26 20:18:04 +0000
commit522e67e4ac600fb19c18f55f0e51096af9ae37d3 (patch)
treed3746436ff0ed4d090c12b6a35f252f5c8edcf4d /tools
parent8df6131ac103ac58ab03f6aae01e136df3c6a7b1 (diff)
parentde3ac8f9fc5987ac1f1223da02b4275fdbae3d56 (diff)
downloadframeworks_base-522e67e4ac600fb19c18f55f0e51096af9ae37d3.zip
frameworks_base-522e67e4ac600fb19c18f55f0e51096af9ae37d3.tar.gz
frameworks_base-522e67e4ac600fb19c18f55f0e51096af9ae37d3.tar.bz2
am de3ac8f9: am 92480a9a: Fix include tag rendering. [DO NOT MERGE]
* commit 'de3ac8f9fc5987ac1f1223da02b4275fdbae3d56': Fix include tag rendering. [DO NOT MERGE]
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java14
-rw-r--r--tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java8
2 files changed, 11 insertions, 11 deletions
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index 7d4271b..1397acb 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -444,7 +444,7 @@ public final class BridgeTypedArray extends TypedArray {
@Override
public int getDimensionPixelSize(int index, int defValue) {
try {
- return getDimension(index);
+ return getDimension(index, null);
} catch (RuntimeException e) {
String s = getString(index);
@@ -474,12 +474,12 @@ public final class BridgeTypedArray extends TypedArray {
@Override
public int getLayoutDimension(int index, String name) {
try {
- // this will throw an exception
- return getDimension(index);
+ // this will throw an exception if not found.
+ return getDimension(index, name);
} catch (RuntimeException e) {
if (LayoutInflater_Delegate.sIsInInclude) {
- throw new RuntimeException();
+ throw new RuntimeException("Layout Dimension '" + name + "' not found.");
}
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
@@ -494,9 +494,13 @@ public final class BridgeTypedArray extends TypedArray {
return getDimensionPixelSize(index, defValue);
}
- private int getDimension(int index) {
+ /** @param name attribute name, used for error reporting. */
+ private int getDimension(int index, @Nullable String name) {
String s = getString(index);
if (s == null) {
+ if (name != null) {
+ throw new RuntimeException("Attribute '" + name + "' not found");
+ }
throw new RuntimeException();
}
// Check if the value is a magic constant that doesn't require a unit.
diff --git a/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java b/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java
index 7a73fae..579f274 100644
--- a/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/view/LayoutInflater_Delegate.java
@@ -134,12 +134,8 @@ public class LayoutInflater_Delegate {
params = group.generateLayoutParams(attrs);
- } catch (RuntimeException e) {
- // ---- START CHANGES
- sIsInInclude = false;
- // ---- END CHANGES
-
- params = group.generateLayoutParams(childAttrs);
+ } catch (RuntimeException ignored) {
+ // Ignore, just fail over to child attrs.
} finally {
// ---- START CHANGES
sIsInInclude = false;