Commit c9942e0f authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais

Add a setting to avoid showing video thumbnails

parent 096b563c
......@@ -702,4 +702,6 @@
<string name="device_default">Device default</string>
<string name="track_number">%s tracks</string>
<string name="jump_to">Jump to</string>
<string name="show_video_thumbnails_summary">Show video thumbnails in lists</string>
<string name="show_video_thumbnails">Video thumbnails</string>
</resources>
......@@ -23,6 +23,12 @@
android:key="force_list_portrait"
android:summary="@string/force_list_portrait_summary"
android:title="@string/force_list_portrait" />
<CheckBoxPreference
android:defaultValue="true"
android:key="show_video_thumbnails"
android:summary="@string/show_video_thumbnails_summary"
android:title="@string/show_video_thumbnails" />
<CheckBoxPreference
android:defaultValue="false"
android:key="save_brightness"
......
......@@ -29,6 +29,7 @@ import org.videolan.vlc.databinding.AudioBrowserTvItemBinding
import org.videolan.vlc.gui.tv.TvUtil
import org.videolan.vlc.util.AppScope
import org.videolan.vlc.util.HttpImageLoader
import org.videolan.vlc.util.Settings
import org.videolan.vlc.util.ThumbnailsProvider
import org.videolan.vlc.util.ThumbnailsProvider.obtainBitmap
......@@ -47,6 +48,10 @@ fun loadImage(v: View, item: MediaLibraryItem?) {
if (item.itemType == MediaLibraryItem.TYPE_GENRE && !isForTV(binding)) {
return
}
if (item is MediaWrapper && item.type == MediaWrapper.TYPE_VIDEO && !Settings.getInstance(v.context).getBoolean("show_video_thumbnails", true)) {
updateImageView(UiTools.getDefaultVideoDrawable(v.context).bitmap, v, binding)
return
}
val isMedia = item.itemType == MediaLibraryItem.TYPE_MEDIA
val isGroup = isMedia && (item as MediaWrapper).type == MediaWrapper.TYPE_GROUP
val isFolder = !isMedia && item.itemType == MediaLibraryItem.TYPE_FOLDER;
......
......@@ -59,6 +59,10 @@ class PreferencesVideo : BasePreferenceFragment() {
(activity as PreferencesActivity).setRestart()
return true
}
"show_video_thumbnails" -> {
(activity as PreferencesActivity).setRestart()
return true
}
"media_seen" -> activity!!.setResult(PreferencesActivity.RESULT_UPDATE_SEEN_MEDIA)
}
return super.onPreferenceTreeClick(preference)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment