class WXMetaModule extends WXModule {

    @JSMethod(uiThread = false)
    public void setViewport(String param) {
        if (!TextUtils.isEmpty(param)) {
            try {
                param = URLDecoder.decode(param, "utf-8");
                JSONObject jsObj = JSON.parseObject(param);
                Context cxt = mWXSDKInstance.getContext();
                if (DEVICE_WIDTH.endsWith(jsObj.getString(WIDTH))) {
                    int width = (int)(WXViewUtils.getScreenWidth(cxt)/WXViewUtils.getScreenDensity(cxt));
                    mWXSDKInstance.setViewPortWidth(width);
                    mWXSDKInstance.setInstanceViewPortWidth(width);
                } else {
                    int width = jsObj.getInteger(WIDTH);
                    if (width > 0) {
                        mWXSDKInstance.setViewPortWidth(width);
                        mWXSDKInstance.setInstanceViewPortWidth(width);
                    }
                }
            } catch (Exception e) {
                WXLogUtils.e("[WXModalUIModule] alert param parse error ", e);
            }
        }
    }

}