am 5deaa138: Merge "Fix include tag rendering." into mnc-dev
* commit '5deaa138443433f861a52f4cdc461a677437c416': Fix include tag rendering.
This commit is contained in:
@@ -444,7 +444,7 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
@Override
|
@Override
|
||||||
public int getDimensionPixelSize(int index, int defValue) {
|
public int getDimensionPixelSize(int index, int defValue) {
|
||||||
try {
|
try {
|
||||||
return getDimension(index);
|
return getDimension(index, null);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
String s = getString(index);
|
String s = getString(index);
|
||||||
|
|
||||||
@@ -474,12 +474,12 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
@Override
|
@Override
|
||||||
public int getLayoutDimension(int index, String name) {
|
public int getLayoutDimension(int index, String name) {
|
||||||
try {
|
try {
|
||||||
// this will throw an exception
|
// this will throw an exception if not found.
|
||||||
return getDimension(index);
|
return getDimension(index, name);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
|
||||||
if (LayoutInflater_Delegate.sIsInInclude) {
|
if (LayoutInflater_Delegate.sIsInInclude) {
|
||||||
throw new RuntimeException();
|
throw new RuntimeException("Layout Dimension '" + name + "' not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
|
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
|
||||||
@@ -494,9 +494,13 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
return getDimensionPixelSize(index, defValue);
|
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);
|
String s = getString(index);
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
|
if (name != null) {
|
||||||
|
throw new RuntimeException("Attribute '" + name + "' not found");
|
||||||
|
}
|
||||||
throw new RuntimeException();
|
throw new RuntimeException();
|
||||||
}
|
}
|
||||||
// Check if the value is a magic constant that doesn't require a unit.
|
// Check if the value is a magic constant that doesn't require a unit.
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ public class LayoutInflater_Delegate {
|
|||||||
// ---- END CHANGES
|
// ---- END CHANGES
|
||||||
|
|
||||||
params = group.generateLayoutParams(attrs);
|
params = group.generateLayoutParams(attrs);
|
||||||
|
} catch (RuntimeException ignored) {
|
||||||
|
// Ignore, just fail over to child attrs.
|
||||||
} finally {
|
} finally {
|
||||||
// ---- START CHANGES
|
// ---- START CHANGES
|
||||||
sIsInInclude = false;
|
sIsInInclude = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user