mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fix images in plugins list
This commit is contained in:
parent
46b88ba094
commit
0ca6c2a6e6
2 changed files with 18 additions and 2 deletions
|
@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import com.lagradost.cloudstream3.PROVIDER_STATUS_DOWN
|
||||
import com.lagradost.cloudstream3.R
|
||||
import com.lagradost.cloudstream3.plugins.PluginManager
|
||||
import com.lagradost.cloudstream3.utils.GlideApp
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.setImage
|
||||
import kotlinx.android.synthetic.main.repository_item.view.*
|
||||
|
||||
|
@ -61,6 +62,14 @@ class PluginAdapter(
|
|||
return PluginManager.getPluginsOnline().also { storedPlugins = it }
|
||||
}*/
|
||||
|
||||
// Clear glide image because setImageResource doesn't override
|
||||
override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
holder.itemView.entry_icon?.let { pluginIcon ->
|
||||
GlideApp.with(pluginIcon).clear(pluginIcon)
|
||||
}
|
||||
super.onViewRecycled(holder)
|
||||
}
|
||||
|
||||
inner class PluginViewHolder(itemView: View) :
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
|
@ -98,8 +107,7 @@ class PluginAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
if (metadata.iconUrl == null ||
|
||||
itemView.entry_icon?.setImage(metadata.iconUrl, null) != true) {
|
||||
if (itemView.entry_icon?.setImage(metadata.iconUrl, null) != true) {
|
||||
itemView.entry_icon?.setImageResource(R.drawable.ic_baseline_extension_24)
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,14 @@ class RepoAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
// Clear glide image because setImageResource doesn't override
|
||||
// override fun onViewRecycled(holder: RecyclerView.ViewHolder) {
|
||||
// holder.itemView.entry_icon?.let { repoIcon ->
|
||||
// GlideApp.with(repoIcon).clear(repoIcon)
|
||||
// }
|
||||
// super.onViewRecycled(holder)
|
||||
// }
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return repositories.size
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue