[1.0.0]
[m1] [适配+部分页面]
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package com.mogo.commons.screen;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeConfig;
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
@@ -12,11 +16,20 @@ public class ScreenHelper {
|
||||
* 正常屏幕和长屏分辨设置
|
||||
*/
|
||||
public static void setScreenConfig(Context context) {
|
||||
|
||||
int baseWidth = 2560;
|
||||
int baseHeight = 1600;
|
||||
|
||||
if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode) || AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)) {
|
||||
baseWidth = 1920;
|
||||
baseHeight = 1080;
|
||||
}
|
||||
|
||||
AutoSizeConfig.getInstance()
|
||||
.setBaseOnWidth(true)
|
||||
.setCustomFragment(true)
|
||||
.setDesignWidthInDp(2560)
|
||||
.setDesignHeightInDp(1600)
|
||||
.setDesignWidthInDp(baseWidth)
|
||||
.setDesignHeightInDp(baseHeight)
|
||||
.getUnitsManager().setSupportSP(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user