junixapp / XPopup

🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)
Apache License 2.0
7.77k stars 1.17k forks source link

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

Open iFCoder opened 4 months ago

iFCoder commented 4 months ago

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();
}

}`