[Android] TV Browser: sanity check
Geoffrey Métais
git at videolan.org
Tue Sep 24 11:11:11 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Sep 24 11:10:44 2019 +0200| [eea7551c58cdf76b150f084c5e9ba84ffa3dc79e] | committer: Geoffrey Métais
TV Browser: sanity check
> https://code.videolan.org/videolan/vlc-android/commit/eea7551c58cdf76b150f084c5e9ba84ffa3dc79e
---
vlc-android/src/org/videolan/vlc/gui/tv/FileTvItemAdapter.kt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/FileTvItemAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/tv/FileTvItemAdapter.kt
index 95c737927..d0bd0f91b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/FileTvItemAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/FileTvItemAdapter.kt
@@ -123,8 +123,10 @@ class FileTvItemAdapter(private val type: Long, private val eventsHandler: IEven
val scale = newWidth.toFloat() / itemSize
binding.container.animate().scaleX(scale).scaleY(scale).translationZ(scale)
- eventsHandler.onItemFocused(binding.root, getItem(layoutPosition))
- focusListener?.onFocusChanged(layoutPosition)
+ if (layoutPosition in dataset.indices) {
+ eventsHandler.onItemFocused(binding.root, getItem(layoutPosition))
+ focusListener?.onFocusChanged(layoutPosition)
+ }
} else {
binding.container.animate().scaleX(1f).scaleY(1f).translationZ(1f)
}
More information about the Android
mailing list