|
@@ -40,6 +40,7 @@ import com.kongzue.dialogx.util.views.ActivityScreenShotImageView;
|
|
|
import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
|
|
|
import com.kongzue.dialogx.util.views.MaxRelativeLayout;
|
|
|
|
|
|
+import java.lang.reflect.Method;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
/**
|
|
@@ -913,6 +914,28 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ 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;
|
|
|
}
|