junixapp/XPopup

在Xpopup弹出的弹框中,再使用大图展示,在退出的时候报OOM

nocamles opened this issue · 2 comments

XPopup版本
如2.9.19

手机系统和型号
红米note 11 android11

描述你的问题
//中心弹窗
class CenterDialog2Defect(context: Context, var url: String) : CenterPopupView(context) {
lateinit var binding: Dialog2dDefectBinding
var activity = context as BaseActivity

override fun getImplLayoutId(): Int {
    return R.layout.dialog_2d_defect
}

...
override fun onCreate() {
...
//下载FTP图片保存到本地
//加载本地图片
withContext(Dispatchers.Main) {
binding.imgLayout2d.setOnClickListener {
XPopup.Builder(context).asImageViewer(
binding.imgLayout2d,
tempImage.absolutePath,
SmartGlideImageLoader(false, R.mipmap.pic_no_pic)
).show()
}
}
}

大图页面缩放没有问题,在退出页面时
java.lang.RuntimeException: Canvas: trying to draw too large(136430184bytes) bitmap.

单步调试在
ImageViewerPopupView的245行。执行doDismissAnimation的 snapshotView.post(new Runnable() 崩了

强行设置了srcView为空去掉动画效果之后 关闭不会崩了。但是动画效果没了,是不是在dialog中不能使用大图的动画效果