From 7f73b9259e6858ebfe72d1dc4bb760701a4d42e9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Sep 2019 08:32:17 +0200 Subject: [PATCH 01/34] updating some libraries --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c67ed8ec4..c8fea00eb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.3' + implementation 'com.simplemobiletools:commons:5.17.9' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' @@ -75,8 +75,8 @@ dependencies { implementation 'info.androidhive:imagefilters:1.0.7' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.caverock:androidsvg-aar:1.3' - implementation 'com.github.tibbi:gestureviews:4444214285' - implementation 'com.github.tibbi:subsampling-scale-image-view:8341253173' + implementation 'com.github.tibbi:gestureviews:a2208ce9d9' + implementation 'com.github.tibbi:subsampling-scale-image-view:3afb6c1b6e' kapt 'com.github.bumptech.glide:compiler:4.9.0' // keep it here too, not just in Commons, else loading SVGs wont work kapt 'androidx.room:room-compiler:2.1.0' From 1030021ca16a416dcac2d53a546608c1a98d8ef7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Sep 2019 12:35:12 +0200 Subject: [PATCH 02/34] properly handle Date Taken value at file copy/move --- app/build.gradle | 2 +- .../gallery/pro/activities/ViewPagerActivity.kt | 6 +++++- .../gallery/pro/adapters/DirectoryAdapter.kt | 7 ++++++- .../gallery/pro/adapters/MediaAdapter.kt | 11 ++++++++--- .../gallery/pro/extensions/Activity.kt | 7 +++++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c8fea00eb..a0e988d2e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.9' + implementation 'com.simplemobiletools:commons:5.17.12' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 7cf212687..08e46f7c4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -576,7 +576,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val fileDirItems = arrayListOf(FileDirItem(currPath, currPath.getFilenameFromPath())) tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { - fixDateTaken(arrayListOf(currPath), false) + val newPath = "$it/${currPath.getFilenameFromPath()}" + rescanPaths(arrayListOf(newPath)) { + fixDateTaken(arrayListOf(newPath), false) + } + config.tempFolderPath = "" if (!isCopyOperation) { refreshViewPager() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index dafd0cc89..538b3ecb8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -442,7 +442,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList activity.tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { - activity.fixDateTaken(paths, false) + val destinationPath = it + val newPaths = fileDirItems.map { "$destinationPath/${it.name}" }.toMutableList() as java.util.ArrayList + activity.rescanPaths(newPaths) { + activity.fixDateTaken(newPaths, false) + } + config.tempFolderPath = "" listener?.refreshItems() finishActMode() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index f76fae3de..7c06e085d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -326,13 +326,18 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList + activity.rescanPaths(newPaths) { + activity.fixDateTaken(newPaths, false) + } if (!isCopyOperation) { listener?.refreshItems() - activity.updateFavoritePaths(fileDirItems, it) + activity.updateFavoritePaths(fileDirItems, destinationPath) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index bb271b7ac..1ae26673f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -292,7 +292,9 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, mediumDa callback() } - fixDateTaken(newPaths, false) + rescanPaths(newPaths) { + fixDateTaken(newPaths, false) + } } } @@ -356,7 +358,8 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, callbac var didUpdateFile = false val operations = ArrayList() val mediumDao = galleryDB.MediumDao() - rescanPaths(paths) { + + ensureBackgroundThread { for (path in paths) { val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME_ORIGINAL) ?: ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue From 255448fca29d824c8294ec2d67480cbe256df303 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Sep 2019 14:46:03 +0200 Subject: [PATCH 03/34] moving the editor bottom line a bit up --- app/src/main/res/layout/activity_edit.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index dcf322124..3dffbf1bf 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -38,6 +38,10 @@ android:layout_alignParentBottom="true" android:background="@drawable/gradient_background"/> + + - - From 74d23b0ff390c16d2e4a9244b4a6d8ecb35924f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Sat, 7 Sep 2019 01:12:44 +0100 Subject: [PATCH 04/34] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 9a782ef15..97094512a 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -33,7 +33,7 @@ Dados corrigidos com sucesso Partilhar foto redimensionada Olá,\n\nparece que você utilizou a opção de atualização existente na versão antiga. Agora já pode desinstalar essa versão antiga.\n\nApenas perderá os itens existentes na reciclagem e os favoritos não assinalados mas também terá que repor as predefinições da aplicação.\n\nObrigado! - Switch to file search across all visible folders + Trocar para pesquisa de ficheiros em todas as pastas visíveis Filtrar multimédia @@ -187,7 +187,7 @@ Velocidade Compromisso Não mostrar ficheiros inválidos - Show image file types + Mostrar o tipo de imagem Miniaturas From 28981ac870f6ad03d09faf7fae651db845d8539f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 7 Sep 2019 17:11:20 +0200 Subject: [PATCH 05/34] improve FixDateTaken, rescan paths missing from mediastore if necessary --- .../gallery/pro/extensions/Activity.kt | 23 +++++++++++++----- .../gallery/pro/extensions/Context.kt | 24 +++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index 1ae26673f..34f617e6e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -348,12 +348,13 @@ fun Activity.hasNavBar(): Boolean { return (realDisplayMetrics.widthPixels - displayMetrics.widthPixels > 0) || (realDisplayMetrics.heightPixels - displayMetrics.heightPixels > 0) } -fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, callback: (() -> Unit)? = null) { +fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasRescanned: Boolean = false, callback: (() -> Unit)? = null) { val BATCH_SIZE = 50 if (showToasts) { toast(R.string.fixing) } + val pathsToRescan = ArrayList() try { var didUpdateFile = false val operations = ArrayList() @@ -388,6 +389,10 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, callbac mediumDao.updateFavoriteDateTaken(path, timestamp) didUpdateFile = true + + if (!hasRescanned && getFileDateTaken(path) == 0L) { + pathsToRescan.add(path) + } } val resultSize = contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size @@ -395,12 +400,18 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, callbac didUpdateFile = false } - runOnUiThread { - if (showToasts) { - toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred) - } + if (hasRescanned || pathsToRescan.isEmpty()) { + runOnUiThread { + if (showToasts) { + toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred) + } - callback?.invoke() + callback?.invoke() + } + } else { + rescanPaths(pathsToRescan) { + fixDateTaken(paths, showToasts, true) + } } } } catch (e: Exception) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index a19e36606..34676a6a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -852,3 +852,27 @@ fun Context.updateDirectoryPath(path: String) { val directory = createDirectoryFromMedia(path, curMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) updateDBDirectory(directory, galleryDB.DirectoryDao()) } + +fun Context.getFileDateTaken(path: String): Long { + val projection = arrayOf( + MediaStore.Images.Media.DATE_TAKEN + ) + + val uri = MediaStore.Files.getContentUri("external") + val selection = "${MediaStore.Images.Media.DATA} = ?" + val selectionArgs = arrayOf(path) + + val cursor = contentResolver.query(uri, projection, selection, selectionArgs, null) + cursor?.use { + if (cursor.moveToFirst()) { + do { + try { + return cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) + } catch (e: Exception) { + } + } while (cursor.moveToNext()) + } + } + + return 0L +} From 94d34904d546acc93f8a0f4d8b3a80b60fceedbd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 7 Sep 2019 17:25:59 +0200 Subject: [PATCH 06/34] properly handle date taken after editing too --- .../simplemobiletools/gallery/pro/activities/EditActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt index 2e6741f26..d96a77c50 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt @@ -39,6 +39,7 @@ import com.simplemobiletools.gallery.pro.dialogs.OtherAspectRatioDialog import com.simplemobiletools.gallery.pro.dialogs.ResizeDialog import com.simplemobiletools.gallery.pro.dialogs.SaveAsDialog import com.simplemobiletools.gallery.pro.extensions.config +import com.simplemobiletools.gallery.pro.extensions.fixDateTaken import com.simplemobiletools.gallery.pro.extensions.openEditor import com.simplemobiletools.gallery.pro.helpers.* import com.simplemobiletools.gallery.pro.models.FilterItem @@ -874,7 +875,9 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } private fun scanFinalPath(path: String) { - rescanPaths(arrayListOf(path)) { + val paths = arrayListOf(path) + rescanPaths(paths) { + fixDateTaken(paths, false) setResult(Activity.RESULT_OK, intent) toast(R.string.file_saved) finish() From bfe867f262a571090b6a1b82e4c72254944ec794 Mon Sep 17 00:00:00 2001 From: sawka6630 Date: Sat, 7 Sep 2019 23:30:44 +0300 Subject: [PATCH 07/34] Update strings.xml --- app/src/main/res/values-uk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index b56f7184a..716ef2167 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -187,7 +187,7 @@ Швидкість Компроміс Запобігати показу пошкоджених файлів - Show image file types + Показувати типи файлів зображень Ескізи From 50e39315a59fe398e3222d5baf11bb54b0680a27 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 7 Sep 2019 22:53:07 +0200 Subject: [PATCH 08/34] fix #1576, properly handle fullscreen toggling on Chromebooks --- .../pro/activities/ViewPagerActivity.kt | 33 +++++++++++-------- .../gallery/pro/extensions/Context.kt | 2 ++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 08e46f7c4..53276bf15 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -323,19 +323,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 } - view_pager.adapter?.let { - (it as MyPagerAdapter).toggleFullscreen(mIsFullScreen) - checkSystemUI() - val newAlpha = if (mIsFullScreen) 0f else 1f - top_shadow.animate().alpha(newAlpha).start() - if (bottom_actions.isVisible()) { - bottom_actions.animate().alpha(newAlpha).start() - arrayOf(bottom_favorite, bottom_edit, bottom_share, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation, - bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility, bottom_rename).forEach { - it.isClickable = !mIsFullScreen - } - } - } + checkSystemUI() + fullscreenToggled() } if (intent.action == "com.android.camera.action.REVIEW") { @@ -1082,6 +1071,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun fragmentClicked() { mIsFullScreen = !mIsFullScreen checkSystemUI() + if (isChromebook()) { + fullscreenToggled() + } } override fun videoEnded(): Boolean { @@ -1138,6 +1130,21 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } + private fun fullscreenToggled() { + view_pager.adapter?.let { + (it as MyPagerAdapter).toggleFullscreen(mIsFullScreen) + val newAlpha = if (mIsFullScreen) 0f else 1f + top_shadow.animate().alpha(newAlpha).start() + if (bottom_actions.isVisible()) { + bottom_actions.animate().alpha(newAlpha).start() + arrayOf(bottom_favorite, bottom_edit, bottom_share, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation, + bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility, bottom_rename).forEach { + it.isClickable = !mIsFullScreen + } + } + } + } + private fun updateActionbarTitle() { runOnUiThread { if (mPos < getCurrentMedia().size) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 34676a6a2..6132bb2ae 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -876,3 +876,5 @@ fun Context.getFileDateTaken(path: String): Long { return 0L } + +fun Context.isChromebook() = packageManager.hasSystemFeature("org.chromium.arc.device_management") From acdefe7b0ac0bb124fb1437990b9710c9041b153 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Sep 2019 11:25:45 +0200 Subject: [PATCH 09/34] disabling some OTG related code as its handling changed once again --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 3f6993df1..63f6c8922 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -409,14 +409,15 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { config.addIncludedFolder(otgPath) } - if (config.OTGPath.isEmpty()) { + // OTG handling has been changed again in SDK version 28, the old method no longer works + /*if (config.OTGPath.isEmpty()) { runOnUiThread { ConfirmationDialog(this, getString(R.string.usb_detected), positive = R.string.ok, negative = 0) { config.wasOTGHandled = true showOTGPermissionDialog() } } - } + }*/ } } } From 049a63a04d88fde03d21f1fe8f0f2272a5d5724c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Sep 2019 11:35:59 +0200 Subject: [PATCH 10/34] update commons to 5.17.13 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index a0e988d2e..b4ef76e86 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.12' + implementation 'com.simplemobiletools:commons:5.17.13' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' From d8af7afb9a0d05cb56e89885c2481eebc367c889 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Sep 2019 11:54:23 +0200 Subject: [PATCH 11/34] update version to 6.9.5 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b4ef76e86..af5a3243d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 264 - versionName "6.9.4" + versionCode 265 + versionName "6.9.5" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From d76f3595ec798d8b20f731bfd0cb6b1f415f96dd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Sep 2019 11:54:29 +0200 Subject: [PATCH 12/34] updating changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c606839e..6d3ad35dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========== +Version 6.9.5 *(2019-09-08)* +---------------------------- + + * Added optional thumbnail icons for showing GIF/SVG/RAW file types + * Properly handle Date Taken value at copy/move/edit + * Fixed a glitch with white top actionmenu at selecting items + * Fixed fullscreen mode toggling on Chromebooks + Version 6.9.4 *(2019-08-21)* ---------------------------- From 4d016a9e096768b0a3e1592aa30c69b4e465266d Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 10 Sep 2019 09:34:49 +0200 Subject: [PATCH 13/34] fixing an error with no folders for scanning --- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 8d381eeed..c87341fca 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -178,7 +178,7 @@ class MediaFetcher(val context: Context) { val showHidden = config.shouldShowHidden val excludedFolders = config.excludedFolders foldersToScan = foldersToScan.filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden) } as ArrayList - return foldersToScan.distinctBy { it.getDistinctPath() }.toSet() as LinkedHashSet + return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet } private fun addFolder(curFolders: ArrayList, folder: String) { From fa0bc02f45b57f699467b588e0db4c7f683330f2 Mon Sep 17 00:00:00 2001 From: Vortex Date: Thu, 12 Sep 2019 11:26:01 +0800 Subject: [PATCH 14/34] improve Chinese translation --- app/src/main/res/values-zh-rCN/strings.xml | 152 ++++++++++----------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 7a37636b6..30c3c69c7 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1,78 +1,78 @@ 简约图库 - 简约图库 + 图库 编辑 打开相机 - (隐藏) - (排除) - 锁定目录 - 解除锁定目录 - 固定到顶部 + (已隐藏) + (已排除) + 固定文件夹 + 取消固定文件夹 + 置顶固定 文件视图 - 所有目录 - 目录视图 - 其他目录 - 在地图中显示 + 所有文件夹 + 文件夹视图 + 其他文件夹 + 在地图上显示 未知位置 - 增加一栏 - 减少一栏 - 更改封面图片 + 显示更多项目 + 显示更少项目 + 更换封面图片 选择图片 使用默认 音量 亮度 - 锁定方向 - 解锁方向 - 改变方向 + 锁定屏幕方向 + 解锁屏幕方向 + 更改屏幕方向 强制竖屏 强制横屏 - 默认 + 使用默认屏幕方向 修复拍摄日期 正在修复… 日期修复成功 - 调整图像尺寸并分享 - 嘿,\n\n看起来您是从旧的免费版应用程序升级的。您现在可以卸载旧版本,在该版本应用的设置菜单顶部有一个“升级到专业版”按钮。\n\n此操作将会删除回收站项目,并取消收藏已收藏的项目,你的应用设置也将会重置。\n\n谢谢! - 切换文件搜索目标为所有可见的文件夹 + 调整尺寸并分享 + 嘿,\n\n你似乎已经从旧的免费版应用升级。你现在可以卸载旧版本,在该版本的应用设置顶部有一个“升级到专业版”按钮。\n\n此操作会删除回收站项目,取消标记收藏项目,并重置应用设置。\n\n谢谢! + 切换文件搜索范围为所有可见的文件夹 - 要显示的媒体文件 + 筛选媒体文件 图片 视频 - GIFs + GIF RAW 图片 - SVGs - 所选的过滤器没有找到媒体文件。 - 更改过滤器 + SVG + 没有媒体文件匹配选定的筛选条件。 + 更改筛选条件 - 通过添加文件 \'.nomedia\' 到目录,可以防止目录及其子目录下的所有媒体被扫描。您可以通过设置中的 \'显示隐藏目录\' 选项改变设置,是否继续? + 该功能通过添加“.nomedia”文件到文件夹来隐藏它,这也会隐藏其所有子文件夹。您可以通过启用设置中的“显示隐藏的项目”选项来查看它们,是否继续? 排除 - 排除目录 - 管理排除目录 - 目录及其子目录中的媒体将不会在“简约图库”中显示,您可以在设置更改。 - 是否排除父目录? + 排除的文件夹 + 管理排除的文件夹 + 该操作仅会在“简约图库”中排除显示选定的文件夹及其子文件夹。您可以在设置中管理排除的文件夹。 + 是否排除父文件夹? 此目录及其子目录中的媒体将不会在“简约图库”中显示,但是其它应用可以访问。如果您想对其它应用隐藏,请使用隐藏功能。 - 移除全部 - 是否删除排除列表中的所有项目?此操作不会删除文件夹本身。 - 隐藏目录 - 管理隐藏目录 + 全部移除 + 是否移除排除列表中的所有项目?此操作不会删除文件夹本身。 + 隐藏的文件夹 + 管理隐藏的文件夹 看起来你没有任何使用“.nomedia”文件隐藏的目录。 - 包含目录 - 管理包含目录 - 添加目录 + 包含的文件夹 + 管理包含的文件夹 + 添加文件夹 如果您还有应用未扫描到的媒体文件,请添加所在目录路径。 没有找到媒体文件。请手动添加包含媒体文件的文件夹。 - 缩放 - 缩放选定区域并保存 + 调整尺寸 + 调整选定项目的尺寸并保存 宽度 高度 - 保持纵横比 - 请输入有效分辨率 + 保持高宽比 + 请输入有效的分辨率 编辑器 @@ -82,8 +82,8 @@ 无效的图片路径 图片编辑失败 编辑方式: - 未找到可用图片编辑器 - 未知的文件路径 + 没有找到图片编辑器 + 未知文件位置 无法覆盖源文件 向左旋转 向右旋转 @@ -96,32 +96,32 @@ 简约壁纸 - 设为壁纸 - 壁纸设置失败 - 设为壁纸... + 设置为壁纸 + 设置壁纸失败 + 设置壁纸方式: 正在设置壁纸… - 壁纸设置成功 - 纵向长宽比 - 横向长宽比 - 主屏幕壁纸 - 锁屏壁纸 - 主屏幕和锁屏壁纸 + 设置壁纸成功 + 纵向高宽比 + 横向高宽比 + 主屏幕 + 锁定屏幕 + 主屏幕和锁定屏幕 幻灯片 间隔(秒): - 包括照片 - 包括视频 - 包括 GIFs + 包含照片 + 包含视频 + 包含GIF 随机顺序 - 倒播 - 循环幻灯片 + 倒序播放 + 循环播放 动画 - 渐变 + 渐隐 滑动 幻灯片结束 - 未发现可用媒体 + 没有找到可播放幻灯片媒体文件 更改视图类型 @@ -131,35 +131,35 @@ 分组依据 - 禁用文件分组 - 目录 - 最近修改 - 最后修改(按日) - 最后修改(按月) + 不分组文件 + 文件夹 + 最后修改时间 + 最后修改时间(按日) + 最后修改时间(按月) 拍摄时间 - 拍摄日期(按日) - 拍摄日期(按月) + 拍摄时间(按日) + 拍摄时间(按月) 文件类型 扩展名 - 请注意,分组和排序是相互独立的 + 请注意,分组和排序是两种独立的组织方式 - 要在小部件上显示的文件夹: + 在小工具上显示的文件夹: 显示文件夹名称 - 自动播放 + 自动播放视频 记住上次视频播放位置 显示文件名 循环播放视频 GIF 缩略图 - 浏览时最大亮度 - 裁剪缩略图 + 全屏查看媒体文件时最大亮度 + 裁剪缩略图为正方形 显示视频时长 - 全屏方向 + 旋转全屏媒体文件依据 系统设置 - 设备方向 - 根据长宽比 + 设备旋转 + 高宽比 全屏时使用黑色背景和状态栏 水平滚动缩略图 全屏时自动隐藏状态栏 @@ -184,10 +184,10 @@ 显示留海(如果可用) 允许使用手势旋转图像 文件加载优先级 - 速度 + 快速 折中 避免显示无效的文件 - Show image file types + 显示图片文件类型 缩略图 From af3b4e46f03b0ec7d5fcbe8f83008b2c7a266681 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 20:21:25 +0200 Subject: [PATCH 15/34] properly fetch the Date Taken value on Android 10 --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index af5a3243d..057e9bfac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.13' + implementation 'com.simplemobiletools:commons:5.17.16' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index c87341fca..96bb4e727 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -304,7 +304,9 @@ class MediaFetcher(val context: Context) { try { val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) - dateTakens[path] = dateTaken + if (dateTaken != 0L) { + dateTakens[path] = dateTaken + } } catch (e: Exception) { } } while (cursor.moveToNext()) From ac462f5a3c6ecc86a3c6b2b7ed3012a114be4c78 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 20:22:29 +0200 Subject: [PATCH 16/34] fetch the file name only when needed --- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 96bb4e727..33621b58f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -302,9 +302,9 @@ class MediaFetcher(val context: Context) { if (cursor.moveToFirst()) { do { try { - val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) if (dateTaken != 0L) { + val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) dateTakens[path] = dateTaken } } catch (e: Exception) { From 1bb3cc54d847e2708b50197d2b4256a3c8692345 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 22:14:10 +0200 Subject: [PATCH 17/34] load fullscreen images quicker --- app/build.gradle | 2 +- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 057e9bfac..3f8f4ede9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -76,7 +76,7 @@ dependencies { implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.caverock:androidsvg-aar:1.3' implementation 'com.github.tibbi:gestureviews:a2208ce9d9' - implementation 'com.github.tibbi:subsampling-scale-image-view:3afb6c1b6e' + implementation 'com.github.tibbi:subsampling-scale-image-view:7810989016' kapt 'com.github.bumptech.glide:compiler:4.9.0' // keep it here too, not just in Commons, else loading SVGs wont work kapt 'androidx.room:room-compiler:2.1.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 9c39b95d0..51b7b7992 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -57,7 +57,7 @@ import java.util.* class PhotoFragment : ViewPagerFragment() { private val DEFAULT_DOUBLE_TAP_ZOOM = 2f - private val ZOOMABLE_VIEW_LOAD_DELAY = 150L + private val ZOOMABLE_VIEW_LOAD_DELAY = 100L private val SAME_ASPECT_RATIO_THRESHOLD = 0.01 // devices with good displays, but the rest of the hardware not good enough for them From 367337843463bbfafddd00d83a5426f21da5fdaf Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 22:51:42 +0200 Subject: [PATCH 18/34] show the recycle bin in some extra cases, if not empty --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 2 +- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 63f6c8922..2535031c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -950,7 +950,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val foldersToScan = mediaFetcher.getFoldersToScan() foldersToScan.add(FAVORITES) - if (config.useRecycleBin && config.showRecycleBinAtFolders) { + if (config.showRecycleBinAtFolders) { foldersToScan.add(RECYCLE_BIN) } else { foldersToScan.remove(RECYCLE_BIN) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 6132bb2ae..f5e94bd73 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -143,7 +143,7 @@ fun Context.movePinnedDirectoriesToFront(dirs: ArrayList): ArrayList< } } - if (config.useRecycleBin && config.showRecycleBinAtFolders && config.showRecycleBinLast) { + if (config.showRecycleBinAtFolders && config.showRecycleBinLast) { val binIndex = dirs.indexOfFirst { it.isRecycleBin() } if (binIndex != -1) { val bin = dirs.removeAt(binIndex) @@ -566,7 +566,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: ArrayList() } - if (!config.showRecycleBinAtFolders || !config.useRecycleBin) { + if (!config.showRecycleBinAtFolders) { directories.removeAll { it.isRecycleBin() } } From da5f0dfcd6a3799f46b407d8df8d07a1d3fa7dfd Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 22:59:33 +0200 Subject: [PATCH 19/34] update version to 6.9.6 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f8f4ede9..ffb7413eb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 265 - versionName "6.9.5" + versionCode 266 + versionName "6.9.6" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 466bbf0fa8ad75c0877c7d294494b2ec639817a6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 22:59:40 +0200 Subject: [PATCH 20/34] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d3ad35dd..e563a11e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 6.9.6 *(2019-09-12)* +---------------------------- + + * Improved the performance of loading fullscreen images in some cases + * Properly handle some specific SD cards + * Properly fetch Date Taken value on Android 10 + Version 6.9.5 *(2019-09-08)* ---------------------------- From ccc7f6417166787bee26af2001ac421c409d8743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20F=C4=B1r=C4=B1nc=C4=B1?= Date: Mon, 16 Sep 2019 01:05:34 +0300 Subject: [PATCH 21/34] Update strings.xml --- app/src/main/res/values-tr/strings.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index a7e5c8108..7dcc4de80 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -64,7 +64,7 @@ Dahil edilen klasörleri yönet Klasör ekle Medya içeren, ancak uygulama tarafından tanınmayan bazı klasörleriniz varsa, bunları elle ekleyebilirsiniz.\n\nBuraya bazı öğeler eklemek başka bir klasörü hariç tutmaz. - No media files have been found. You can solve it by adding the folders containing media files manually. + Hiçbir medya dosyası bulunamadı. Medya dosyalarını içeren klasörleri elle ekleyerek çözebilirsiniz. Yeniden boyutlandır @@ -116,8 +116,8 @@ Rastgele sırala Geriye doğru git Slayt gösterisini tekrarla - Animation - None + Animasyon + Hiçbiri Fade Slide Slayt gösterisi sona erdi @@ -134,14 +134,14 @@ Dosyaları gruplandırma Klasör Son değiştirilme - Last modified (daily) - Last modified (monthly) + Son değiştirilme (günlük) + Son değiştirilme (aylık) Çekildiği tarih - Date taken (daily) - Date taken (monthly) + Çekildiği tarih (günlük) + Çekildiği tarih (aylık) Dosya türü Uzantı - Please note that grouping and sorting are 2 independent fields + Lütfen gruplandırmanın ve sıralamanın 2 bağımsız alan olduğunu unutmayın Widget\'ta gösterilen klasör: @@ -183,11 +183,11 @@ Videoları yeni yatay hareketlerle daima ayrı bir ekranda aç Varsa bir çentik göster Hareketlerle resimlerin döndürülmesine izin ver - File loading priority - Speed - Compromise - Avoid showing invalid files - Show image file types + Dosya yükleme önceliği + Hız + Ödünsüz + Geçersiz dosyaları göstermekten kaçın + Resim dosyası türlerini göster Küçük resimler From 57485cf71fdbc4b09ff70fe755361a66637ecd57 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 16 Sep 2019 09:02:06 +0200 Subject: [PATCH 22/34] fixing a typo at the german translation --- app/src/main/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index db3af073c..12a21d7a4 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -180,7 +180,7 @@ Zeige den Papierkorb als letztes Element auf dem Hauptbildschirm Erlaube das Schließen der Vollbildansicht mit einer Abwärtsgeste Erlaube 1:1 Zoom mit zweimaligem, doppeltem Antippen - Öffne Videos immer auf einem speraten Bildschirm mit neuen horizontalen Gesten + Öffne Videos immer auf einem seperaten Bildschirm mit neuen horizontalen Gesten Show a notch if available Rotieren von Bildern mit Gesten zulassen Priorität beim Laden von Dateien From c5d14599d62abf42899486fc10fd0448a4d28827 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 16 Sep 2019 09:05:56 +0200 Subject: [PATCH 23/34] update commons to 5.17.17 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index ffb7413eb..943214ec9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.16' + implementation 'com.simplemobiletools:commons:5.17.17' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' From 02cc8ae98376d7847c99ba08d6f425739c2a44ac Mon Sep 17 00:00:00 2001 From: AlbatorV Date: Sat, 21 Sep 2019 14:55:14 +0200 Subject: [PATCH 24/34] Update strings.xml --- app/src/main/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 19ef5b79b..0b30220ac 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -187,7 +187,7 @@ Rapide Compromis Eviter l\'affichage de fichiers invalides - Show image file types + Afficher les types d'image Miniatures From 0adb0b33883e53b156c72239cece62dc961231a4 Mon Sep 17 00:00:00 2001 From: unbranched Date: Sat, 21 Sep 2019 17:22:49 +0200 Subject: [PATCH 25/34] Italian update --- app/src/main/res/values-it/strings.xml | 2 +- gradlew | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 gradlew diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8d6ad7350..0c6363a9c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -187,7 +187,7 @@ Veloce Compromesso Evita di mostrare file non validi - Show image file types + Mostra i tipi di file immagine Anteprime diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 From 26fa0c99027c9894c5b7b3c0eb888000cedb10f0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 24 Sep 2019 19:51:02 +0200 Subject: [PATCH 26/34] escaping an apostrophe --- app/src/main/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0b30220ac..7d4c6b7b4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -187,7 +187,7 @@ Rapide Compromis Eviter l\'affichage de fichiers invalides - Afficher les types d'image + Afficher les types d\'image Miniatures From 2d2f84e956e1e29049a0b1dfdd03cf53bbf496fc Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 27 Sep 2019 13:24:42 +0200 Subject: [PATCH 27/34] adding an icon for Portrait photos --- app/src/main/res/drawable/ic_portrait_photo_vector.xml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/src/main/res/drawable/ic_portrait_photo_vector.xml diff --git a/app/src/main/res/drawable/ic_portrait_photo_vector.xml b/app/src/main/res/drawable/ic_portrait_photo_vector.xml new file mode 100644 index 000000000..e94d39587 --- /dev/null +++ b/app/src/main/res/drawable/ic_portrait_photo_vector.xml @@ -0,0 +1,9 @@ + + + From 77f3c3adb670d32f4c3757bf57a25056ba3e1640 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 27 Sep 2019 15:26:58 +0200 Subject: [PATCH 28/34] split directories at media fetching into a separate arraylist --- .../gallery/pro/helpers/MediaFetcher.kt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 33621b58f..72d5e07f6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -207,11 +207,24 @@ class MediaFetcher(val context: Context) { val checkFileExistence = config.fileLoadingPriority == PRIORITY_VALIDITY val showHidden = config.shouldShowHidden val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() + val subdirs = ArrayList() val files = when (folder) { - FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toTypedArray() - RECYCLE_BIN -> deletedMedia.map { File(it.path) }.toTypedArray() - else -> File(folder).listFiles() ?: return media + FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toMutableList() as ArrayList + RECYCLE_BIN -> deletedMedia.map { File(it.path) }.toMutableList() as ArrayList + else -> { + val allFiles = File(folder).listFiles() ?: return media + val notDirs = ArrayList() + allFiles.forEach { + if (it.isDirectory) { + subdirs.add(it) + } else { + notDirs.add(it) + } + } + + notDirs + } } for (file in files) { From 49ad4d812f3715d4b0b5ce837664bfb8e2b0cbe0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 21:35:08 +0200 Subject: [PATCH 29/34] add only Portrait folders in subdirs at fetching media --- .../simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 72d5e07f6..57a354fb5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -207,7 +207,7 @@ class MediaFetcher(val context: Context) { val checkFileExistence = config.fileLoadingPriority == PRIORITY_VALIDITY val showHidden = config.shouldShowHidden val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() - val subdirs = ArrayList() + val subdirs = ArrayList() // used only for Portrait photos starting with "IMG_" for now val files = when (folder) { FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toMutableList() as ArrayList @@ -217,7 +217,9 @@ class MediaFetcher(val context: Context) { val notDirs = ArrayList() allFiles.forEach { if (it.isDirectory) { - subdirs.add(it) + if (it.name.startsWith("img_", true)) { + subdirs.add(it) + } } else { notDirs.add(it) } From 9308353862cfafb76cac74394341c47d8e63455b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 21:59:29 +0200 Subject: [PATCH 30/34] adding a new string for Portrait photos --- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-az/strings.xml | 1 + app/src/main/res/values-ca/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-gl/strings.xml | 1 + app/src/main/res/values-hr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-id/strings.xml | 1 + app/src/main/res/values-in/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko-rKR/strings.xml | 1 + app/src/main/res/values-lt/strings.xml | 1 + app/src/main/res/values-nb/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sl/strings.xml | 1 + app/src/main/res/values-sr/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-uk/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 35 files changed, 35 insertions(+) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index f0e7e674e..52217e9ef 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -42,6 +42,7 @@ الصور المتحركة RAW images SVGs + Portraits لم يتم العثور على ملفات وسائط مع الفلاتر المحددة تغيير الفلاتر diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 19c550c8c..4dc79a078 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -42,6 +42,7 @@ GIFs RAW images SVGs + Portraits No media files have been found with the selected filters. Change filters diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 9a97506aa..46859b3f0 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -42,6 +42,7 @@ GIFs Imatges RAW SVGs + Portraits No s’han tronat arxius amb els filtres seleccionats. Canviar filtres diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index d5d0e769b..9a7976420 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -42,6 +42,7 @@ GIFy RAW obrázky SVGčka + Portraits Se zvolenými filtry nebyly nalezeny žádné médiální soubory. Změnit filtry diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index e9452a427..ee4223671 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -42,6 +42,7 @@ GIF\'er RAW-billeder SVG\'er + Portraits Der blev ikke fundet nogen filer med det valgte filter. Skift filter diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 12a21d7a4..02940e5e8 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -42,6 +42,7 @@ GIFs RAW-Bilder SVGs + Portraits Keine Medien für die ausgewählten Filter gefunden. Filter ändern diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index c4dc1e9cd..12a2da51e 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -42,6 +42,7 @@ GIFs RAW Εικόνες SVGs + Portraits Δεν βρέθηκε κανένα αρχείο πολυμέσων με τα επιλεγμένα φίλτρα. Αλλαγή φίλτρων diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 3081ab47c..4dba0c743 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -42,6 +42,7 @@ GIFs Imagenes RAW SVGs + Portraits No se han encontrado ficheros con los filtros seleccionados. Cambiar filtros diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 4242e9b45..0a1f2763e 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -42,6 +42,7 @@ GIFit RAW images SVGs + Portraits Mediaa ei löytynyt valituilla suotimilla. Muuta suotimia diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 7d4c6b7b4..71f01f2f4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -42,6 +42,7 @@ GIFs Images RAW SVGs + Portraits Aucun fichier média trouvé avec les filtres sélectionnés Modifier les filtres diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 2029b965c..dfda9beff 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -42,6 +42,7 @@ GIFs RAW images SVGs + Portraits Non se atoparon medios dos indicados polo filtro. Cambiar filtro diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 5e3835a4a..2a668a5b6 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -42,6 +42,7 @@ GIF-ovi RAW slike SVG-ovi + Portraits Nije pronađena nijedna datoteka s odabranim filtrom. Promijeni filter diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 5c58d71c2..afa7bce05 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -42,6 +42,7 @@ GIF RAW kép SVG + Portraits A kiválasztott szűrők nem találtak médiafájlokat. Szűrők változtatása diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 373ccc640..90c413baa 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -42,6 +42,7 @@ GIF Gambar RAW SVG + Portraits Tidak ditemukan berkas media yang sesuai dengan filter ini. Ubah filter diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 373ccc640..90c413baa 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -42,6 +42,7 @@ GIF Gambar RAW SVG + Portraits Tidak ditemukan berkas media yang sesuai dengan filter ini. Ubah filter diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 0c6363a9c..14b13152e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -42,6 +42,7 @@ GIF Immagini RAW SVG + Portraits Nessun file trovato con il filtro selezionato. Cambia filtro diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 607b80397..2ce11bb4c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -42,6 +42,7 @@ GIF RAW SVG + Portraits 条件に該当するメディアがありません。 絞り込み条件を変更 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 39a8bc851..c7d7a61c6 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -42,6 +42,7 @@ GIFs RAW images SVGs + Portraits 설정된 필터와 일치하는 컨텐츠가 존재하지 않습니다. 필터 변경 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 658b2cd3f..1b6ca569d 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -42,6 +42,7 @@ GIF\'ai RAW images SVGs + Portraits Su pasirinktais filtrais nerasta medijos bylų. Pakeisti filtrus diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 468f37265..122fe3c21 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -42,6 +42,7 @@ GIF-bilder RAW-format-bilder SVG-bilder + Portraits Ingen media-filer er funnet med de valgte filtrene. Endre filtere diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index cb2217851..381064d46 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -42,6 +42,7 @@ GIF-bestanden RAW-afbeeldingen SVG-vectorafbeeldingen + Portraits Er zijn geen bestanden gevonden met de huidige filters. Filters aanpassen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 0b3fa9f1c..eca4efc7c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -42,6 +42,7 @@ GIFy Obrazy RAW Obrazy SVG + Portraits Nie znaleziono multimediów zgodnych z zastosowanymi filtrami. Zmień filtry diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 10378db4f..16b50c14e 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -42,6 +42,7 @@ GIFs Imagens RAW SVGs + Portraits Nenhum arquivo de mídia encontrado a partir dos filtros selecionados. Alterar filtros diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 97094512a..2c7e35c9a 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -42,6 +42,7 @@ GIF Imagens RAW SVG + Portraits Não foram encontrados ficheiros que cumpram os requisitos. Alterar filtros diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 800aeecae..af3760f3a 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -42,6 +42,7 @@ GIF RAW SVG + Portraits При заданных фильтрах медиафайлы не найдены Изменить фильтры diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 29f2feeff..273768f37 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -42,6 +42,7 @@ GIFká RAW obrázky SVGčká + Portréty So zvolenými filtrami sa nenašli žiadne média súbory. Zmeniť filtre diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index e5586dc90..1cb5167d0 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -42,6 +42,7 @@ GIFi RAW slike SVGji + Portraits Na podlagi izbranih filtrov ne najdem nobenih medijskih datotek. Spremeni filtre diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 2f4cff456..1ad685593 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -42,6 +42,7 @@ ГИФови Сирове слике СВГови + Portraits Нема пронађених медија датотека са изабраним филтерима. Измени филтере diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 2b0520f23..3b9bd7220 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -42,6 +42,7 @@ GIF-bilder RAW-bilder SVG-bilder + Portraits Inga mediefiler hittades med valda filter. Ändra filter diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 7dcc4de80..c41109bd4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -42,6 +42,7 @@ GIF\'ler RAW resimler SVG\'ler + Portraits Seçilen filtrelerle hiçbir medya dosyası bulunamadı. Filtreleri değiştir diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 716ef2167..d78bb72bb 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -42,6 +42,7 @@ GIF-зображення RAW-зображення SVG-зображення + Portraits З вибраними фільтрами мультимедійні файли не знайдено. Змінити фільтри diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 30c3c69c7..7dd7e05e0 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -42,6 +42,7 @@ GIF RAW 图片 SVG + Portraits 没有媒体文件匹配选定的筛选条件。 更改筛选条件 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index c572d9da7..046c9eb2b 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -42,6 +42,7 @@ GIF RAW圖檔 SVG + Portraits 選擇的篩選條件未發現媒體檔案。 更改篩選條件 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a2c94d6c2..d011e8b4f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -42,6 +42,7 @@ GIF RAW圖檔 SVG + Portraits 選擇的篩選條件未發現媒體檔案。 更改篩選條件 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 72a9d9e6a..6ecf9a26d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,6 +42,7 @@ GIFs RAW images SVGs + Portraits No media files have been found with the selected filters. Change filters From ad85ec5a634a5f29fc78eace3512b18e62e0508e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 22:04:19 +0200 Subject: [PATCH 31/34] start showing portrait photos better, if appropriate --- .../gallery/pro/dialogs/FilterMediaDialog.kt | 3 +++ .../simplemobiletools/gallery/pro/helpers/Constants.kt | 3 ++- .../gallery/pro/helpers/MediaFetcher.kt | 10 +++++++++- app/src/main/res/layout/dialog_filter_media.xml | 8 ++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt index 0802d5c67..b4c072021 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/FilterMediaDialog.kt @@ -19,6 +19,7 @@ class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: filter_media_gifs.isChecked = filterMedia and TYPE_GIFS != 0 filter_media_raws.isChecked = filterMedia and TYPE_RAWS != 0 filter_media_svgs.isChecked = filterMedia and TYPE_SVGS != 0 + filter_media_portraits.isChecked = filterMedia and TYPE_PORTRAITS != 0 } AlertDialog.Builder(activity) @@ -41,6 +42,8 @@ class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: result += TYPE_RAWS if (view.filter_media_svgs.isChecked) result += TYPE_SVGS + if (view.filter_media_portraits.isChecked) + result += TYPE_PORTRAITS activity.config.filterMedia = result callback(result) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index 134df275c..7f91dc21b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -162,7 +162,8 @@ const val TYPE_VIDEOS = 2 const val TYPE_GIFS = 4 const val TYPE_RAWS = 8 const val TYPE_SVGS = 16 -const val TYPE_DEFAULT_FILTER = TYPE_IMAGES or TYPE_VIDEOS or TYPE_GIFS or TYPE_RAWS or TYPE_SVGS +const val TYPE_PORTRAITS = 32 +const val TYPE_DEFAULT_FILTER = TYPE_IMAGES or TYPE_VIDEOS or TYPE_GIFS or TYPE_RAWS or TYPE_SVGS or TYPE_PORTRAITS const val LOCATION_INTERNAL = 1 const val LOCATION_SD = 2 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 57a354fb5..ba762eb3a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -206,6 +206,7 @@ class MediaFetcher(val context: Context) { val checkProperFileSize = getProperFileSize || config.fileLoadingPriority == PRIORITY_COMPROMISE val checkFileExistence = config.fileLoadingPriority == PRIORITY_VALIDITY val showHidden = config.shouldShowHidden + val showPortraits = config.filterMedia and TYPE_PORTRAITS != 0 val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() val subdirs = ArrayList() // used only for Portrait photos starting with "IMG_" for now @@ -217,7 +218,7 @@ class MediaFetcher(val context: Context) { val notDirs = ArrayList() allFiles.forEach { if (it.isDirectory) { - if (it.name.startsWith("img_", true)) { + if (showPortraits && it.name.startsWith("img_", true)) { subdirs.add(it) } } else { @@ -229,6 +230,12 @@ class MediaFetcher(val context: Context) { } } + for (subdir in subdirs) { + val portraitFiles = subdir.listFiles() ?: continue + val cover = portraitFiles.firstOrNull { it.name.contains("cover", true) } ?: portraitFiles.first() + files.add(cover) + } + for (file in files) { if (shouldStop) { break @@ -298,6 +305,7 @@ class MediaFetcher(val context: Context) { media.add(medium) } } + return media } diff --git a/app/src/main/res/layout/dialog_filter_media.xml b/app/src/main/res/layout/dialog_filter_media.xml index b90fc9aeb..f707967a2 100644 --- a/app/src/main/res/layout/dialog_filter_media.xml +++ b/app/src/main/res/layout/dialog_filter_media.xml @@ -49,4 +49,12 @@ android:paddingBottom="@dimen/activity_margin" android:text="@string/svgs"/> + + From 230d793a40844ce66fbbfec9af761e18bfcad40d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 22:08:31 +0200 Subject: [PATCH 32/34] removing a redundant config call --- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index ba762eb3a..ad7070351 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -206,7 +206,7 @@ class MediaFetcher(val context: Context) { val checkProperFileSize = getProperFileSize || config.fileLoadingPriority == PRIORITY_COMPROMISE val checkFileExistence = config.fileLoadingPriority == PRIORITY_VALIDITY val showHidden = config.shouldShowHidden - val showPortraits = config.filterMedia and TYPE_PORTRAITS != 0 + val showPortraits = filterMedia and TYPE_PORTRAITS != 0 val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() val subdirs = ArrayList() // used only for Portrait photos starting with "IMG_" for now From bc455addb4c595cb31caf01455ab97813b23d611 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 22:46:24 +0200 Subject: [PATCH 33/34] do not show portrait folders on the main screen --- .../simplemobiletools/gallery/pro/extensions/String.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt index ac921defd..0d708ce1a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt @@ -16,6 +16,15 @@ fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPath } val file = File(this) + if (file.name.startsWith("img_", true)) { + val files = file.list() + if (files != null) { + if (files.any { it.contains("portrait", true) && it.contains("burst", true) }) { + return false + } + } + } + if (!showHidden && file.isHidden) { return false } else if (includedPaths.contains(this)) { From e684c660b58bc3f7aa8a750cec84ea02556446c8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Sep 2019 23:18:40 +0200 Subject: [PATCH 34/34] add more handling for Portrait file type --- .../simplemobiletools/gallery/pro/extensions/ArrayList.kt | 4 ++++ .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 6 ++++-- .../com/simplemobiletools/gallery/pro/models/Medium.kt | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt index 27289c37f..551b47d61 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/ArrayList.kt @@ -25,5 +25,9 @@ fun ArrayList.getDirMediaTypes(): Int { types += TYPE_SVGS } + if (any { it.isPortrait() }) { + types += TYPE_PORTRAITS + } + return types } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index f5e94bd73..86bd21488 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -584,7 +584,8 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: (filterMedia and TYPE_VIDEOS != 0 && it.types and TYPE_VIDEOS != 0) || (filterMedia and TYPE_GIFS != 0 && it.types and TYPE_GIFS != 0) || (filterMedia and TYPE_RAWS != 0 && it.types and TYPE_RAWS != 0) || - (filterMedia and TYPE_SVGS != 0 && it.types and TYPE_SVGS != 0) + (filterMedia and TYPE_SVGS != 0 && it.types and TYPE_SVGS != 0) || + (filterMedia and TYPE_PORTRAITS != 0 && it.types and TYPE_PORTRAITS != 0) } }) as ArrayList @@ -640,7 +641,8 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag (filterMedia and TYPE_VIDEOS != 0 && it.type == TYPE_VIDEOS) || (filterMedia and TYPE_GIFS != 0 && it.type == TYPE_GIFS) || (filterMedia and TYPE_RAWS != 0 && it.type == TYPE_RAWS) || - (filterMedia and TYPE_SVGS != 0 && it.type == TYPE_SVGS) + (filterMedia and TYPE_SVGS != 0 && it.type == TYPE_SVGS) || + (filterMedia and TYPE_PORTRAITS != 0 && it.type == TYPE_PORTRAITS) } }) as ArrayList diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt index 6044219d7..04c685229 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Medium.kt @@ -44,6 +44,8 @@ data class Medium( fun isSVG() = type == TYPE_SVGS + fun isPortrait() = type == TYPE_PORTRAITS + fun isHidden() = name.startsWith('.') fun getBubbleText(sorting: Int, context: Context) = when {