Closed chipssss closed 3 years ago
你好,使用这个库遇到native内存占用过大的case,场景是recyeclerview长列表动图加载,上下来回滑动。请问是需要手动释放webpDrawable吗? 有没有相关解决方案? Glide加载代码示例:
Glide.with(context) .asDrawable() .load(src) .apply(options) .into(object : CustomTarget<Drawable>() { override fun onLoadStarted(placeholder: Drawable?) { handler.imageLoadCompletion(null, null) } override fun onLoadCleared(placeholder: Drawable?) { } override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable> (resource as? Animatable)?.start() resource.setBounds(0, 0, resource.intrinsicWidth, resource.intrinsicHeight) handler.imageLoadCompletion(resource, null) // imageView.setDrawable(resource) } })
解决了, 采用CustomTarget加载drawable的方式需要自己回收, 在view.onStateDetach回调中调用Glide.with(context).clear(target)。 感谢楼主的库,使用方便。
你好,使用这个库遇到native内存占用过大的case,场景是recyeclerview长列表动图加载,上下来回滑动。请问是需要手动释放webpDrawable吗? 有没有相关解决方案? Glide加载代码示例: