Skip to content
Snippets Groups Projects
Commit 429268ce authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix blank covers on TV

(cherry picked from commit fab123e2)
parent c7bb1e9c
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,11 @@ class FileTvItemAdapter(type: Int, private val eventsHandler: IEventsHandler, va
}
}
override fun onViewRecycled(holder: MediaTvItemAdapter.AbstractMediaItemViewHolder<MediaBrowserTvItemBinding>) {
super.onViewRecycled(holder)
holder.recycle()
}
override fun hasSections() = true
override fun setOnFocusChangeListener(focusListener: FocusableRecyclerView.FocusListener?) {
......
......@@ -75,6 +75,11 @@ class MediaTvItemAdapter(type: Int, private val eventsHandler: IEventsHandler, v
}
}
override fun onViewRecycled(holder: AbstractMediaItemViewHolder<ViewDataBinding>) {
super.onViewRecycled(holder)
holder.recycle()
}
override fun hasSections() = true
override fun submitList(pagedList: Any?) {
......
......@@ -2,13 +2,17 @@ package org.videolan.vlc.gui.view
import android.content.Context
import android.graphics.Bitmap
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.Icon
import android.net.Uri
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import java.util.concurrent.atomic.AtomicBoolean
class FadableImageView : AppCompatImageView {
private var animationRunning = AtomicBoolean(false)
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
......@@ -16,9 +20,10 @@ class FadableImageView : AppCompatImageView {
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle)
private fun fade() {
if (animationRunning.get()) return
alpha = 0f
animate().cancel()
animate().alpha(1f)
animationRunning.set(true)
animate().withEndAction { animationRunning.set(false) }.alpha(1f)
}
fun resetFade() {
......@@ -30,7 +35,7 @@ class FadableImageView : AppCompatImageView {
override fun setBackground(background: Drawable?) {
super.setBackground(background)
if (background != null) fade() else resetFade()
if (background == null || background is ColorDrawable) resetFade() else fade()
}
override fun setBackgroundResource(resid: Int) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment