This commit is contained in:
zhongchao
2022-03-11 19:40:23 +08:00
parent c6adf078ee
commit b16e7edbd3
710 changed files with 78933 additions and 26 deletions

View File

@@ -33,12 +33,12 @@ public class BaseFloatDialog extends Dialog {
}
private void addFlag() {
// TODO 这里需要申请悬浮床权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
} else {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
}
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
// } else {
// getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
// }
getWindow().setType(WindowManager.LayoutParams.LAST_SUB_WINDOW);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);

View File

@@ -1,5 +1,6 @@
package com.mogo.module.common.dialog;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.TextView;
@@ -74,10 +75,10 @@ public class WMDialog implements DialogInterface {
private Context mContext;
private WMDialogParams mParams;
public Builder( Context context ) {
this.mContext = context;
public Builder( Activity activity ) {
this.mContext = activity;
mParams = new WMDialogParams();
mParams.mContext = context;
mParams.mContext = activity;
}
public Builder setContent( CharSequence content ) {

View File

@@ -8,8 +8,10 @@ import android.view.View;
import android.view.WindowManager;
/**
* 采用windowManager实现接口
* 采用windowManager实现接口(取消系统级弹窗)
* {@link DialogImpl}
*/
@Deprecated
class WindowManagerImpl implements IWindowManagerView {
private WindowManager mWindowManager;

View File

@@ -97,6 +97,7 @@ public class WindowManagerView {
return new WindowManagerView( mParams, new DialogImpl() );
}
@Deprecated
public WindowManagerView showInWindowManager() {
if ( mParams.mContentView == null ) {
throw new NullPointerException( "WMViewParams#mContentView must not be null." );