Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用hasBlurBg,关闭打开弹窗多次,模糊效越不明显,最后弹框以外变黑了 #1225

Open
iFCoder opened this issue Jul 30, 2024 · 0 comments

Comments

@iFCoder
Copy link

iFCoder commented Jul 30, 2024

XPopup版本
如2.9.19

手机系统和型号
Xiaomi Pad 6 android 13

描述你的问题
我的fragment是个播放器的功能,里面用到了SurfaceView和MediaPlayer,按照下面的方式加入fragment,打开关闭弹窗后,弹窗以外的模糊背景变黑了
`public class CenterFragmentPop extends CenterPopupView {
private final Fragment mCenterFragment;

public static CenterFragmentPop create(Context mContext, Fragment fragment, XPopupCallback callback) {
    return (CenterFragmentPop) new XPopup.Builder(mContext)
            .hasBlurBg(true)
            .hasStatusBar(false)
            .isViewMode(true)
            .setPopupCallback(callback)
            .dismissOnTouchOutside(false)
            .dismissOnBackPressed(false)
            .asCustom(new CenterFragmentPop(mContext, fragment));
}

public CenterFragmentPop(@NonNull @NotNull Context context, Fragment fragment) {
    super(context);
    mCenterFragment = fragment;
}

@Override
protected int getImplLayoutId() {
    return R.layout.pop_center_fragment;
}

@Override
protected void onCreate() {
    super.onCreate();
    if (null == mCenterFragment) {
        return;
    }
    FragmentActivity activity = (FragmentActivity) getContext();
    FragmentManager fragmentManager = activity.getSupportFragmentManager();
    fragmentManager.beginTransaction().add(R.id.fl_center_pop_layout, mCenterFragment).commitAllowingStateLoss();
}

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant