Browse Source

0.0.50.beta25
- BottomMenu 和 MessageMenu 设置单选模式(.setSingleSelection())或多选模式(.setMultiSelection())时无需再必须指定 OnMenuItemClickListener;
- MessageDialog/InputDialog 在设置setInputInfo指定InputType时取消默认增加InputType.TYPE_CLASS_TEXT的行为(issues:#479);
- 增加 FullScreenDialog 获取屏幕圆角的方式;

Kongzue 3 months ago
parent
commit
1506bb9b34

+ 23 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -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;
     }

+ 1 - 1
gradle.properties

@@ -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