fang created WEEX-157:
-------------------------
Summary: page refresh in the background led to size calculation
error
Key: WEEX-157
URL: https://issues.apache.org/jira/browse/WEEX-157
Project: Weex
Issue Type: Bug
Components: Android
Affects Versions: 0.16
Reporter: fang
Assignee: zhengshihan
Attachments: 111.png, 222.png, 333.png, 444.png
1、the problem
Weex page to open a horizontal screen app (such as the king of glory), wait for
the refresh and then returned to weex page and found that the page rendering
error.After refreshing no problem
2、the sample page
http://dotwe.org/vue/e791636641f85320c8d589d3ea2984fe
3、reproduce the steps
*Click on the first green block*
*Switch to any horizontal screen app*
*After the "change width" toast switch will weex page found layout error*
*The page appears normal after toast again*
4、 the problem code
WXViewUtils.java
public static int getScreenWidth (Context ctx) {
if (ctx! = null) {
Resources res = ctx.getResources ();
mScreenWidth = res.getDisplayMetrics (). widthPixels;
if (WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN) {
mScreenHeight = res
.getDisplayMetrics ()
.heightPixels;
mScreenWidth = mScreenHeight> mScreenWidth? mScreenWidth: mScreenHeight;
}
} else if (WXEnvironment.isApkDebugable ()) {
throw new WXRuntimeException ("Error Context is null When
getScreenHeight");
}
return mScreenWidth;
}
In the horizontal screen app, weex calculated the screen width in the
background to the screen height, resulting in a calculation error
5、 there is a problem screenshots
!111.png|thumbnail!
!222.png|thumbnail!
!333.png|thumbnail!
!444.png|thumbnail!
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)