diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 005069de69bec4c504a75c0df69df0b35ae91eae..e11dfaa20b0b0da93dfa1bcb735ac0b98167b4f1 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - diff --git a/android/src/main/java/com/beefe/picker/PickerViewModule.java b/android/src/main/java/com/beefe/picker/PickerViewModule.java index 40f2d8d597b9b50b7e2d5e50a1636600872a43f3..b89ce3320a027bd3dc243afe6e3cbef20494fa64 100644 --- a/android/src/main/java/com/beefe/picker/PickerViewModule.java +++ b/android/src/main/java/com/beefe/picker/PickerViewModule.java @@ -12,6 +12,7 @@ import android.view.Window; import android.view.WindowManager; import android.widget.RelativeLayout; import android.widget.TextView; +import android.os.Build; import com.beefe.picker.util.MIUIUtils; import com.beefe.picker.view.OnSelectedListener; @@ -358,10 +359,15 @@ public class PickerViewModule extends ReactContextBaseJavaModule implements Life WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(); Window window = dialog.getWindow(); if (window != null) { - if (MIUIUtils.isMIUI()) { - layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION; - }else { - //layoutParams.type = WindowManager.LayoutParams.TYPE_TOAST; + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; + window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); + }else{ + if (MIUIUtils.isMIUI()) { + layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION; + }else { + //layoutParams.type = WindowManager.LayoutParams.TYPE_TOAST; + } } layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; layoutParams.format = PixelFormat.TRANSPARENT; @@ -369,7 +375,7 @@ public class PickerViewModule extends ReactContextBaseJavaModule implements Life layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; layoutParams.height = height; layoutParams.gravity = Gravity.BOTTOM; - window.setAttributes(layoutParams); + window.setAttributes(layoutParams); } } else { dialog.dismiss();