Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
WEEX][Weex-Android] Add Build Model For MateX And Galaxy Fopld (#2453)
Browse files Browse the repository at this point in the history
  • Loading branch information
gubaojian authored and YorkShen committed May 17, 2019
1 parent 4da0cea commit f855198
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import com.taobao.weex.ui.flat.FlatGUIContext;
import com.taobao.weex.ui.view.WXScrollView;
import com.taobao.weex.utils.Trace;
import com.taobao.weex.utils.WXDeviceUtils;
import com.taobao.weex.utils.WXExceptionUtils;
import com.taobao.weex.utils.WXFileUtils;
import com.taobao.weex.utils.WXJsonUtils;
Expand Down Expand Up @@ -738,7 +739,7 @@ private void renderInternal(String pageName,
mApmForInstance.addStats(WXInstanceApm.KEY_PAGE_STATS_BUNDLE_SIZE,mWXPerformance.JSTemplateSize);
mRenderStartTime = System.currentTimeMillis();
WXSDKManager.getInstance().setCrashInfo(WXEnvironment.WEEX_CURRENT_KEY,pageName);;
if(mAutoAdjustDeviceWidth){
if(mAutoAdjustDeviceWidth && WXDeviceUtils.isAutoResize(mContext)){
if(WXEnvironment.AUTO_UPDATE_APPLICATION_SCREEN_SIZE) {
WXViewUtils.updateApplicationScreen(mContext);
}
Expand Down
33 changes: 33 additions & 0 deletions android/sdk/src/main/java/com/taobao/weex/utils/WXDeviceUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.taobao.weex.utils;

import android.content.Context;
import android.os.Build;

public class WXDeviceUtils {


public static boolean isAutoResize(Context context){
return isMateX(context) || isGalaxyFold(context);
}

/**
* Mate X
* */
public static boolean isMateX(Context context) {
return "HUAWEI".equalsIgnoreCase(Build.BRAND) && ("unknownRLI".equalsIgnoreCase(Build.DEVICE) || ("HWTAH".equalsIgnoreCase(Build.DEVICE)));
}


/**
* Galaxy Fopld
* */
public static boolean isGalaxyFold(Context context) {

if("samsung".equalsIgnoreCase(Build.BRAND) && "SM-F9000".equalsIgnoreCase(Build.MODEL)) {
return true;
}

return false;
}

}

0 comments on commit f855198

Please sign in to comment.