* [Core] Fix switch measurement
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1995af4b Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1995af4b Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1995af4b Branch: refs/heads/master Commit: 1995af4b09219363f35c92e8e6ee40c12c9511b2 Parents: cddba7f Author: miomin <691292...@qq.com> Authored: Wed May 2 12:10:49 2018 +0800 Committer: YorkShen <shenyua...@gmail.com> Committed: Mon May 7 15:52:08 2018 +0800 ---------------------------------------------------------------------- .../sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1995af4b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java ---------------------------------------------------------------------- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java index a617507..714986e 100644 --- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXSwitch.java @@ -53,6 +53,8 @@ public class WXSwitch extends WXComponent<WXSwitchView> { /** uiThread = false **/ @Override public void measureInternal(float width, float height, int widthMeasureMode, int heightMeasureMode) { + mMeasureWidth = 0; + mMeasureHeight = 0; try { WXSwitchView wxSwitchView = new WXSwitchView(instance.getContext()); int widthSpec, heightSpec; @@ -69,8 +71,6 @@ public class WXSwitch extends WXComponent<WXSwitchView> { } catch (RuntimeException e) { WXLogUtils.e(WXLogUtils.getStackTrace(e)); } - mMeasureWidth = 0; - mMeasureHeight = 0; } /** uiThread = false **/