add the Glide load stopper to the directories view too

This commit is contained in:
tibbi 2017-03-15 21:16:27 +01:00
parent ee6e221de0
commit 9f91e14a32

View file

@ -313,9 +313,14 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
views.add(holder.bindView(activity, multiSelectorMode, multiSelector, dir, position, pinnedFolders.contains(dir.path))) views.add(holder.bindView(activity, multiSelectorMode, multiSelector, dir, position, pinnedFolders.contains(dir.path)))
} }
override fun onViewRecycled(holder: ViewHolder?) {
super.onViewRecycled(holder)
holder?.stopLoad()
}
override fun getItemCount() = dirs.size override fun getItemCount() = dirs.size
class ViewHolder(view: View, val itemClick: (Directory) -> (Unit)) : SwappingHolder(view, MultiSelector()) { class ViewHolder(val view: View, val itemClick: (Directory) -> (Unit)) : SwappingHolder(view, MultiSelector()) {
fun bindView(activity: SimpleActivity, multiSelectorCallback: ModalMultiSelectorCallback, multiSelector: MultiSelector, directory: Directory, pos: Int, isPinned: Boolean) fun bindView(activity: SimpleActivity, multiSelectorCallback: ModalMultiSelectorCallback, multiSelector: MultiSelector, directory: Directory, pos: Int, isPinned: Boolean)
: View { : View {
itemView.apply { itemView.apply {
@ -379,6 +384,10 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
itemClick(directory) itemClick(directory)
} }
} }
fun stopLoad() {
Glide.clear(view.dir_thumbnail)
}
} }
interface DirOperationsListener { interface DirOperationsListener {