Skip to content

Commit

Permalink
0.0.50.beta25
Browse files Browse the repository at this point in the history
- BottomMenu 和 MessageMenu 设置单选模式(.setSingleSelection())或多选模式(.setMultiSelection())时无需再必须指定 OnMenuItemClickListener;
- MessageDialog/InputDialog 在设置setInputInfo指定InputType时取消默认增加InputType.TYPE_CLASS_TEXT的行为(issues:#479);
- 增加 FullScreenDialog 获取屏幕圆角的方式;
  • Loading branch information
kongzue committed Dec 6, 2024
1 parent e89ab3b commit 1506bb9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
import com.kongzue.dialogx.util.views.MaxRelativeLayout;

import java.lang.reflect.Method;
import java.util.HashMap;

/**
Expand Down Expand Up @@ -913,6 +914,28 @@ public int getDeviceRadius() {
}
}
}
if (deviceRadiusCache == 0) {
String manufacturer = Build.MANUFACTURER.toLowerCase();
if ("xiaomi".equals(manufacturer)) {
try {
Class<?> systemPropertiesClass = Class.forName("android.os.SystemProperties");
Method getIntMethod = systemPropertiesClass.getMethod("getInt", String.class, int.class);
deviceRadiusCache = (int) getIntMethod.invoke(null, "ro.miui.notch.radius", 0);
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (deviceRadiusCache == 0) {
try {
int resourceId = me.getResources().getIdentifier("rounded_corner_radius", "dimen", "android");
if (resourceId > 0) {
deviceRadiusCache = me.getResources().getDimensionPixelSize(resourceId);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
return deviceRadiusCache;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

BUILD_VERSION=0.0.50.beta24
BUILD_VERSION=0.0.50.beta25
BUILD_VERSION_INT=50
DIALOGX_STYLE_VERSION=5
android.nonTransitiveRClass=true

0 comments on commit 1506bb9

Please sign in to comment.