This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WEEX][Weex-Android] Add Build Model For MateX And Galaxy Fopld (#2453)
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
android/sdk/src/main/java/com/taobao/weex/utils/WXDeviceUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |