setImageLoader(ImageLoader()) 设置图片加载方式
setOnClickDeleteListener() 删除回调
setImageList() 多张
or
setImage() 单张
AppPhotoView.Companion.Builder()
.setImageList(images)
.setImagePosition(3)
.setImageLoader(GlideImageLoader())
.build().show(supportFragmentManager)
AppPhotoView.Companion.Builder()
.openDel(true)
.setImageList(imageList)
.setImagePosition(3)
.setImageLoader(GlideImageLoader())
.setOnClickDeleteListener(object : AppPhotoView.OnClickDeleteListener {
override fun onCallback(view: View, img: Any, position: Int) {
imageList.removeAt(position)
}
})
.build().show(supportFragmentManager)
不参与图片的加载,可自行根据自己的喜好使用图片加载框架
class GlideImageLoader : ImageLoader() {
override fun loadImage(context: Context, img: Any, view: ImageView) {
Glide.with(context).load(img).into(view)
}
}