1.超管接口对接和家族公会UI修改

This commit is contained in:
huangjian
2021-09-01 19:02:38 +08:00
parent 2f0ca83ec7
commit 66d2df5fc3
28 changed files with 311 additions and 111 deletions

View File

@@ -34,18 +34,22 @@ public class ScreenUtil {
}
public static int dip2px(float dipValue) {
init(NimUIKit.getContext());
return (int) (dipValue * density + 0.5f);
}
public static int px2dip(float pxValue) {
init(NimUIKit.getContext());
return (int) (pxValue / density + 0.5f);
}
public static int sp2px(float spValue) {
init(NimUIKit.getContext());
return (int) (spValue * scaleDensity + 0.5f);
}
public static int getDialogWidth() {
init(NimUIKit.getContext());
dialogWidth = (int) (screenMin * RATIO);
return dialogWidth;
}
@@ -68,6 +72,7 @@ public class ScreenUtil {
}
public static int getDisplayWidth() {
init(NimUIKit.getContext());
if (screenWidth == 0) {
GetInfo(NimUIKit.getContext());
}
@@ -75,6 +80,7 @@ public class ScreenUtil {
}
public static int getDisplayHeight() {
init(NimUIKit.getContext());
if (screenHeight == 0) {
GetInfo(NimUIKit.getContext());
}
@@ -88,8 +94,8 @@ public class ScreenUtil {
DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
screenWidth = dm.widthPixels;
screenHeight = dm.heightPixels;
screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth;
screenMin = Math.min(screenWidth, screenHeight);
screenMax = Math.max(screenWidth, screenHeight);
density = dm.density;
scaleDensity = dm.scaledDensity;
xdpi = dm.xdpi;