* commit 'c34288be586028f949686e9a4fe7b84207bf2a6d': Make getInt in BridgeTypedArray accept empty String. Fix layout mirroring.
This commit is contained in:
@ -239,15 +239,12 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
public int getInt(int index, int defValue) {
|
public int getInt(int index, int defValue) {
|
||||||
String s = getString(index);
|
String s = getString(index);
|
||||||
try {
|
try {
|
||||||
if (s != null) {
|
|
||||||
return convertValueToInt(s, defValue);
|
return convertValueToInt(s, defValue);
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
|
Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT,
|
||||||
String.format("\"%1$s\" in attribute \"%2$s\" is not a valid integer",
|
String.format("\"%1$s\" in attribute \"%2$s\" is not a valid integer",
|
||||||
s, mNames[index]),
|
s, mNames[index]),
|
||||||
null);
|
null);
|
||||||
return defValue;
|
|
||||||
}
|
}
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
@ -949,7 +946,7 @@ public final class BridgeTypedArray extends TypedArray {
|
|||||||
* "XXXXXXXX" > 80000000.
|
* "XXXXXXXX" > 80000000.
|
||||||
*/
|
*/
|
||||||
private static int convertValueToInt(@Nullable String charSeq, int defValue) {
|
private static int convertValueToInt(@Nullable String charSeq, int defValue) {
|
||||||
if (null == charSeq)
|
if (null == charSeq || charSeq.isEmpty())
|
||||||
return defValue;
|
return defValue;
|
||||||
|
|
||||||
int sign = 1;
|
int sign = 1;
|
||||||
|
@ -131,6 +131,7 @@ class Layout extends RelativeLayout {
|
|||||||
HardwareConfig hwConfig = getParams().getHardwareConfig();
|
HardwareConfig hwConfig = getParams().getHardwareConfig();
|
||||||
Density density = hwConfig.getDensity();
|
Density density = hwConfig.getDensity();
|
||||||
boolean isRtl = Bridge.isLocaleRtl(getParams().getLocale());
|
boolean isRtl = Bridge.isLocaleRtl(getParams().getLocale());
|
||||||
|
setLayoutDirection(isRtl? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR);
|
||||||
|
|
||||||
NavigationBar navBar = null;
|
NavigationBar navBar = null;
|
||||||
if (mBuilder.hasNavBar()) {
|
if (mBuilder.hasNavBar()) {
|
||||||
|
Reference in New Issue
Block a user