add an optional extra check to avoid showing invalid files

This commit is contained in:
tibbi 2018-02-04 19:58:44 +01:00
parent 83443c2847
commit b2f54f0e6e
30 changed files with 63 additions and 3 deletions

View file

@ -38,6 +38,7 @@ class SettingsActivity : SimpleActivity() {
setupManageExcludedFolders()
setupManageHiddenFolders()
setupShowHiddenItems()
setupDoExtraCheck()
setupAutoplayVideos()
setupLoopVideos()
setupAnimateGifs()
@ -136,6 +137,14 @@ class SettingsActivity : SimpleActivity() {
config.showHiddenMedia = settings_show_hidden_items.isChecked
}
private fun setupDoExtraCheck() {
settings_do_extra_check.isChecked = config.doExtraCheck
settings_do_extra_check_holder.setOnClickListener {
settings_do_extra_check.toggle()
config.doExtraCheck = settings_do_extra_check.isChecked
}
}
private fun setupAutoplayVideos() {
settings_autoplay_videos.isChecked = config.autoplayVideos
settings_autoplay_videos_holder.setOnClickListener {

View file

@ -320,4 +320,8 @@ class Config(context: Context) : BaseConfig(context) {
var extendedDetails: Int
get() = prefs.getInt(EXTENDED_DETAILS, EXT_RESOLUTION or EXT_LAST_MODIFIED or EXT_EXIF_PROPERTIES)
set(extendedDetails) = prefs.edit().putInt(EXTENDED_DETAILS, extendedDetails).apply()
var doExtraCheck: Boolean
get() = prefs.getBoolean(DO_EXTRA_CHECK, false)
set(doExtraCheck) = prefs.edit().putBoolean(DO_EXTRA_CHECK, doExtraCheck).apply()
}

View file

@ -47,6 +47,7 @@ const val HIDE_EXTENDED_DETAILS = "hide_extended_details"
const val ONE_FINGER_ZOOM = "one_finger_zoom"
const val ALLOW_INSTANT_CHANGE = "allow_instant_change"
const val REPLACE_ZOOMABLE_IMAGES = "replace_zoomable_images"
const val DO_EXTRA_CHECK = "do_extra_check"
// slideshow
const val SLIDESHOW_INTERVAL = "slideshow_interval"

View file

@ -99,6 +99,7 @@ class MediaFetcher(val context: Context) {
val filterMedia = config.filterMedia
val showHidden = config.shouldShowHidden
val isThirdPartyIntent = config.isThirdPartyIntent
val doExtraCheck = config.doExtraCheck
cur.use {
if (cur.moveToFirst()) {
@ -137,7 +138,7 @@ class MediaFetcher(val context: Context) {
size = file.length()
}
if (size <= 0L)
if (size <= 0L || (doExtraCheck && !file.exists()))
continue
val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN)

View file

@ -166,6 +166,26 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_do_extra_check_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_do_extra_check"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/do_extra_check"/>
</RelativeLayout>
<View
android:id="@+id/videos_divider"
android:layout_width="match_parent"
@ -557,7 +577,7 @@
android:text="@string/allow_photo_gestures"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_screen_rotation_holder"
android:layout_width="match_parent"

View file

@ -140,6 +140,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -135,7 +135,8 @@
<string name="one_finger_zoom">Permet fer zoom amb un sol dit a pantalla complerta</string>
<string name="allow_instant_change">Permet canviar els mitjans de manera instantània fent clic als costats de la pantalla</string>
<string name="replace_zoomable_images">Substituïr imatges ampliades per les de millor quialitat</string>
<string name="hide_extended_details">Amaga els detalls estesos quan la barra d'estat està amagada</string>
<string name="hide_extended_details">Amaga els detalls estesos quan la barra d\'estat està amagada</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatures</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Beim Tippen auf eine Bildschirmseite sofort zwischen Medien wechseln</string>
<string name="replace_zoomable_images">Stark zoombare Bilder durch Bilder mit hoher Qualität ersetzen</string>
<string name="hide_extended_details">Erweiterte Details nicht anzeigen, wenn die Systemleiste versteckt ist</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Permitir el cambio instantáneo de medios haciendo clic en los lados de la pantalla</string>
<string name="replace_zoomable_images">Reemplace las imágenes con mucho zoom por otras de mejor calidad</string>
<string name="hide_extended_details">Ocultar detalles ampliados cuando la barra de estado está oculta</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Miniaturas</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Cambia media istantaneamente toccando sui lati dello schermo</string>
<string name="replace_zoomable_images">Sostituisci le immagini ingrandibili a fondo con altre di migliore qualità</string>
<string name="hide_extended_details">Nascondi i dettagli estesi quando la barra di stato è nascosta</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Miniature</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Tillat å skifte media øyeblikkelig ved å trykke på kanten av skjermen</string>
<string name="replace_zoomable_images">Erstatt dyp-zoombare bilder med bilder av bedre kvalitet</string>
<string name="hide_extended_details">Skjul utvidede detaljer når statuslinjen er skjult</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Minibilder</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Direct naar vorige/volgende door op de zijkanten van het scherm te tikken</string>
<string name="replace_zoomable_images">In hoge kwaliteit weergeven (ten koste van ver inzoomen)</string>
<string name="hide_extended_details">Uitgebreide informatie niet tonen als de statusbalk is verborgen</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Miniatuurvoorbeelden</string>

View file

@ -136,6 +136,7 @@
   <string name="allow_instant_change">Zezwalaj na natychmiastową zmianę multimediów po kliknięciu boków ekranu</string>
   <string name="replace_zoomable_images">Zamieniaj powiększalne obrazy na te o lepszej jakości</string>
   <string name="hide_extended_details">Ukrywaj dodatkowe szczegóły gdy pasek stanu jest ukryty</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
   <string name="thumbnails">Miniatury</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Permitir alternância instantânia de mídia clicando nas laterais da tela</string>
<string name="replace_zoomable_images">Substituir imagens aptas a grande quantitade de zoom por imagens de melhor qualidade</string>
<string name="hide_extended_details">Ocultar detalhes extendidos quando a barra de status estiver oculta</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Miniaturas</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Мгновенное переключение медиафайлов нажатием по краю экрана</string>
<string name="replace_zoomable_images">Заменить масштабируемые изображения высококачественными</string>
<string name="hide_extended_details">Не показывать подробности, если скрыта строка состояния</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Миниатюры</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Povoliť instantné prepínanie médií kliknutím na okraj obrazovky</string>
<string name="replace_zoomable_images">Nahradiť hlboko priblížiteľné obrázky s obrázkami s lepšou kvalitou</string>
<string name="hide_extended_details">Skryť rozšírené vlastnosti ak je skrytá stavová lišta</string>
<string name="do_extra_check">Predísť zobrazovaniu neplatných súborov dodatočnou kontrolou</string>
<!-- Setting sections -->
<string name="thumbnails">Náhľady</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">通过单击屏幕边缘来切换媒体</string>
<string name="replace_zoomable_images">用质量更好的图像替换可深度缩放的图像</string>
<string name="hide_extended_details">当状态栏隐藏时隐藏扩展详情</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">缩略图</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">允許點擊螢幕邊緣來快速切換媒體檔案</string>
<string name="replace_zoomable_images">可深度縮放的圖片用品質更佳的來取代</string>
<string name="hide_extended_details">狀態欄隱藏時,同時隱藏詳細資訊</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">縮圖</string>

View file

@ -136,6 +136,7 @@
<string name="allow_instant_change">Allow instantly changing media by clicking on screen sides</string>
<string name="replace_zoomable_images">Replace deep zoomable images with better quality ones</string>
<string name="hide_extended_details">Hide extended details when status bar is hidden</string>
<string name="do_extra_check">Do an extra check to avoid showing invalid files</string>
<!-- Setting sections -->
<string name="thumbnails">Thumbnails</string>