This repository was archived by the owner on Jun 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
android/sdk/src/main/java/com/taobao/weex Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -452,9 +452,15 @@ public void setUseScroller(boolean use) {
452
452
}
453
453
454
454
public void setInstanceViewPortWidth (int instanceViewPortWidth ) {
455
+ setInstanceViewPortWidth (instanceViewPortWidth ,false );
456
+
457
+ }
458
+ public void setInstanceViewPortWidth (int instanceViewPortWidth ,boolean fromMetaModule ){
455
459
this .mInstanceViewPortWidth = instanceViewPortWidth ;
456
460
this .mAutoAdjustDeviceWidth = false ;
457
- WXBridgeManager .getInstance ().setViewPortWidth (getInstanceId (),mInstanceViewPortWidth );
461
+ if (!fromMetaModule ){
462
+ WXBridgeManager .getInstance ().setViewPortWidth (getInstanceId (), mInstanceViewPortWidth );
463
+ }
458
464
}
459
465
460
466
public void setAutoAdjustDeviceWidth (boolean autoAdjustViewPort ){
Original file line number Diff line number Diff line change @@ -60,12 +60,12 @@ public void setViewport(String param) {
60
60
// todo maybe getString(WIDTH) is "device-height"
61
61
if (DEVICE_WIDTH .endsWith (jsObj .getString (WIDTH ))) {
62
62
int width = (int )(WXViewUtils .getScreenWidth (cxt )/WXViewUtils .getScreenDensity (cxt ));
63
- mWXSDKInstance .setInstanceViewPortWidth (width );
63
+ mWXSDKInstance .setInstanceViewPortWidth (width , true );
64
64
WXLogUtils .d ("[WXMetaModule] setViewport success[device-width]=" + width );
65
65
} else {
66
66
int width = jsObj .getInteger (WIDTH );
67
67
if (width > 0 ) {
68
- mWXSDKInstance .setInstanceViewPortWidth (width );
68
+ mWXSDKInstance .setInstanceViewPortWidth (width , true );
69
69
}
70
70
WXLogUtils .d ("[WXMetaModule] setViewport success[width]=" + width );
71
71
}
You can’t perform that action at this time.
0 commit comments