diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2015-08-05 21:11:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-05 21:11:40 +0000 |
commit | 2c1a22d91607e18c7618e79ab026d3c5c4ce8949 (patch) | |
tree | d2e3c0299b8051617dcc6f80a4c26288a98d718d | |
parent | 8eaf18b0ab77184f16870428258650bd12bb2ea5 (diff) | |
parent | 0437cac76c24dc6cac7b530e6d80f789565550ec (diff) | |
download | frameworks_base-2c1a22d91607e18c7618e79ab026d3c5c4ce8949.zip frameworks_base-2c1a22d91607e18c7618e79ab026d3c5c4ce8949.tar.gz frameworks_base-2c1a22d91607e18c7618e79ab026d3c5c4ce8949.tar.bz2 |
Merge changes I85106f37,I7db398aa into mnc-dev
* changes:
Make getInt in BridgeTypedArray accept empty String.
Fix layout mirroring.
-rw-r--r-- | tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java | 7 | ||||
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java index 2e515fb..6a61090 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java @@ -239,15 +239,12 @@ public final class BridgeTypedArray extends TypedArray { public int getInt(int index, int defValue) { String s = getString(index); try { - if (s != null) { - return convertValueToInt(s, defValue); - } + return convertValueToInt(s, defValue); } catch (NumberFormatException e) { Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT, String.format("\"%1$s\" in attribute \"%2$s\" is not a valid integer", s, mNames[index]), null); - return defValue; } return defValue; } @@ -949,7 +946,7 @@ public final class BridgeTypedArray extends TypedArray { * "XXXXXXXX" > 80000000. */ private static int convertValueToInt(@Nullable String charSeq, int defValue) { - if (null == charSeq) + if (null == charSeq || charSeq.isEmpty()) return defValue; int sign = 1; diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java index c72c979..cbd0415 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java @@ -131,6 +131,7 @@ class Layout extends RelativeLayout { HardwareConfig hwConfig = getParams().getHardwareConfig(); Density density = hwConfig.getDensity(); boolean isRtl = Bridge.isLocaleRtl(getParams().getLocale()); + setLayoutDirection(isRtl? LAYOUT_DIRECTION_RTL : LAYOUT_DIRECTION_LTR); NavigationBar navBar = null; if (mBuilder.hasNavBar()) { |