Skip to content

Commit cd5f971

Browse files
Karthikeyan Ganesanxwenliang
authored andcommitted
Window Dialog Type change to TYPE_SYSTEM_ALERT (beefe#307)
* add SYSTEM_ALERT_WINDOW permission to draw overlay * TYPE_APPLICATION_OVERLAY - add type check * add version check * add import lib * permission move to main app manifest * set layoutparams * add type - TYPE_SYSTEM_ALERT * add permission SYSTEM_ALERT_WINDOw
1 parent 5f4d527 commit cd5f971

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.beefe.picker">
2+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
23
</manifest>

android/src/main/java/com/beefe/picker/PickerViewModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ public void onSelected(ArrayList<ReturnData> selectedList) {
360360
Window window = dialog.getWindow();
361361
if (window != null) {
362362
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
363-
layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
364-
window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
363+
window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
365364
}else{
366365
if (MIUIUtils.isMIUI()) {
367366
layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION;

0 commit comments

Comments
 (0)