From 90b4ab470dabf87a1f066b1c1b6fb1b484a50574 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Jan 2020 19:06:08 +0100 Subject: [PATCH 01/98] limit the file loading settings item label length to avoid some glitches --- app/src/main/res/layout/activity_settings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index e99e5adc5..b7d436f28 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -95,6 +95,8 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toStartOf="@+id/settings_file_loading_priority" + android:ellipsize="end" + android:lines="1" android:paddingLeft="@dimen/medium_margin" android:paddingRight="@dimen/medium_margin" android:text="@string/file_loading_priority"/> From 89790ebdfe340b905b644508a5264a043c122d32 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Jan 2020 23:27:40 +0100 Subject: [PATCH 02/98] reverting Glide back to 4.10.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c72469756..15c8c810f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.21.24' + implementation 'com.simplemobiletools:commons:5.21.25' 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' @@ -84,7 +84,7 @@ dependencies { implementation 'com.github.tibbi:gestureviews:8dccb8450b' implementation 'com.github.tibbi:subsampling-scale-image-view:d404e74e39' - kapt 'com.github.bumptech.glide:compiler:4.11.0' + kapt 'com.github.bumptech.glide:compiler:4.10.0' kapt 'androidx.room:room-compiler:2.2.2' implementation 'androidx.room:room-runtime:2.2.2' From 6b95c585592a485878993e5d4f230c0736c7fbfd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Jan 2020 23:29:03 +0100 Subject: [PATCH 03/98] try flipping some migration lines to avoid working on nonexistent tables --- .../gallery/pro/databases/GalleryDatabase.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt index 9b01fe7cb..e190b37d7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt @@ -61,9 +61,9 @@ abstract class GalleryDatabase : RoomDatabase() { private val MIGRATION_6_7 = object : Migration(6, 7) { override fun migrate(database: SupportSQLiteDatabase) { database.execSQL("CREATE TABLE IF NOT EXISTS `date_takens` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `filename` TEXT NOT NULL, `parent_path` TEXT NOT NULL, `date_taken` INTEGER NOT NULL, `last_fixed` INTEGER NOT NULL)") - database.execSQL("CREATE UNIQUE INDEX `index_date_takens_full_path` ON `date_takens` (`full_path`)") - database.execSQL("CREATE TABLE IF NOT EXISTS `favorites` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `filename` TEXT NOT NULL, `parent_path` TEXT NOT NULL)") + + database.execSQL("CREATE UNIQUE INDEX `index_date_takens_full_path` ON `date_takens` (`full_path`)") database.execSQL("CREATE UNIQUE INDEX `index_favorites_full_path` ON `favorites` (`full_path`)") } } From e93eade241124f797c4c43b7ee55896e0ac89fa1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 19 Jan 2020 10:51:36 +0100 Subject: [PATCH 04/98] update version to 6.11.8 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 15c8c810f..9b9269853 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 287 - versionName "6.11.7" + versionCode 288 + versionName "6.11.8" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 4e2380f13af0894dcc343162712ec184a4534a61 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 19 Jan 2020 10:51:44 +0100 Subject: [PATCH 05/98] updating changelog --- CHANGELOG.md | 5 +++++ fastlane/metadata/android/en-US/changelogs/288.txt | 1 + 2 files changed, 6 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/288.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a0bb855..a76981def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 6.11.8 *(2020-01-19)* +---------------------------- + + * Reverted Glide to fix some crashes + Version 6.11.7 *(2020-01-16)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/288.txt b/fastlane/metadata/android/en-US/changelogs/288.txt new file mode 100644 index 000000000..9631ebb6a --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/288.txt @@ -0,0 +1 @@ + * Reverted Glide to fix some crashes From 56d721b68aa0c61c9e373ee9133eed16d20e860a Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 24 Jan 2020 22:47:42 +0100 Subject: [PATCH 06/98] moving the isFavorite function at FavoritesDAO --- .../gallery/pro/activities/ViewPagerActivity.kt | 2 +- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- .../simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt | 4 +++- .../com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt | 3 --- 4 files changed, 5 insertions(+), 6 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 0dc77ed6c..1e456721b 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 @@ -375,7 +375,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View else -> TYPE_IMAGES } - val isFavorite = mediumDao.isFavorite(mPath) + val isFavorite = galleryDB.FavoritesDAO().isFavorite(mPath) val duration = if (type == TYPE_VIDEOS) mPath.getVideoDuration() else 0 val ts = System.currentTimeMillis() val medium = Medium(null, mPath.getFilenameFromPath(), mPath, mPath.getParentPath(), ts, ts, File(mPath).length(), type, duration, isFavorite, 0) 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 552b47339..b21e4a390 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 @@ -827,7 +827,7 @@ fun Context.addPathToDB(path: String) { try { val mediumDao = galleryDB.MediumDao() - val isFavorite = mediumDao.isFavorite(path) + val isFavorite = galleryDB.FavoritesDAO().isFavorite(path) val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0 val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(), File(path).length(), type, videoDuration, isFavorite, 0L) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt index 1d80c3e80..d1fa0856e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt @@ -1,8 +1,10 @@ package com.simplemobiletools.gallery.pro.interfaces import androidx.room.Dao +import androidx.room.Query @Dao interface FavoritesDAO { - + @Query("SELECT id FROM favorites WHERE full_path = :path COLLATE NOCASE") + fun isFavorite(path: String): Boolean } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt index 490bd62f4..1ce2bb641 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt @@ -21,9 +21,6 @@ interface MediumDao { @Query("SELECT filename, full_path, parent_path, last_modified, date_taken, size, type, video_duration, is_favorite, deleted_ts FROM media WHERE deleted_ts != 0") fun getDeletedMedia(): List - @Query("SELECT is_favorite FROM media WHERE full_path = :path COLLATE NOCASE") - fun isFavorite(path: String): Boolean - @Insert(onConflict = REPLACE) fun insert(medium: Medium) From b867d2a2eb872d9dfef857eba97a9f37758e950e Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 24 Jan 2020 23:10:40 +0100 Subject: [PATCH 07/98] at deleting a file path from db, delete it from favorites too --- .../simplemobiletools/gallery/pro/extensions/Context.kt | 7 ++++++- .../gallery/pro/interfaces/FavoritesDAO.kt | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) 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 b21e4a390..5ead9ba4e 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 @@ -736,8 +736,13 @@ fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList { } fun Context.deleteDBPath(mediumDao: MediumDao, path: String) { + deleteMediumWithPath(mediumDao, path.replaceFirst(recycleBinPath, RECYCLE_BIN)) +} + +fun Context.deleteMediumWithPath(mediumDao: MediumDao, path: String) { try { - mediumDao.deleteMediumPath(path.replaceFirst(recycleBinPath, RECYCLE_BIN)) + mediumDao.deleteMediumPath(path) + galleryDB.FavoritesDAO().deleteFavoritePath(path) } catch (ignored: Exception) { } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt index d1fa0856e..6daa09356 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt @@ -7,4 +7,7 @@ import androidx.room.Query interface FavoritesDAO { @Query("SELECT id FROM favorites WHERE full_path = :path COLLATE NOCASE") fun isFavorite(path: String): Boolean + + @Query("DELETE FROM favorites WHERE full_path = :path COLLATE NOCASE") + fun deleteFavoritePath(path: String) } From fb0badeca5288d4a7d5583c43e68ef2b13e9354c Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 24 Jan 2020 23:29:03 +0100 Subject: [PATCH 08/98] adding a few more favorites related queries --- .../gallery/pro/extensions/Context.kt | 7 +++---- .../gallery/pro/interfaces/FavoritesDAO.kt | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) 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 5ead9ba4e..b013354bf 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 @@ -28,10 +28,7 @@ import com.simplemobiletools.gallery.pro.helpers.* import com.simplemobiletools.gallery.pro.interfaces.DirectoryDao import com.simplemobiletools.gallery.pro.interfaces.MediumDao import com.simplemobiletools.gallery.pro.interfaces.WidgetsDao -import com.simplemobiletools.gallery.pro.models.AlbumCover -import com.simplemobiletools.gallery.pro.models.Directory -import com.simplemobiletools.gallery.pro.models.Medium -import com.simplemobiletools.gallery.pro.models.ThumbnailItem +import com.simplemobiletools.gallery.pro.models.* import com.simplemobiletools.gallery.pro.svg.SvgSoftwareLayerSetter import com.simplemobiletools.gallery.pro.views.MySquareImageView import pl.droidsonroids.gif.GifDrawable @@ -721,6 +718,8 @@ fun Context.getFavoritePaths(): ArrayList { } } +fun Context.getFavoriteFromPath(path: String) = Favorite(null, path, path.getFilenameFromPath(), path.getParentPath()) + // remove the "recycle_bin" from the file path prefix, replace it with real bin path /data/user... fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList { val media = try { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt index 6daa09356..f3b97e6ad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt @@ -1,10 +1,25 @@ package com.simplemobiletools.gallery.pro.interfaces import androidx.room.Dao +import androidx.room.Insert +import androidx.room.OnConflictStrategy import androidx.room.Query +import com.simplemobiletools.gallery.pro.models.Favorite @Dao interface FavoritesDAO { + @Insert(onConflict = OnConflictStrategy.REPLACE) + fun insert(favorite: Favorite) + + @Insert(onConflict = OnConflictStrategy.REPLACE) + fun insertAll(favorites: List) + + @Query("SELECT full_path FROM favorites") + fun getFavoriteRawPaths(): List + + @Query("SELECT favorites.full_path FROM favorites INNER JOIN media ON favorites.full_path = media.full_path WHERE media.deleted_ts = 0") + fun getValidFavoritePaths(): List + @Query("SELECT id FROM favorites WHERE full_path = :path COLLATE NOCASE") fun isFavorite(path: String): Boolean From a7b7881d732caab95874acb4f5864b68ca924143 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 09:34:33 +0100 Subject: [PATCH 09/98] moving the favorite toggling function into FavoritesDao --- .../gallery/pro/activities/ViewPagerActivity.kt | 2 +- .../gallery/pro/adapters/MediaAdapter.kt | 3 +-- .../simplemobiletools/gallery/pro/extensions/Context.kt | 9 +++++++++ .../gallery/pro/interfaces/MediumDao.kt | 3 --- 4 files changed, 11 insertions(+), 6 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 1e456721b..1befd61d9 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 @@ -864,7 +864,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val medium = getCurrentMedium() ?: return medium.isFavorite = !medium.isFavorite ensureBackgroundThread { - galleryDB.MediumDao().updateFavorite(medium.path, medium.isFavorite) + updateFavorite(medium.path, medium.isFavorite) if (medium.isFavorite) { mFavoritePaths.add(medium.path) } else { 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 298a90def..5dcf75275 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 @@ -266,10 +266,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList { fun Context.getFavoriteFromPath(path: String) = Favorite(null, path, path.getFilenameFromPath(), path.getParentPath()) +fun Context.updateFavorite(path: String, isFavorite: Boolean) { + val favoritesDAO = galleryDB.FavoritesDAO() + if (isFavorite) { + favoritesDAO.insert(getFavoriteFromPath(path)) + } else { + favoritesDAO.deleteFavoritePath(path) + } +} + // remove the "recycle_bin" from the file path prefix, replace it with real bin path /data/user... fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList { val media = try { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt index 1ce2bb641..3f89a2f5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt @@ -39,9 +39,6 @@ interface MediumDao { @Query("UPDATE OR REPLACE media SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath COLLATE NOCASE") fun updateMedium(oldPath: String, newParentPath: String, newFilename: String, newFullPath: String) - @Query("UPDATE media SET is_favorite = :isFavorite WHERE full_path = :path COLLATE NOCASE") - fun updateFavorite(path: String, isFavorite: Boolean) - @Query("UPDATE OR REPLACE media SET full_path = :newPath, deleted_ts = :deletedTS WHERE full_path = :oldPath COLLATE NOCASE") fun updateDeleted(newPath: String, deletedTS: Long, oldPath: String) From 61c4db155d74b3ec913735577d5d30cb430f1784 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 09:39:56 +0100 Subject: [PATCH 10/98] removing the favorite paths getting function from MediumDao --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- .../com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) 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 c597a6f0d..cd098f6cd 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 @@ -712,7 +712,7 @@ fun Context.getOTGFolderChildrenNames(path: String) = getOTGFolderChildren(path) fun Context.getFavoritePaths(): ArrayList { return try { - galleryDB.MediumDao().getFavoritePaths() as ArrayList + galleryDB.FavoritesDAO().getValidFavoritePaths() as ArrayList } catch (e: Exception) { ArrayList() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt index 3f89a2f5d..1bf91b543 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt @@ -15,9 +15,6 @@ interface MediumDao { @Query("SELECT filename, full_path, parent_path, last_modified, date_taken, size, type, video_duration, is_favorite, deleted_ts FROM media WHERE deleted_ts = 0 AND is_favorite = 1") fun getFavorites(): List - @Query("SELECT full_path FROM media WHERE deleted_ts = 0 AND is_favorite = 1") - fun getFavoritePaths(): List - @Query("SELECT filename, full_path, parent_path, last_modified, date_taken, size, type, video_duration, is_favorite, deleted_ts FROM media WHERE deleted_ts != 0") fun getDeletedMedia(): List From b9369139f190f15ae8121cefd32da039f11ecc16 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 09:51:28 +0100 Subject: [PATCH 11/98] renaming some DAO to Dao --- .../gallery/pro/activities/ViewPagerActivity.kt | 2 +- .../gallery/pro/adapters/DirectoryAdapter.kt | 2 +- .../gallery/pro/databases/GalleryDatabase.kt | 4 ++-- .../gallery/pro/extensions/Context.kt | 14 ++++++++------ .../{DateTakensDAO.kt => DateTakensDao.kt} | 2 +- .../{FavoritesDAO.kt => FavoritesDao.kt} | 5 ++++- .../gallery/pro/interfaces/MediumDao.kt | 3 --- 7 files changed, 17 insertions(+), 15 deletions(-) rename app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/{DateTakensDAO.kt => DateTakensDao.kt} (77%) rename app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/{FavoritesDAO.kt => FavoritesDao.kt} (91%) 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 1befd61d9..4ffb2d73d 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 @@ -375,7 +375,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View else -> TYPE_IMAGES } - val isFavorite = galleryDB.FavoritesDAO().isFavorite(mPath) + val isFavorite = favoritesDB.isFavorite(mPath) val duration = if (type == TYPE_VIDEOS) mPath.getVideoDuration() else 0 val ts = System.currentTimeMillis() val medium = Medium(null, mPath.getFilenameFromPath(), mPath, mPath.getParentPath(), ts, ts, File(mPath).length(), type, duration, isFavorite, 0) 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 abc71941e..a70362d67 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 @@ -555,7 +555,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList { return try { - galleryDB.FavoritesDAO().getValidFavoritePaths() as ArrayList + favoritesDB.getValidFavoritePaths() as ArrayList } catch (e: Exception) { ArrayList() } @@ -721,11 +724,10 @@ fun Context.getFavoritePaths(): ArrayList { fun Context.getFavoriteFromPath(path: String) = Favorite(null, path, path.getFilenameFromPath(), path.getParentPath()) fun Context.updateFavorite(path: String, isFavorite: Boolean) { - val favoritesDAO = galleryDB.FavoritesDAO() if (isFavorite) { - favoritesDAO.insert(getFavoriteFromPath(path)) + favoritesDB.insert(getFavoriteFromPath(path)) } else { - favoritesDAO.deleteFavoritePath(path) + favoritesDB.deleteFavoritePath(path) } } @@ -750,7 +752,7 @@ fun Context.deleteDBPath(mediumDao: MediumDao, path: String) { fun Context.deleteMediumWithPath(mediumDao: MediumDao, path: String) { try { mediumDao.deleteMediumPath(path) - galleryDB.FavoritesDAO().deleteFavoritePath(path) + favoritesDB.deleteFavoritePath(path) } catch (ignored: Exception) { } } @@ -840,7 +842,7 @@ fun Context.addPathToDB(path: String) { try { val mediumDao = galleryDB.MediumDao() - val isFavorite = galleryDB.FavoritesDAO().isFavorite(path) + val isFavorite = favoritesDB.isFavorite(path) val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0 val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(), File(path).length(), type, videoDuration, isFavorite, 0L) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDAO.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt similarity index 77% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDAO.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt index 107801537..0d3380408 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDAO.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt @@ -3,6 +3,6 @@ package com.simplemobiletools.gallery.pro.interfaces import androidx.room.Dao @Dao -interface DateTakensDAO { +interface DateTakensDao { } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt similarity index 91% rename from app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt index f3b97e6ad..d835d9f65 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDAO.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt @@ -7,7 +7,7 @@ import androidx.room.Query import com.simplemobiletools.gallery.pro.models.Favorite @Dao -interface FavoritesDAO { +interface FavoritesDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(favorite: Favorite) @@ -25,4 +25,7 @@ interface FavoritesDAO { @Query("DELETE FROM favorites WHERE full_path = :path COLLATE NOCASE") fun deleteFavoritePath(path: String) + + @Query("DELETE FROM favorites") + fun clearFavorites() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt index 1bf91b543..ec0a8befc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt @@ -44,7 +44,4 @@ interface MediumDao { @Query("DELETE FROM media WHERE deleted_ts != 0") fun clearRecycleBin() - - @Query("UPDATE media SET is_favorite = 0") - fun clearFavorites() } From 3ca8e685b81a21efb3f3c0d11bec1060fc1682e8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 10:56:08 +0100 Subject: [PATCH 12/98] shortening some code related to getting DAOs --- .../gallery/pro/activities/MainActivity.kt | 36 +++++-------- .../gallery/pro/activities/MediaActivity.kt | 26 ++++----- .../gallery/pro/activities/SearchActivity.kt | 4 +- .../pro/activities/SettingsActivity.kt | 7 +-- .../pro/activities/ViewPagerActivity.kt | 5 +- .../pro/activities/WidgetConfigureActivity.kt | 2 +- .../gallery/pro/adapters/DirectoryAdapter.kt | 2 +- .../gallery/pro/extensions/Activity.kt | 22 ++++---- .../gallery/pro/extensions/Context.kt | 53 +++++++++---------- .../gallery/pro/helpers/MediaFetcher.kt | 2 +- .../gallery/pro/helpers/MyWidgetProvider.kt | 4 +- 11 files changed, 69 insertions(+), 94 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 1af9c13d0..7cad1ca04 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 @@ -36,9 +36,7 @@ import com.simplemobiletools.gallery.pro.dialogs.ChangeViewTypeDialog import com.simplemobiletools.gallery.pro.dialogs.FilterMediaDialog import com.simplemobiletools.gallery.pro.extensions.* import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.DirectoryDao import com.simplemobiletools.gallery.pro.interfaces.DirectoryOperationsListener -import com.simplemobiletools.gallery.pro.interfaces.MediumDao import com.simplemobiletools.gallery.pro.jobs.NewPhotoFetcher import com.simplemobiletools.gallery.pro.models.Directory import com.simplemobiletools.gallery.pro.models.Medium @@ -85,17 +83,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private var mStoredTextColor = 0 private var mStoredPrimaryColor = 0 - private lateinit var mMediumDao: MediumDao - private lateinit var mDirectoryDao: DirectoryDao - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) appLaunched(BuildConfig.APPLICATION_ID) - mMediumDao = galleryDB.MediumDao() - mDirectoryDao = galleryDB.DirectoryDao() - if (savedInstanceState == null) { config.temporarilyShowHidden = false config.tempSkipDeleteConfirmation = false @@ -464,7 +456,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val getImagesOnly = mIsPickImageIntent || mIsGetImageContentIntent val getVideosOnly = mIsPickVideoIntent || mIsGetVideoContentIntent - getCachedDirectories(getVideosOnly, getImagesOnly, mDirectoryDao) { + getCachedDirectories(getVideosOnly, getImagesOnly) { gotDirectories(addTempFolderIfNeeded(it)) } } @@ -569,7 +561,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val pathsToDelete = ArrayList() itemsToDelete.mapTo(pathsToDelete) { it.path } - movePathsInRecycleBin(pathsToDelete, mMediumDao) { + movePathsInRecycleBin(pathsToDelete) { if (it) { deleteFilteredFileDirItems(itemsToDelete, folders) } else { @@ -590,7 +582,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { ensureBackgroundThread { folders.filter { !getDoesFilePathExist(it.absolutePath, OTGPath) }.forEach { - mDirectoryDao.deleteDirPath(it.absolutePath) + directoryDao.deleteDirPath(it.absolutePath) } if (config.deleteEmptyFolders) { @@ -936,16 +928,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { setupAdapter(dirs) // update directories and media files in the local db, delete invalid items - updateDBDirectory(directory, mDirectoryDao) + updateDBDirectory(directory) if (!directory.isRecycleBin()) { - mMediumDao.insertAll(curMedia) + mediaDB.insertAll(curMedia) } - getCachedMedia(directory.path, getVideosOnly, getImagesOnly, mMediumDao) { + getCachedMedia(directory.path, getVideosOnly, getImagesOnly) { it.forEach { if (!curMedia.contains(it)) { val path = (it as? Medium)?.path if (path != null) { - deleteDBPath(mMediumDao, path) + deleteDBPath(path) } } } @@ -955,7 +947,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (dirPathsToRemove.isNotEmpty()) { val dirsToRemove = dirs.filter { dirPathsToRemove.contains(it.path) } dirsToRemove.forEach { - mDirectoryDao.deleteDirPath(it.path) + directoryDao.deleteDirPath(it.path) } dirs.removeAll(dirsToRemove) setupAdapter(dirs) @@ -999,9 +991,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { dirs.add(newDir) setupAdapter(dirs) try { - mDirectoryDao.insert(newDir) + directoryDao.insert(newDir) if (folder != RECYCLE_BIN) { - mMediumDao.insertAll(newMedia) + mediaDB.insertAll(newMedia) } } catch (ignored: Exception) { } @@ -1156,7 +1148,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (config.useRecycleBin) { try { val binFolder = dirs.firstOrNull { it.path == RECYCLE_BIN } - if (binFolder != null && mMediumDao.getDeletedMedia().isEmpty()) { + if (binFolder != null && mediaDB.getDeletedMedia().isEmpty()) { invalidDirs.add(binFolder) } } catch (ignored: Exception) { @@ -1168,7 +1160,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { setupAdapter(dirs) invalidDirs.forEach { try { - mDirectoryDao.deleteDirPath(it.path) + directoryDao.deleteDirPath(it.path) } catch (ignored: Exception) { } } @@ -1218,7 +1210,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { Handler().postDelayed({ ensureBackgroundThread { try { - mMediumDao.deleteOldRecycleBinItems(System.currentTimeMillis() - MONTH_MILLISECONDS) + mediaDB.deleteOldRecycleBinItems(System.currentTimeMillis() - MONTH_MILLISECONDS) } catch (e: Exception) { } } @@ -1283,7 +1275,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { override fun updateDirectories(directories: ArrayList) { ensureBackgroundThread { - storeDirectoryItems(directories, mDirectoryDao) + storeDirectoryItems(directories) removeInvalidDBDirectories() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 6aa7d5fcd..7f05afad3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -39,9 +39,7 @@ import com.simplemobiletools.gallery.pro.databases.GalleryDatabase import com.simplemobiletools.gallery.pro.dialogs.* import com.simplemobiletools.gallery.pro.extensions.* import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.DirectoryDao import com.simplemobiletools.gallery.pro.interfaces.MediaOperationsListener -import com.simplemobiletools.gallery.pro.interfaces.MediumDao import com.simplemobiletools.gallery.pro.models.Medium import com.simplemobiletools.gallery.pro.models.ThumbnailItem import com.simplemobiletools.gallery.pro.models.ThumbnailSection @@ -78,9 +76,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private var mStoredTextColor = 0 private var mStoredPrimaryColor = 0 - private lateinit var mMediumDao: MediumDao - private lateinit var mDirectoryDao: DirectoryDao - companion object { var mMedia = ArrayList() } @@ -89,9 +84,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { super.onCreate(savedInstanceState) setContentView(R.layout.activity_media) - mMediumDao = galleryDB.MediumDao() - mDirectoryDao = galleryDB.DirectoryDao() - intent.apply { mIsGetImageIntent = getBooleanExtra(GET_IMAGE_INTENT, false) mIsGetVideoIntent = getBooleanExtra(GET_VIDEO_INTENT, false) @@ -495,9 +487,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun restoreAllFiles() { val paths = mMedia.filter { it is Medium }.map { (it as Medium).path } as ArrayList - restoreRecycleBinPaths(paths, mMediumDao) { + restoreRecycleBinPaths(paths) { ensureBackgroundThread { - mDirectoryDao.deleteDirPath(RECYCLE_BIN) + directoryDao.deleteDirPath(RECYCLE_BIN) } finish() } @@ -584,7 +576,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (mLoadedInitialPhotos) { startAsyncTask() } else { - getCachedMedia(mPath, mIsGetVideoIntent, mIsGetImageIntent, mMediumDao) { + getCachedMedia(mPath, mIsGetVideoIntent, mIsGetImageIntent) { if (it.isEmpty()) { runOnUiThread { media_refresh_layout.isRefreshing = true @@ -608,7 +600,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { try { gotMedia(newMedia, false) oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.filter { !getDoesFilePathExist(it.path) }.forEach { - mMediumDao.deleteMediumPath(it.path) + mediaDB.deleteMediumPath(it.path) } } catch (e: Exception) { } @@ -627,7 +619,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (mPath == FAVORITES) { ensureBackgroundThread { - mDirectoryDao.deleteDirPath(FAVORITES) + directoryDao.deleteDirPath(FAVORITES) } } @@ -641,7 +633,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun deleteDBDirectory() { ensureBackgroundThread { try { - mDirectoryDao.deleteDirPath(mPath) + directoryDao.deleteDirPath(mPath) } catch (ignored: Exception) { } } @@ -897,7 +889,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (!isFromCache) { val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium } try { - mMediumDao.insertAll(mediaToInsert) + mediaDB.insertAll(mediaToInsert) } catch (e: Exception) { } } @@ -913,7 +905,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val movingItems = resources.getQuantityString(R.plurals.moving_items_into_bin, filtered.size, filtered.size) toast(movingItems) - movePathsInRecycleBin(filtered.map { it.path } as ArrayList, mMediumDao) { + movePathsInRecycleBin(filtered.map { it.path } as ArrayList) { if (it) { deleteFilteredFiles(filtered) } else { @@ -940,7 +932,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val useRecycleBin = config.useRecycleBin filtered.forEach { if (it.path.startsWith(recycleBinPath) || !useRecycleBin) { - deleteDBPath(mMediumDao, it.path) + deleteDBPath(it.path) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt index 0febbfd0b..2ef59a3bc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt @@ -315,7 +315,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { val movingItems = resources.getQuantityString(R.plurals.moving_items_into_bin, filtered.size, filtered.size) toast(movingItems) - movePathsInRecycleBin(filtered.map { it.path } as ArrayList, galleryDB.MediumDao()) { + movePathsInRecycleBin(filtered.map { it.path } as ArrayList) { if (it) { deleteFilteredFiles(filtered) } else { @@ -342,7 +342,7 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { val useRecycleBin = config.useRecycleBin filtered.forEach { if (it.path.startsWith(recycleBinPath) || !useRecycleBin) { - deleteDBPath(galleryDB.MediumDao(), it.path) + deleteDBPath(it.path) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index 0be79e7fe..50133ccf5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -13,10 +13,7 @@ import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.dialogs.ManageBottomActionsDialog import com.simplemobiletools.gallery.pro.dialogs.ManageExtendedDetailsDialog -import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.emptyTheRecycleBin -import com.simplemobiletools.gallery.pro.extensions.galleryDB -import com.simplemobiletools.gallery.pro.extensions.showRecycleBinEmptyingDialog +import com.simplemobiletools.gallery.pro.extensions.* import com.simplemobiletools.gallery.pro.helpers.* import com.simplemobiletools.gallery.pro.models.AlbumCover import kotlinx.android.synthetic.main.activity_settings.* @@ -593,7 +590,7 @@ class SettingsActivity : SimpleActivity() { private fun setupEmptyRecycleBin() { ensureBackgroundThread { try { - mRecycleBinContentSize = galleryDB.MediumDao().getDeletedMedia().sumByLong { it.size } + mRecycleBinContentSize = mediaDB.getDeletedMedia().sumByLong { it.size } } catch (ignored: Exception) { } runOnUiThread { 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 4ffb2d73d..089d3da5d 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 @@ -364,8 +364,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (intent.action == "com.android.camera.action.REVIEW") { ensureBackgroundThread { - val mediumDao = galleryDB.MediumDao() - if (mediumDao.getMediaFromPath(mPath).isEmpty()) { + if (mediaDB.getMediaFromPath(mPath).isEmpty()) { val type = when { mPath.isVideoFast() -> TYPE_VIDEOS mPath.isGif() -> TYPE_GIFS @@ -379,7 +378,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val duration = if (type == TYPE_VIDEOS) mPath.getVideoDuration() else 0 val ts = System.currentTimeMillis() val medium = Medium(null, mPath.getFilenameFromPath(), mPath, mPath.getParentPath(), ts, ts, File(mPath).length(), type, duration, isFavorite, 0) - mediumDao.insert(medium) + mediaDB.insert(medium) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt index d2e1696bb..3f0c66912 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt @@ -163,7 +163,7 @@ class WidgetConfigureActivity : SimpleActivity() { } ensureBackgroundThread { - val path = directoryDB.getDirectoryThumbnail(folderPath) + val path = directoryDao.getDirectoryThumbnail(folderPath) if (path != null) { runOnUiThread { loadJpg(path, config_image, config.cropThumbnails) 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 a70362d67..84113cfa9 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 @@ -198,7 +198,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList, mediumDao: MediumDao = galleryDB.MediumDao(), callback: ((wasSuccess: Boolean) -> Unit)?) { +fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, callback: ((wasSuccess: Boolean) -> Unit)?) { ensureBackgroundThread { var pathsCnt = paths.size val OTGPath = config.OTGPath @@ -261,7 +260,7 @@ fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, mediumDao out?.flush() if (fileDocument?.getItemSize(true) == copiedSize && getDoesFilePathExist(destination)) { - mediumDao.updateDeleted("$RECYCLE_BIN$source", System.currentTimeMillis(), source) + mediaDB.updateDeleted("$RECYCLE_BIN$source", System.currentTimeMillis(), source) pathsCnt-- } } catch (e: Exception) { @@ -277,7 +276,7 @@ fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, mediumDao val lastModified = file.lastModified() try { if (file.copyRecursively(internalFile, true)) { - mediumDao.updateDeleted("$RECYCLE_BIN$source", System.currentTimeMillis(), source) + mediaDB.updateDeleted("$RECYCLE_BIN$source", System.currentTimeMillis(), source) pathsCnt-- if (config.keepLastModified) { @@ -295,10 +294,10 @@ fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, mediumDao } fun BaseSimpleActivity.restoreRecycleBinPath(path: String, callback: () -> Unit) { - restoreRecycleBinPaths(arrayListOf(path), galleryDB.MediumDao(), callback) + restoreRecycleBinPaths(arrayListOf(path), callback) } -fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, mediumDao: MediumDao = galleryDB.MediumDao(), callback: () -> Unit) { +fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, callback: () -> Unit) { ensureBackgroundThread { val newPaths = ArrayList() for (source in paths) { @@ -328,7 +327,7 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, mediumDa out?.flush() if (File(source).length() == copiedSize) { - mediumDao.updateDeleted(destination.removePrefix(recycleBinPath), 0, "$RECYCLE_BIN$destination") + mediaDB.updateDeleted(destination.removePrefix(recycleBinPath), 0, "$RECYCLE_BIN$destination") } newPaths.add(destination) @@ -357,8 +356,8 @@ fun BaseSimpleActivity.emptyTheRecycleBin(callback: (() -> Unit)? = null) { ensureBackgroundThread { try { recycleBin.deleteRecursively() - galleryDB.MediumDao().clearRecycleBin() - galleryDB.DirectoryDao().deleteRecycleBin() + mediaDB.clearRecycleBin() + directoryDao.deleteRecycleBin() toast(R.string.recycle_bin_emptied) callback?.invoke() } catch (e: Exception) { @@ -413,7 +412,6 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc try { var didUpdateFile = false val operations = ArrayList() - val mediumDao = galleryDB.MediumDao() ensureBackgroundThread { for (path in paths) { @@ -442,7 +440,7 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc operations.clear() } - mediumDao.updateFavoriteDateTaken(path, timestamp) + mediaDB.updateFavoriteDateTaken(path, timestamp) didUpdateFile = true if (!hasRescanned && getFileDateTaken(path) == 0L) { 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 8b3574847..31c37b75a 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 @@ -111,11 +111,11 @@ fun Context.launchSettings() { val Context.config: Config get() = Config.newInstance(applicationContext) -val Context.galleryDB: GalleryDatabase get() = GalleryDatabase.getInstance(applicationContext) - val Context.widgetsDB: WidgetsDao get() = GalleryDatabase.getInstance(applicationContext).WidgetsDao() -val Context.directoryDB: DirectoryDao get() = GalleryDatabase.getInstance(applicationContext).DirectoryDao() +val Context.mediaDB: MediumDao get() = GalleryDatabase.getInstance(applicationContext).MediumDao() + +val Context.directoryDao: DirectoryDao get() = GalleryDatabase.getInstance(applicationContext).DirectoryDao() val Context.favoritesDB: FavoritesDao get() = GalleryDatabase.getInstance(applicationContext).FavoritesDao() @@ -400,16 +400,15 @@ fun Context.rescanFolderMediaSync(path: String) { GetMediaAsynctask(applicationContext, path, false, false, false) { ensureBackgroundThread { val newMedia = it - val mediumDao = galleryDB.MediumDao() val media = newMedia.filter { it is Medium } as ArrayList try { - mediumDao.insertAll(media) + mediaDB.insertAll(media) cached.forEach { if (!newMedia.contains(it)) { val mediumPath = (it as? Medium)?.path if (mediumPath != null) { - deleteDBPath(mediumDao, mediumPath) + deleteDBPath(mediumPath) } } } @@ -420,7 +419,7 @@ fun Context.rescanFolderMediaSync(path: String) { } } -fun Context.storeDirectoryItems(items: ArrayList, directoryDao: DirectoryDao) { +fun Context.storeDirectoryItems(items: ArrayList) { ensureBackgroundThread { directoryDao.insertAll(items) } @@ -559,7 +558,7 @@ fun Context.loadSVG(path: String, target: MySquareImageView, cropThumbnails: Boo .into(target) } -fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, directoryDao: DirectoryDao = galleryDB.DirectoryDao(), forceShowHidden: Boolean = false, callback: (ArrayList) -> Unit) { +fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, forceShowHidden: Boolean = false, callback: (ArrayList) -> Unit) { ensureBackgroundThread { val directories = try { directoryDao.getAll() as ArrayList @@ -602,22 +601,21 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: val clone = filteredDirectories.clone() as ArrayList callback(clone.distinctBy { it.path.getDistinctPath() } as ArrayList) - removeInvalidDBDirectories(filteredDirectories, directoryDao) + removeInvalidDBDirectories(filteredDirectories) } } -fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, mediumDao: MediumDao = galleryDB.MediumDao(), - callback: (ArrayList) -> Unit) { +fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList) -> Unit) { ensureBackgroundThread { val mediaFetcher = MediaFetcher(this) val foldersToScan = if (path.isEmpty()) mediaFetcher.getFoldersToScan() else arrayListOf(path) var media = ArrayList() if (path == FAVORITES) { - media.addAll(mediumDao.getFavorites()) + media.addAll(mediaDB.getFavorites()) } if (path == RECYCLE_BIN) { - media.addAll(getUpdatedDeletedMedia(mediumDao)) + media.addAll(getUpdatedDeletedMedia()) } if (config.filterMedia and TYPE_PORTRAITS != 0) { @@ -634,7 +632,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag val shouldShowHidden = config.shouldShowHidden foldersToScan.filter { path.isNotEmpty() || !config.isFolderProtected(it) }.forEach { try { - val currMedia = mediumDao.getMediaFromPath(it) + val currMedia = mediaDB.getMediaFromPath(it) media.addAll(currMedia) } catch (ignored: Exception) { } @@ -667,7 +665,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag val mediaToDelete = ArrayList() media.filter { !getDoesFilePathExist(it.path, OTGPath) }.forEach { if (it.path.startsWith(recycleBinPath)) { - deleteDBPath(mediumDao, it.path) + deleteDBPath(it.path) } else { mediaToDelete.add(it) } @@ -675,14 +673,14 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag try { if (mediaToDelete.isNotEmpty()) { - mediumDao.deleteMedia(*mediaToDelete.toTypedArray()) + mediaDB.deleteMedia(*mediaToDelete.toTypedArray()) } } catch (ignored: Exception) { } } } -fun Context.removeInvalidDBDirectories(dirs: ArrayList? = null, directoryDao: DirectoryDao = galleryDB.DirectoryDao()) { +fun Context.removeInvalidDBDirectories(dirs: ArrayList? = null) { val dirsToCheck = dirs ?: directoryDao.getAll() val OTGPath = config.OTGPath dirsToCheck.filter { !it.areFavorites() && !it.isRecycleBin() && !getDoesFilePathExist(it.path, OTGPath) && it.path != config.tempFolderPath }.forEach { @@ -697,12 +695,12 @@ fun Context.updateDBMediaPath(oldPath: String, newPath: String) { val newFilename = newPath.getFilenameFromPath() val newParentPath = newPath.getParentPath() try { - galleryDB.MediumDao().updateMedium(oldPath, newParentPath, newFilename, newPath) + mediaDB.updateMedium(oldPath, newParentPath, newFilename, newPath) } catch (ignored: Exception) { } } -fun Context.updateDBDirectory(directory: Directory, directoryDao: DirectoryDao) { +fun Context.updateDBDirectory(directory: Directory) { try { directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) } catch (ignored: Exception) { @@ -732,9 +730,9 @@ fun Context.updateFavorite(path: String, isFavorite: Boolean) { } // remove the "recycle_bin" from the file path prefix, replace it with real bin path /data/user... -fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList { +fun Context.getUpdatedDeletedMedia(): ArrayList { val media = try { - mediumDao.getDeletedMedia() as ArrayList + mediaDB.getDeletedMedia() as ArrayList } catch (ignored: Exception) { ArrayList() } @@ -745,13 +743,13 @@ fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList { return media } -fun Context.deleteDBPath(mediumDao: MediumDao, path: String) { - deleteMediumWithPath(mediumDao, path.replaceFirst(recycleBinPath, RECYCLE_BIN)) +fun Context.deleteDBPath(path: String) { + deleteMediumWithPath(path.replaceFirst(recycleBinPath, RECYCLE_BIN)) } -fun Context.deleteMediumWithPath(mediumDao: MediumDao, path: String) { +fun Context.deleteMediumWithPath(path: String) { try { - mediumDao.deleteMediumPath(path) + mediaDB.deleteMediumPath(path) favoritesDB.deleteFavoritePath(path) } catch (ignored: Exception) { } @@ -841,13 +839,12 @@ fun Context.addPathToDB(path: String) { } try { - val mediumDao = galleryDB.MediumDao() val isFavorite = favoritesDB.isFavorite(path) val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0 val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(), File(path).length(), type, videoDuration, isFavorite, 0L) - mediumDao.insert(medium) + mediaDB.insert(medium) } catch (ignored: Exception) { } } @@ -891,7 +888,7 @@ fun Context.updateDirectoryPath(path: String) { val favoritePaths = getFavoritePaths() val curMedia = mediaFetcher.getFilesFrom(path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) val directory = createDirectoryFromMedia(path, curMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) - updateDBDirectory(directory, galleryDB.DirectoryDao()) + updateDBDirectory(directory) } fun Context.getFileDateTaken(path: String): Long { 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 8b625e5e5..6a4db386a 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 @@ -216,7 +216,7 @@ class MediaFetcher(val context: Context) { val media = ArrayList() val isRecycleBin = folder == RECYCLE_BIN val deletedMedia = if (isRecycleBin) { - context.getUpdatedDeletedMedia(context.galleryDB.MediumDao()) + context.getUpdatedDeletedMedia() } else { ArrayList() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt index 199d90952..f2e1b3d02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MyWidgetProvider.kt @@ -18,7 +18,7 @@ import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.activities.MediaActivity import com.simplemobiletools.gallery.pro.extensions.config -import com.simplemobiletools.gallery.pro.extensions.directoryDB +import com.simplemobiletools.gallery.pro.extensions.directoryDao import com.simplemobiletools.gallery.pro.extensions.getFolderNameFromPath import com.simplemobiletools.gallery.pro.extensions.widgetsDB import com.simplemobiletools.gallery.pro.models.Widget @@ -45,7 +45,7 @@ class MyWidgetProvider : AppWidgetProvider() { setText(R.id.widget_folder_name, context.getFolderNameFromPath(it.folderPath)) } - val path = context.directoryDB.getDirectoryThumbnail(it.folderPath) ?: return@forEach + val path = context.directoryDao.getDirectoryThumbnail(it.folderPath) ?: return@forEach val options = RequestOptions() .signature(path.getFileSignature()) .diskCacheStrategy(DiskCacheStrategy.RESOURCE) From e578036a227b22000d58814f32816cf852eed59e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 11:11:23 +0100 Subject: [PATCH 13/98] delete favorites at deleting media --- .../simplemobiletools/gallery/pro/extensions/Context.kt | 2 ++ .../gallery/pro/interfaces/FavoritesDao.kt | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) 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 31c37b75a..be0f31756 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 @@ -674,6 +674,8 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag try { if (mediaToDelete.isNotEmpty()) { mediaDB.deleteMedia(*mediaToDelete.toTypedArray()) + val favorites = mediaToDelete.map { getFavoriteFromPath(it.path) } + favoritesDB.deleteFavorites(*favorites.toTypedArray()) } } catch (ignored: Exception) { } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt index d835d9f65..8a890e20a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt @@ -1,9 +1,6 @@ package com.simplemobiletools.gallery.pro.interfaces -import androidx.room.Dao -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.Query +import androidx.room.* import com.simplemobiletools.gallery.pro.models.Favorite @Dao @@ -23,6 +20,9 @@ interface FavoritesDao { @Query("SELECT id FROM favorites WHERE full_path = :path COLLATE NOCASE") fun isFavorite(path: String): Boolean + @Delete + fun deleteFavorites(vararg favorite: Favorite) + @Query("DELETE FROM favorites WHERE full_path = :path COLLATE NOCASE") fun deleteFavoritePath(path: String) From 29a521d107859e7c66f21043d5abe0b2f57bf334 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 25 Jan 2020 11:50:09 +0100 Subject: [PATCH 14/98] update Favorite too at updating a medium --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 3 ++- .../simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt | 3 +++ .../com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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 be0f31756..7e69583e8 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 @@ -697,7 +697,8 @@ fun Context.updateDBMediaPath(oldPath: String, newPath: String) { val newFilename = newPath.getFilenameFromPath() val newParentPath = newPath.getParentPath() try { - mediaDB.updateMedium(oldPath, newParentPath, newFilename, newPath) + mediaDB.updateMedium(newFilename, newPath, newParentPath, oldPath) + favoritesDB.updateFavorite(newFilename, newPath, newParentPath, oldPath) } catch (ignored: Exception) { } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt index 8a890e20a..52056cb7e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt @@ -20,6 +20,9 @@ interface FavoritesDao { @Query("SELECT id FROM favorites WHERE full_path = :path COLLATE NOCASE") fun isFavorite(path: String): Boolean + @Query("UPDATE OR REPLACE favorites SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath COLLATE NOCASE") + fun updateFavorite(newFilename: String, newFullPath: String, newParentPath: String, oldPath: String) + @Delete fun deleteFavorites(vararg favorite: Favorite) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt index ec0a8befc..8552256de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt @@ -34,7 +34,7 @@ interface MediumDao { fun deleteOldRecycleBinItems(timestmap: Long) @Query("UPDATE OR REPLACE media SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath COLLATE NOCASE") - fun updateMedium(oldPath: String, newParentPath: String, newFilename: String, newFullPath: String) + fun updateMedium(newFilename: String, newFullPath: String, newParentPath: String, oldPath: String) @Query("UPDATE OR REPLACE media SET full_path = :newPath, deleted_ts = :deletedTS WHERE full_path = :oldPath COLLATE NOCASE") fun updateDeleted(newPath: String, deletedTS: Long, oldPath: String) From 9607348b5029241bde31ba8a8c2d7ace49076f19 Mon Sep 17 00:00:00 2001 From: herkul-s <58790982+herkul-s@users.noreply.github.com> Date: Sat, 25 Jan 2020 18:43:41 +0100 Subject: [PATCH 15/98] updating czech strings --- app/src/main/res/values-cs/strings.xml | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 2e17b6791..100e451e2 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -32,7 +32,7 @@ Opravuji… Datumy byly úspěšně opraveny Sdílet verzi se změněnou velikostí - Zdravím,\n\nzdá se, že jse přešli ze staré bezplatné aplikace. Starou aplikaci, která má nahoře v nastavení tlačítko \'Stáhnout Pro verzi\', můžete již odinstalovat.\n\nZtratíte tím pouze soubory v odpadkovém koši, označení oblíbených souborů a také budete muset znovu nastavit položky v nastavení aplikace.\n\nDěkuji! + Zdravím,\n\nzdá se, že jste přešli ze staré bezplatné aplikace. Starou aplikaci, která má nahoře v nastavení tlačítko \'Stáhnout Pro verzi\', můžete již odinstalovat.\n\nZtratíte tím pouze soubory v odpadkovém koši, označení oblíbených souborů a také budete muset znovu nastavit položky v nastavení aplikace.\n\nDěkuji! Přepnout na vyhledávání souborů ve všech viditelných složkách @@ -43,7 +43,7 @@ RAW obrázky SVGčka Portréty - Se zvolenými filtry nebyly nalezeny žádné médiální soubory. + Se zvolenými filtry nebyly nalezeny žádné mediální soubory. Změnit filtry @@ -53,7 +53,7 @@ Spravovat vyloučené složky Tato funkce vyloučí výběr včetně podsložek jen z Jednoduché galerie. V nastavení můžete spravovat vyloučené složky. Chcete vyloučit nadřazenou složku? - Vyloučené složky budou spolu s podsložkami vyloučeny jen z Jednoduché Galerie, ostatní aplikace je nadále uvidí.\n\nPokud je chcete skrýt i před ostatními aplikacemi, použijte funkci Skrýt. + Vyloučené složky budou spolu s podsložkami vyloučeny jen z Jednoduché galerie, ostatní aplikace je nadále uvidí.\n\nPokud je chcete skrýt i před ostatními aplikacemi, použijte funkci Skrýt. Odstranit všechny Odstranit všechny složky ze seznamu vyloučených? Tato operace neodstraní obsah složek. Skryté složky @@ -111,7 +111,7 @@ Prezentace - Interval (vteřin): + Interval (sekund): Zahrnout fotografie Zahrnout videa Zahrnout GIFy @@ -169,10 +169,10 @@ Povolit ovládání jasu vertikálními tahy Povolit ovládání hlasitosti a jasu videí vertikálními tahy Zobrazit počet médií ve složce na hlavní obrazovce - Zobrazit rozšířené vlastnosti přes celoobrazovkové média + Zobrazit rozšířené vlastnosti přes celoobrazovková média Spravovat rozšířené vlastnosti Povolit přibližování jedním prstem v celoobrazovkovém režimu - Povolit okamžité přepínání médií ťuknutím na okraj obrazovky + Povolit okamžité přepínání médií klepnutím na okraj obrazovky Povolit hluboké přibližování obrázků Skrýt rozšířené vlastnosti pokud je skrytá stavová lišta Zobrazit některá akční tlačítka ve spodní části obrazovky @@ -198,7 +198,7 @@ Spodní akční tlačítka - Upravit viditelné spodní akční tlačítka + Upravit viditelná spodní akční tlačítka Přepnutí oblíbenosti Přepnutí viditelnosti souboru @@ -284,17 +284,17 @@ Pipetovatelná barva - Jak nastavím Jednoduchou Galerii jako výchozí galerii? + Jak nastavím Jednoduchou galerii jako výchozí galerii? Nejdříve musíte najít v nastavení zařízení, v sekci Aplikace, současnou výchozí galerii, zvolit tlačítko s textem ve smyslu \"Nastavení výchozího otevírání\" a následně \"Vymazat výchozí nastavení\". - Pokud poté zkusíte otevřít obrázek nebo video, zobrazí se seznam aplikací, kde můžete zvolit Jednoduchou Galerii a nastavit ji jako výchozí. + Pokud poté zkusíte otevřít obrázek nebo video, zobrazí se seznam aplikací, kde můžete zvolit Jednoduchou galerii a nastavit ji jako výchozí. Uzamknul jsem aplikaci heslem, ale zapomněl jsem ho. Co můžu udělat? - Můžete to vyriešǐť 2 způsoby. Můžete aplikaci buď přeinstalovat nebo ji najít v nastavení zařízení a zvolit \"Vymazat data\". Vymažou se pouze nastavení aplikace, nikoliv soubory. + Můžete to vyriešit 2 způsoby. Můžete aplikaci buď přeinstalovat nebo ji najít v nastavení zařízení a zvolit \"Vymazat data\". Vymažou se pouze nastavení aplikace, nikoliv soubory. Jak mohu dosáhnout, aby bylo dané album stále zobrazeno jako první? - Můžete označit danou složku dlouhým podržením a zvolit tlačítko s obrázkem připínáčku, to ji připne na vrch. Můžete připnout i více složek, budou seřazeny podle zvoleného řazení. + Můžete označit danou složku dlouhým podržením a zvolit tlačítko s obrázkem připínáčku, to ji připne nahoru. Můžete připnout i více složek, budou seřazeny podle zvoleného řazení. Jak mohu video posunout vpřed? - Můžete toho dosáhnout buď tažením prstu vodorovně přes okno přehrávače nebo ťuknutím na text aktuální či celkové délky videa, které najdete po bocích indikátoru aktuální pozice. To posune video buď zpět nebo vpřed. + Můžete toho dosáhnout buď tažením prstu vodorovně přes okno přehrávače nebo klepnutím na text aktuální či celkové délky videa, který najdete po bocích indikátoru aktuální pozice. To posune video buď zpět nebo vpřed. Jaký je rozdíl mezi Skrytím a Vyloučením složky? - Zatímco vyloučení zamezí zobrazení složky pouze vrámci Jednoduché Galerie, skrytí ji ukryje vrámci celého systému, tedy to ovlivní i ostatní galerie. Skrytí funguje pomocí vytvoření prázdného souboru \".nomedia\" v daném adresáři, který můžete vymazat i libovolným správcem souborů. + Zatímco vyloučení zamezí zobrazení složky pouze vrámci Jednoduché galerie, skrytí ji ukryje v celém systému, tedy to ovlivní i ostatní galerie. Skrytí funguje pomocí vytvoření prázdného souboru \".nomedia\" v daném adresáři, který můžete vymazat i libovolným správcem souborů. Proč se mi zobrazují složky s obaly hudebních alb, nebo nálepkami? Může se stát, že se vám zobrazí také neobvyklé složky. Můžete je ale jednoduše skrýt jejich vybráním pomocí dlouhého podržení a zvolením Vyloučit. Pokud na následujícím dialogu zvolíte vyloučení nadřazené složky, pravděpodobně budou vyloučeny i ostatní podobné složky. Složka s fotografiemi se mi nezobrazuje nebo ve složce nevidím všechny soubory. Co s tím? @@ -317,13 +317,13 @@ - Jednoduchá Galerie Pro - Organizér a editor fotografií + Jednoduchá galerie Pro - Organizér a editor fotografií - Browse your memories without any interruptions with this photo and video gallery + Prohlížejte svoje vzpomínky bez prerušení s touto foto a video galerií. - Jednoduchá Galerie Pro je vysoce přizpůsobitelná offline galerie. Organizujte a upravujte své fotografie, obnovujte smazané fotografie s funkcí odpadkového koše, chraňte je a skrývejte. Prohlížejte množství různých foto a video formátů včetně RAW, SVG a mnoho dalších. + Jednoduchá galerie Pro je vysoce přizpůsobitelná offline galerie. Organizujte a upravujte své fotografie, obnovujte smazané fotografie s funkcí odpadkového koše, chraňte je a skrývejte. Prohlížejte množství různých foto a video formátů včetně RAW, SVG a mnoho dalších. - Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že ani nevyžaduje připojení k internetu je vaše soukromí maximálně chráněno. + Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že ani nevyžaduje připojení k internetu, je vaše soukromí maximálně chráněno. ------------------------------------------------- JEDNODUCHÁ GALERIE PRO – FUNKCE @@ -337,7 +337,7 @@ • Otevírejte mnoho rozličných formátů fotografií a videí (RAW, SVG, GIF, panorama, atd) • Množství intuitivních gest pro jednoduchou úpravu a organizaci souborů • Mnoho různých způsobů filtrování, seskupování a řazení souborů - • Změňte si vzhled Jednoduché galerie pro + • Změňte si vzhled Jednoduché galerie Pro • Dostupná ve 32 jazycích • Označte si oblíbené soubory pro rychlý přístup • Chraňte své fotografie a videa pomocí pinu, vzoru nebo otiskem prstu @@ -350,16 +350,16 @@ … a mnoho dalších! EDITOR OBRÁZKŮ - Jednoduchá Galerie Pro umožňuje snadnou úpravu obrázků. Ořezávejte, překlápějte, otáčejte či měňte jejich velikost. Pokud se cítíte kreativně, můžete také aplikovat filtry nebo do obrázku kreslit! + Jednoduchá galerie Pro umožňuje snadnou úpravu obrázků. Ořezávejte, překlápějte, otáčejte či měňte jejich velikost. Pokud se cítíte kreativně, můžete také aplikovat filtry nebo do obrázku kreslit! PODPORA MNOHA TYPŮ SOUBORŮ - Na rozdíl od některých galerií podporuje Jednoduchá Galerie Pro velké množství různých druhů souborů včetně JPEG, PNG, MP4, MKV, RAW, SVG, panoramatických fotografií a videí. + Na rozdíl od některých galerií podporuje Jednoduchá galerie Pro velké množství různých druhů souborů včetně JPEG, PNG, MP4, MKV, RAW, SVG, panoramatických fotografií a videí. Vysoce upravitelný správce galerie - Od vzhledu až po funkční tlačítka na spodní liště, Jednoduchá Galerie Pro je plně nastavitelná a bude fungovat přesně jak si budete přát. Žádná jiná galerie nenabízí takovou flexibilitu! A díky otevřenému kódu je naše aplikace dostupná ve 32 jazycích! + Od vzhledu až po funkční tlačítka na spodní liště, Jednoduchá galerie Pro je plně nastavitelná a bude fungovat přesně jak si budete přát. Žádná jiná galerie nenabízí takovou flexibilitu! A díky otevřenému kódu je naše aplikace dostupná ve 32 jazycích! OBNOVTE SMAZANÉ FOTOGRAFIE A VIDEA - Smazali jste nechtěně důležitou fotografii nebo video? Žádný strach! Jednoduchá Galerie Pro pro podobné případy nabízí funkci odpadkového koše, odkud smazané fotografie a videa snadno obnovíte. + Smazali jste nechtěně důležitou fotografii nebo video? Žádný strach! Jednoduchá galerie Pro pro podobné případy nabízí funkci odpadkového koše, odkud smazané fotografie a videa snadno obnovíte. CHRAŇTE A SKRÝVEJTE SVÉ FOTOGRAFIE A VIDEA Použitím pinu, vzoru nebo otisku prstu snadno své fotografie, videa či celá alba ochráníte nebo skryjete. Můžete ochránit i spuštění samotné aplikace, nebo některé její funkce. Například můžete zabránit náhodnému smazání souboru bez potvrzení otiskem prstu. From ea187e117ee7dbee659cdbbdff82b2ffde976078 Mon Sep 17 00:00:00 2001 From: AioiLight Date: Sun, 26 Jan 2020 17:22:52 +0900 Subject: [PATCH 16/98] updating the app description from original language --- app/src/main/res/values-ja/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 7b34fa90f..8aa0d66da 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -366,6 +366,9 @@ Check out the full suite of Simple Tools here: https://www.simplemobiletools.com + + Standalone website of Simple Gallery Pro: + https://www.simplemobiletools.com/gallery Facebook: https://www.facebook.com/simplemobiletools From fef507e16d83600331f1be570b777da84370407d Mon Sep 17 00:00:00 2001 From: AioiLight Date: Sun, 26 Jan 2020 17:56:16 +0900 Subject: [PATCH 17/98] updating Japanese translation(New editor strings) --- app/src/main/res/values-ja/strings.xml | 126 ++++++++++++------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 8aa0d66da..203820656 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -203,69 +203,69 @@ 表示/非表示の切替 - Custom - Reset - Square - Transform - Filter - None - Adjust - Shadows - Exposure - Highlights - Brightness - Contrast - Saturation - Clarity - Gamma - Blacks - Whites - Temperature - Sharpness - Reset - Focus - None - Radial - Linear - Mirrored - Gaussian - Text - Text Options - Text Color - Font - Add - Edit - Straighten - Font - Color - BG Color - Alignment - To Front - Delete - Your text - Brush - Color - Size - Hardness - To Front - Delete - Brush Color - Editor - Close Editor? - Do you really want to discard the image? - Yes - No - Cancel - Accept - Save - Exporting image… - Exporting image %s. - Flip H - Flip V - Undo - Redo - Color Picker - Transparent + カスタム + リセット + 正方形 + 変形 + フィルター + なし + 調整 + シャドウ + 露出 + ハイライト + 明るさ + コントラスト + 彩度 + 明瞭度 + ガンマ + 黒レベル + 白レベル + 色温度 + シャープネス + リセット + ぼかし + なし + 円形 + 直線 + ミラー + ガウス + テキスト + テキスト オプション + 文字色 + フォント + 追加 + 編集 + まっすぐにする + フォント + + 背景色 + 配置 + 前面に + 削除 + テキストを入力 + ブラシ + + 太さ + 硬度 + 前面に + 削除 + ブラシの色 + エディター + エディターを閉じますか? + 画像を破棄して閉じますか? + はい + いいえ + キャンセル + 了解 + 保存 + 画像を保存中…… + 画像を保存中 %s. + 水平方向に反転 + 垂直方向に反転 + 元に戻す + やり直し + カラーピッカー + 透明 White Gray Black From 76571aab9a86d0c210ac6aa714a50d947493bbde Mon Sep 17 00:00:00 2001 From: AioiLight Date: Sun, 26 Jan 2020 18:31:49 +0900 Subject: [PATCH 18/98] updating Japanese translation(some strings) --- app/src/main/res/values-ja/strings.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 203820656..f97b63ada 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -32,8 +32,8 @@ 修正中… 撮影日が正常に修正されました リサイズした画像を共有 - Hey,\n\nseems like you upgraded from the old free app. You can now uninstall the old version, which has an \'Upgrade to Pro\' button at the top of the app settings.\n\nYou will only have the Recycle bin items deleted, favorite items unmarked and you will also have to reset your app settings.\n\nThanks! - Switch to file search across all visible folders + あなたは無料版からアップグレードしたと思われます。"Upgrade to Pro"というボタンが設定の上部にある無料版はアンインストールすることができます。\n\nごみ箱の中身は削除され、お気に入りもアプリの設定もリセットされることになります。\n\nありがとう! + 表示されているすべてのフォルダで検索 に切り替え 表示する形式 @@ -42,7 +42,7 @@ GIF RAW SVG - Portraits + ポートレイト 条件に該当するメディアがありません。 絞り込み条件を変更 @@ -82,7 +82,7 @@ パス 無効な画像パス 画像の編集に失敗しました - File edited successfully + ファイルの編集に成功しました 画像を編集: 画像エディターが見つかりません ファイルの場所が不明です @@ -180,11 +180,11 @@ 画像のズームを深くする 可能な限り高品質で画像を表示 ごみ箱をメイン画面の最後に表示 - Allow closing the fullscreen view with a down gesture - Allow 1:1 zooming in with two double taps + フルスクリーン表示を下にスワイプするジェスチャーで閉じる + ダブルタップして 1:1 ズームする Always open videos on a separate screen with new horizontal gestures Show a notch if available - Allow rotating images with gestures + ジェスチャーで画像を回転する File loading priority Speed Compromise From 1c2d23c57d286ec5eeaba4ad99eccf96a4ee86f2 Mon Sep 17 00:00:00 2001 From: AioiLight Date: Sun, 26 Jan 2020 19:05:20 +0900 Subject: [PATCH 19/98] fix escape missing --- app/src/main/res/values-ja/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f97b63ada..f35577c8c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -32,7 +32,7 @@ 修正中… 撮影日が正常に修正されました リサイズした画像を共有 - あなたは無料版からアップグレードしたと思われます。"Upgrade to Pro"というボタンが設定の上部にある無料版はアンインストールすることができます。\n\nごみ箱の中身は削除され、お気に入りもアプリの設定もリセットされることになります。\n\nありがとう! + あなたは無料版からアップグレードしたと思われます。\"Upgrade to Pro\"というボタンが設定の上部にある無料版はアンインストールすることができます。\n\nごみ箱の中身は削除され、お気に入りもアプリの設定もリセットされることになります。\n\nありがとう! 表示されているすべてのフォルダで検索 に切り替え From 9e702ce59352977fbc5e52f19faa4d26d9fd2391 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 26 Jan 2020 19:18:33 +0100 Subject: [PATCH 20/98] adding czech fastlane app data --- fastlane/metadata/android/cs/full_description.txt | 14 +++++++------- fastlane/metadata/android/cs/short_description.txt | 2 +- fastlane/metadata/android/cs/title.txt | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fastlane/metadata/android/cs/full_description.txt b/fastlane/metadata/android/cs/full_description.txt index 70cb84ae8..621e34bd7 100644 --- a/fastlane/metadata/android/cs/full_description.txt +++ b/fastlane/metadata/android/cs/full_description.txt @@ -1,6 +1,6 @@ -Jednoduchá Galerie Pro je vysoce přizpůsobitelná offline galerie. Organizujte a upravujte své fotografie, obnovujte smazané fotografie s funkcí odpadkového koše, chraňte je a skrývejte. Prohlížejte množství různých foto a video formátů včetně RAW, SVG a mnoho dalších. +Jednoduchá galerie Pro je vysoce přizpůsobitelná offline galerie. Organizujte a upravujte své fotografie, obnovujte smazané fotografie s funkcí odpadkového koše, chraňte je a skrývejte. Prohlížejte množství různých foto a video formátů včetně RAW, SVG a mnoho dalších. -Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že ani nevyžaduje připojení k internetu je vaše soukromí maximálně chráněno. +Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že ani nevyžaduje připojení k internetu, je vaše soukromí maximálně chráněno. ------------------------------------------------- JEDNODUCHÁ GALERIE PRO – FUNKCE @@ -14,7 +14,7 @@ Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že an • Otevírejte mnoho rozličných formátů fotografií a videí (RAW, SVG, GIF, panorama, atd) • Množství intuitivních gest pro jednoduchou úpravu a organizaci souborů • Mnoho různých způsobů filtrování, seskupování a řazení souborů -• Změňte si vzhled Jednoduché galerie pro +• Změňte si vzhled Jednoduché galerie Pro • Dostupná ve 32 jazycích • Označte si oblíbené soubory pro rychlý přístup • Chraňte své fotografie a videa pomocí pinu, vzoru nebo otiskem prstu @@ -27,16 +27,16 @@ Aplikace neobsahuje žádné reklamy ani nepotřebná oprávnění. Tím, že an … a mnoho dalších! EDITOR OBRÁZKŮ -Jednoduchá Galerie Pro umožňuje snadnou úpravu obrázků. Ořezávejte, překlápějte, otáčejte či měňte jejich velikost. Pokud se cítíte kreativně, můžete také aplikovat filtry nebo do obrázku kreslit! +Jednoduchá galerie Pro umožňuje snadnou úpravu obrázků. Ořezávejte, překlápějte, otáčejte či měňte jejich velikost. Pokud se cítíte kreativně, můžete také aplikovat filtry nebo do obrázku kreslit! PODPORA MNOHA TYPŮ SOUBORŮ -Na rozdíl od některých galerií podporuje Jednoduchá Galerie Pro velké množství různých druhů souborů včetně JPEG, PNG, MP4, MKV, RAW, SVG, panoramatických fotografií a videí. +Na rozdíl od některých galerií podporuje Jednoduchá galerie Pro velké množství různých druhů souborů včetně JPEG, PNG, MP4, MKV, RAW, SVG, panoramatických fotografií a videí. Vysoce upravitelný správce galerie -Od vzhledu až po funkční tlačítka na spodní liště, Jednoduchá Galerie Pro je plně nastavitelná a bude fungovat přesně jak si budete přát. Žádná jiná galerie nenabízí takovou flexibilitu! A díky otevřenému kódu je naše aplikace dostupná ve 32 jazycích! +Od vzhledu až po funkční tlačítka na spodní liště, Jednoduchá galerie Pro je plně nastavitelná a bude fungovat přesně jak si budete přát. Žádná jiná galerie nenabízí takovou flexibilitu! A díky otevřenému kódu je naše aplikace dostupná ve 32 jazycích! OBNOVTE SMAZANÉ FOTOGRAFIE A VIDEA -Smazali jste nechtěně důležitou fotografii nebo video? Žádný strach! Jednoduchá Galerie Pro pro podobné případy nabízí funkci odpadkového koše, odkud smazané fotografie a videa snadno obnovíte. +Smazali jste nechtěně důležitou fotografii nebo video? Žádný strach! Jednoduchá galerie Pro pro podobné případy nabízí funkci odpadkového koše, odkud smazané fotografie a videa snadno obnovíte. CHRAŇTE A SKRÝVEJTE SVÉ FOTOGRAFIE A VIDEA Použitím pinu, vzoru nebo otisku prstu snadno své fotografie, videa či celá alba ochráníte nebo skryjete. Můžete ochránit i spuštění samotné aplikace, nebo některé její funkce. Například můžete zabránit náhodnému smazání souboru bez potvrzení otiskem prstu. diff --git a/fastlane/metadata/android/cs/short_description.txt b/fastlane/metadata/android/cs/short_description.txt index 838a83301..07d253324 100644 --- a/fastlane/metadata/android/cs/short_description.txt +++ b/fastlane/metadata/android/cs/short_description.txt @@ -1 +1 @@ -Prohlížejte své vzpomínky bez přerušení. +Prohlížejte svoje vzpomínky bez prerušení s touto foto a video galerií. diff --git a/fastlane/metadata/android/cs/title.txt b/fastlane/metadata/android/cs/title.txt index 085c5b107..c4d4949ec 100644 --- a/fastlane/metadata/android/cs/title.txt +++ b/fastlane/metadata/android/cs/title.txt @@ -1 +1 @@ -Jednoduchá Galerie Pro - Organizér a editor fotografií +Jednoduchá Galerie Pro - Organizér fotografií From 4d7e95d72a4ca23a7ef2eac0be6b2f15f64727c6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 26 Jan 2020 19:18:43 +0100 Subject: [PATCH 21/98] shortening the czech app title --- app/src/main/res/values-cs/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 100e451e2..9ed63b894 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -317,7 +317,7 @@ - Jednoduchá galerie Pro - Organizér a editor fotografií + Jednoduchá galerie Pro - Organizér fotografií Prohlížejte svoje vzpomínky bez prerušení s touto foto a video galerií. From 86db0b8f19386d4697612647a394f336daebcaca Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 14:47:17 +0100 Subject: [PATCH 22/98] fix unselecting invalid favorite items --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 6 ++++-- .../gallery/pro/interfaces/FavoritesDao.kt | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) 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 7e69583e8..179832a97 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 @@ -674,8 +674,10 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag try { if (mediaToDelete.isNotEmpty()) { mediaDB.deleteMedia(*mediaToDelete.toTypedArray()) - val favorites = mediaToDelete.map { getFavoriteFromPath(it.path) } - favoritesDB.deleteFavorites(*favorites.toTypedArray()) + + mediaToDelete.filter { it.isFavorite }.forEach { + favoritesDB.deleteFavoritePath(it.path) + } } } catch (ignored: Exception) { } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt index 52056cb7e..102454e79 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt @@ -23,9 +23,6 @@ interface FavoritesDao { @Query("UPDATE OR REPLACE favorites SET filename = :newFilename, full_path = :newFullPath, parent_path = :newParentPath WHERE full_path = :oldPath COLLATE NOCASE") fun updateFavorite(newFilename: String, newFullPath: String, newParentPath: String, oldPath: String) - @Delete - fun deleteFavorites(vararg favorite: Favorite) - @Query("DELETE FROM favorites WHERE full_path = :path COLLATE NOCASE") fun deleteFavoritePath(path: String) From 9d2239d1c1b39ef35e1be989b33b4db824d273de Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 15:05:17 +0100 Subject: [PATCH 23/98] really clear all Favorites at deleting the given folder --- .../simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt | 1 + .../com/simplemobiletools/gallery/pro/interfaces/MediumDao.kt | 3 +++ 2 files changed, 4 insertions(+) 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 84113cfa9..ec683644d 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 @@ -555,6 +555,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList Date: Mon, 27 Jan 2020 15:17:46 +0100 Subject: [PATCH 24/98] migrate favorites in the new table on app upgrade --- .../gallery/pro/activities/SplashActivity.kt | 32 +++++++++++++++++++ .../gallery/pro/helpers/Config.kt | 4 +++ .../gallery/pro/helpers/Constants.kt | 1 + 3 files changed, 37 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt index 20c9c9387..ede321fc2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt @@ -2,9 +2,41 @@ package com.simplemobiletools.gallery.pro.activities import android.content.Intent import com.simplemobiletools.commons.activities.BaseSplashActivity +import com.simplemobiletools.commons.helpers.ensureBackgroundThread +import com.simplemobiletools.gallery.pro.extensions.config +import com.simplemobiletools.gallery.pro.extensions.favoritesDB +import com.simplemobiletools.gallery.pro.extensions.getFavoriteFromPath +import com.simplemobiletools.gallery.pro.extensions.mediaDB +import com.simplemobiletools.gallery.pro.models.Favorite class SplashActivity : BaseSplashActivity() { override fun initActivity() { + + // check if previously selected favorite items have been properly migrated into the new Favorites table + if (config.wereFavoritesMigrated) { + launchActivity() + } else { + if (config.appRunCount == 0) { + config.wereFavoritesMigrated = true + } else { + ensureBackgroundThread { + val favorites = ArrayList() + val favoritePaths = mediaDB.getFavorites().map { it.path }.toMutableList() as ArrayList + favoritePaths.forEach { + favorites.add(getFavoriteFromPath(it)) + } + favoritesDB.insertAll(favorites) + config.wereFavoritesMigrated = true + + runOnUiThread { + launchActivity() + } + } + } + } + } + + private fun launchActivity() { startActivity(Intent(this, MainActivity::class.java)) finish() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt index 4f8bce7c8..6769ec72d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt @@ -494,4 +494,8 @@ class Config(context: Context) : BaseConfig(context) { var editorBrushSize: Float get() = prefs.getFloat(EDITOR_BRUSH_SIZE, 0.05f) set(editorBrushSize) = prefs.edit().putFloat(EDITOR_BRUSH_SIZE, editorBrushSize).apply() + + var wereFavoritesMigrated: Boolean + get() = prefs.getBoolean(WERE_FAVORITES_MIGRATED, false) + set(wereFavoritesMigrated) = prefs.edit().putBoolean(WERE_FAVORITES_MIGRATED, wereFavoritesMigrated).apply() } 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 50ca3f376..9b549de78 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 @@ -80,6 +80,7 @@ const val SHOW_THUMBNAIL_FILE_TYPES = "show_thumbnail_file_types" const val EDITOR_BRUSH_COLOR = "editor_brush_color" const val EDITOR_BRUSH_HARDNESS = "editor_brush_hardness" const val EDITOR_BRUSH_SIZE = "editor_brush_size" +const val WERE_FAVORITES_MIGRATED = "were_favorites_migrated" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval" From 817229a697e8a06d75d4de9fde72754023e262db Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 17:22:16 +0100 Subject: [PATCH 25/98] lets set wereFavoritesMigrated earlier to avoid some crashlooping --- .../simplemobiletools/gallery/pro/activities/SplashActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt index ede321fc2..45332bcd2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt @@ -19,6 +19,7 @@ class SplashActivity : BaseSplashActivity() { if (config.appRunCount == 0) { config.wereFavoritesMigrated = true } else { + config.wereFavoritesMigrated = true ensureBackgroundThread { val favorites = ArrayList() val favoritePaths = mediaDB.getFavorites().map { it.path }.toMutableList() as ArrayList @@ -26,7 +27,6 @@ class SplashActivity : BaseSplashActivity() { favorites.add(getFavoriteFromPath(it)) } favoritesDB.insertAll(favorites) - config.wereFavoritesMigrated = true runOnUiThread { launchActivity() From 665690c81912ec993f5512ec3f515319b3a9893f Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 20:34:59 +0100 Subject: [PATCH 26/98] removing an unused debug function --- .../gallery/pro/interfaces/FavoritesDao.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt index 102454e79..39a4c4530 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/FavoritesDao.kt @@ -1,6 +1,9 @@ package com.simplemobiletools.gallery.pro.interfaces -import androidx.room.* +import androidx.room.Dao +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query import com.simplemobiletools.gallery.pro.models.Favorite @Dao @@ -11,9 +14,6 @@ interface FavoritesDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insertAll(favorites: List) - @Query("SELECT full_path FROM favorites") - fun getFavoriteRawPaths(): List - @Query("SELECT favorites.full_path FROM favorites INNER JOIN media ON favorites.full_path = media.full_path WHERE media.deleted_ts = 0") fun getValidFavoritePaths(): List From 2517170aebcf5a2b25eff23317d64889270edafe Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 20:48:37 +0100 Subject: [PATCH 27/98] store the fixed Date Taken values in the new table --- .../gallery/pro/extensions/Activity.kt | 9 +++++++++ .../gallery/pro/extensions/Context.kt | 7 +++---- .../gallery/pro/interfaces/DateTakensDao.kt | 11 +++++++++++ 3 files changed, 23 insertions(+), 4 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 4020ed9f5..b23b28522 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 @@ -31,6 +31,7 @@ import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.activities.SimpleActivity import com.simplemobiletools.gallery.pro.dialogs.PickDirectoryDialog import com.simplemobiletools.gallery.pro.helpers.RECYCLE_BIN +import com.simplemobiletools.gallery.pro.models.DateTaken import com.squareup.picasso.Picasso import java.io.File import java.io.FileOutputStream @@ -414,6 +415,8 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc val operations = ArrayList() ensureBackgroundThread { + val dateTakens = ArrayList() + for (path in paths) { val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME_ORIGINAL) ?: ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue @@ -443,6 +446,8 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc mediaDB.updateFavoriteDateTaken(path, timestamp) didUpdateFile = true + val dateTaken = DateTaken(null, path, path.getFilenameFromPath(), path.getParentPath(), timestamp, (System.currentTimeMillis() / 1000).toInt()) + dateTakens.add(dateTaken) if (!hasRescanned && getFileDateTaken(path) == 0L) { pathsToRescan.add(path) } @@ -454,6 +459,10 @@ fun Activity.fixDateTaken(paths: ArrayList, showToasts: Boolean, hasResc } if (hasRescanned || pathsToRescan.isEmpty()) { + if (dateTakens.isNotEmpty()) { + dateTakensDB.insertAll(dateTakens) + } + runOnUiThread { if (showToasts) { toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred) 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 179832a97..a3d542674 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 @@ -25,10 +25,7 @@ import com.simplemobiletools.gallery.pro.activities.SettingsActivity import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.pro.databases.GalleryDatabase import com.simplemobiletools.gallery.pro.helpers.* -import com.simplemobiletools.gallery.pro.interfaces.DirectoryDao -import com.simplemobiletools.gallery.pro.interfaces.FavoritesDao -import com.simplemobiletools.gallery.pro.interfaces.MediumDao -import com.simplemobiletools.gallery.pro.interfaces.WidgetsDao +import com.simplemobiletools.gallery.pro.interfaces.* import com.simplemobiletools.gallery.pro.models.* import com.simplemobiletools.gallery.pro.svg.SvgSoftwareLayerSetter import com.simplemobiletools.gallery.pro.views.MySquareImageView @@ -119,6 +116,8 @@ val Context.directoryDao: DirectoryDao get() = GalleryDatabase.getInstance(appli val Context.favoritesDB: FavoritesDao get() = GalleryDatabase.getInstance(applicationContext).FavoritesDao() +val Context.dateTakensDB: DateTakensDao get() = GalleryDatabase.getInstance(applicationContext).DateTakensDao() + val Context.recycleBin: File get() = filesDir val Context.recycleBinPath: String get() = filesDir.absolutePath diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt index 0d3380408..6f8b609a8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DateTakensDao.kt @@ -1,8 +1,19 @@ package com.simplemobiletools.gallery.pro.interfaces import androidx.room.Dao +import androidx.room.Insert +import androidx.room.OnConflictStrategy +import androidx.room.Query +import com.simplemobiletools.gallery.pro.models.DateTaken @Dao interface DateTakensDao { + @Insert(onConflict = OnConflictStrategy.REPLACE) + fun insertAll(dateTakens: List) + @Query("SELECT full_path, filename, parent_path, date_taken, last_fixed FROM date_takens WHERE parent_path = :path COLLATE NOCASE") + fun getDateTakensFromPath(path: String): List + + @Query("SELECT full_path, filename, parent_path, date_taken, last_fixed FROM date_takens") + fun getAllDateTakens(): List } From 650a985a9cecc0676bf3ea0ba92fe818cf0d7279 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 21:05:05 +0100 Subject: [PATCH 28/98] make the Date Taken from Fix Date Taken value be higher priority than mediastore --- .../simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 8 ++++++-- 1 file changed, 6 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 6a4db386a..955ce9eed 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 @@ -407,8 +407,8 @@ class MediaFetcher(val context: Context) { try { val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) if (dateTaken != 0L) { - val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) - dateTakens[path] = dateTaken + val name = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) + dateTakens[name] = dateTaken } } catch (e: Exception) { } @@ -416,6 +416,10 @@ class MediaFetcher(val context: Context) { } } + context.dateTakensDB.getDateTakensFromPath(folder).forEach { + dateTakens[it.filename] = it.taken + } + return dateTakens } From f4c02d11687861ca2ff04256c674381b2456c2f8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 21:22:10 +0100 Subject: [PATCH 29/98] fix #1545, properly sort Favorites by date taken --- .../gallery/pro/helpers/MediaFetcher.kt | 60 +++++++++++-------- 1 file changed, 34 insertions(+), 26 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 955ce9eed..8f060f922 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 @@ -226,7 +226,7 @@ class MediaFetcher(val context: Context) { val checkFileExistence = config.fileLoadingPriority == PRIORITY_VALIDITY val showHidden = config.shouldShowHidden val showPortraits = filterMedia and TYPE_PORTRAITS != 0 - val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() + val dateTakens = if (getProperDateTaken && !isRecycleBin) getFolderDateTakens(folder) else HashMap() val files = when (folder) { FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toMutableList() as ArrayList @@ -302,7 +302,7 @@ class MediaFetcher(val context: Context) { val videoDuration = if (getVideoDurations && isVideo) path.getVideoDuration() else 0 if (getProperDateTaken) { - dateTaken = dateTakens.remove(filename) ?: lastModified + dateTaken = dateTakens.remove(path) ?: lastModified } val type = when { @@ -390,34 +390,42 @@ class MediaFetcher(val context: Context) { } private fun getFolderDateTakens(folder: String): HashMap { - val projection = arrayOf( - MediaStore.Images.Media.DISPLAY_NAME, - MediaStore.Images.Media.DATE_TAKEN - ) - - val uri = MediaStore.Files.getContentUri("external") - val selection = "${MediaStore.Images.Media.DATA} LIKE ? AND ${MediaStore.Images.Media.DATA} NOT LIKE ?" - val selectionArgs = arrayOf("$folder/%", "$folder/%/%") - val dateTakens = HashMap() - val cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, null) - cursor?.use { - if (cursor.moveToFirst()) { - do { - try { - val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) - if (dateTaken != 0L) { - val name = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) - dateTakens[name] = dateTaken + if (folder != FAVORITES) { + val projection = arrayOf( + MediaStore.Images.Media.DISPLAY_NAME, + MediaStore.Images.Media.DATE_TAKEN + ) + + val uri = MediaStore.Files.getContentUri("external") + val selection = "${MediaStore.Images.Media.DATA} LIKE ? AND ${MediaStore.Images.Media.DATA} NOT LIKE ?" + val selectionArgs = arrayOf("$folder/%", "$folder/%/%") + + val cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, null) + cursor?.use { + if (cursor.moveToFirst()) { + do { + try { + val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) + if (dateTaken != 0L) { + val name = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) + dateTakens["$folder/$name"] = dateTaken + } + } catch (e: Exception) { } - } catch (e: Exception) { - } - } while (cursor.moveToNext()) + } while (cursor.moveToNext()) + } } } - context.dateTakensDB.getDateTakensFromPath(folder).forEach { - dateTakens[it.filename] = it.taken + val dateTakenValues = if (folder == FAVORITES) { + context.dateTakensDB.getAllDateTakens() + } else { + context.dateTakensDB.getDateTakensFromPath(folder) + } + + dateTakenValues.forEach { + dateTakens[it.fullPath] = it.taken } return dateTakens @@ -460,7 +468,6 @@ class MediaFetcher(val context: Context) { } fun groupMedia(media: ArrayList, path: String): ArrayList { - val mediumGroups = LinkedHashMap>() val pathToCheck = if (path.isEmpty()) SHOW_ALL else path val currentGrouping = context.config.getFolderGrouping(pathToCheck) if (currentGrouping and GROUP_BY_NONE != 0) { @@ -473,6 +480,7 @@ class MediaFetcher(val context: Context) { return thumbnailItems } + val mediumGroups = LinkedHashMap>() media.forEach { val key = it.getGroupingKey(currentGrouping) if (!mediumGroups.containsKey(key)) { From 3e7f99fc01dc285320c079c98e0bfe5df03da250 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 23:04:18 +0100 Subject: [PATCH 30/98] fix #1725, properly remember last video playback position, if paused --- .../gallery/pro/fragments/VideoFragment.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 96879d3c1..92b98f653 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -273,8 +273,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } private fun saveVideoProgress() { - if (!videoEnded() && mExoPlayer != null) { - mConfig.saveLastVideoPosition(mMedium.path, mExoPlayer!!.currentPosition.toInt() / 1000) + if (!videoEnded()) { + if (mExoPlayer != null) { + mConfig.saveLastVideoPosition(mMedium.path, mExoPlayer!!.currentPosition.toInt() / 1000) + } else { + mConfig.saveLastVideoPosition(mMedium.path, mPositionAtPause.toInt() / 1000) + } } } From 035d0363e3b10987bf3317aed54d0deefc796831 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 23:15:47 +0100 Subject: [PATCH 31/98] fix #1723, recognize panoramic photos by a new xml tag too --- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 f5cf3f93e..d7555a5b4 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 @@ -657,7 +657,9 @@ class PhotoFragment : ViewPagerFragment() { mIsPanorama = try { val inputStream = if (mMedium.path.startsWith("content:/")) context!!.contentResolver.openInputStream(Uri.parse(mMedium.path)) else File(mMedium.path).inputStream() val imageParser = JpegImageParser().getXmpXml(ByteSourceInputStream(inputStream, mMedium.name), HashMap()) - imageParser.contains("GPano:UsePanoramaViewer=\"True\"", true) || imageParser.contains("True", true) + imageParser.contains("GPano:UsePanoramaViewer=\"True\"", true) || + imageParser.contains("True", true) || + imageParser.contains("GPano:FullPanoWidthPixels=") } catch (e: Exception) { false } catch (e: OutOfMemoryError) { From f8315438d86fb974a871fee18557ca7a97119428 Mon Sep 17 00:00:00 2001 From: ForgottenUmbrella Date: Mon, 27 Jan 2020 01:41:38 +1100 Subject: [PATCH 32/98] Let ExoPlayer handle video looping seamlessly Now that videos are replacing the inefficient GIF format, gapless loops are important. ExoPlayer's built-in mechanism prebuffers the video to enable this, whereas the current implementation of seeking to the start presents a short but noticeable delay between each loop. Note that this change introduces an incompatibility with current behaviour: due to google/ExoPlayer#6459, certain videos with broken audio tracks that played fine before will no longer start. Disabling the audio track is a workaround to re-enable looping playback, but ExoPlayer does not appear to expose a way to check if the audio track is short enough to produce the bug. --- .../gallery/pro/activities/VideoPlayerActivity.kt | 3 +++ .../simplemobiletools/gallery/pro/fragments/VideoFragment.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index bed9bc018..6d0f4f245 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -214,6 +214,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen mExoPlayer = ExoPlayerFactory.newSimpleInstance(applicationContext).apply { seekParameters = SeekParameters.CLOSEST_SYNC audioStreamType = C.STREAM_TYPE_MUSIC + if (config.loopVideos) { + repeatMode = Player.REPEAT_MODE_ONE + } prepare(audioSource) } initExoPlayerListeners() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 92b98f653..162f98c86 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -317,6 +317,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mExoPlayer = ExoPlayerFactory.newSimpleInstance(context) mExoPlayer!!.seekParameters = SeekParameters.CLOSEST_SYNC + if (mConfig.loopVideos) { + mExoPlayer?.repeatMode = Player.REPEAT_MODE_ONE + } val isContentUri = mMedium.path.startsWith("content://") val uri = if (isContentUri) Uri.parse(mMedium.path) else Uri.fromFile(File(mMedium.path)) From e83db406a9a0f3cc0ea19fe1de447cfacdd7fddb Mon Sep 17 00:00:00 2001 From: ForgottenUmbrella Date: Mon, 27 Jan 2020 02:12:40 +1100 Subject: [PATCH 33/98] Reset progress views on video loop The previous loop method of seeking to the beginning at video completion ensured that the seekbar and current time text were immediately reset. Using ExoPlayer's own implementation of video looping means that `Player.STATE_ENDED` is no longer reached, thus the UI no longer accurately tracks progress. Restore the old behaviour by resetting the views on position discontinuity. --- .../gallery/pro/activities/VideoPlayerActivity.kt | 8 +++++++- .../gallery/pro/fragments/VideoFragment.kt | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 6d0f4f245..6b306ba4c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -234,7 +234,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen override fun onLoadingChanged(isLoading: Boolean) {} - override fun onPositionDiscontinuity(reason: Int) {} + override fun onPositionDiscontinuity(reason: Int) { + // Reset progress views when video loops. + if (reason == Player.DISCONTINUITY_REASON_PERIOD_TRANSITION) { + video_seekbar.progress = 0 + video_curr_time.text = 0.getFormattedDuration() + } + } override fun onRepeatModeChanged(repeatMode: Int) {} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 162f98c86..56deff9a1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -353,7 +353,13 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S override fun onLoadingChanged(isLoading: Boolean) {} - override fun onPositionDiscontinuity(reason: Int) {} + override fun onPositionDiscontinuity(reason: Int) { + // Reset progress views when video loops. + if (reason == Player.DISCONTINUITY_REASON_PERIOD_TRANSITION) { + mSeekBar.progress = 0 + mCurrTimeView.text = 0.getFormattedDuration() + } + } override fun onRepeatModeChanged(repeatMode: Int) {} From 9877cbaf2cde09f190f4ee15a9f51f1973d091d9 Mon Sep 17 00:00:00 2001 From: ForgottenUmbrella Date: Mon, 27 Jan 2020 02:13:25 +1100 Subject: [PATCH 34/98] Remove unreachable branches in video completion handling It is never the case that `loopVideos == true` in the `videoCompleted` handler, since enabling that preference sets `repeatMode`, which in turn prevents the player from reaching `STATE_ENDED`. Thus, the branches are unreachable. --- .../gallery/pro/activities/VideoPlayerActivity.kt | 10 +++------- .../gallery/pro/fragments/VideoFragment.kt | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 6b306ba4c..27839af11 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -347,13 +347,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen clearLastVideoSavedProgress() mCurrTime = (mExoPlayer!!.duration / 1000).toInt() - if (config.loopVideos) { - resumeVideo() - } else { - video_seekbar.progress = video_seekbar.max - video_curr_time.text = mDuration.getFormattedDuration() - pauseVideo() - } + video_seekbar.progress = video_seekbar.max + video_curr_time.text = mDuration.getFormattedDuration() + pauseVideo() } private fun didVideoEnd(): Boolean { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 56deff9a1..bc7a69b56 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -681,13 +681,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } mCurrTime = (mExoPlayer!!.duration / 1000).toInt() - if (listener?.videoEnded() == false && mConfig.loopVideos) { - playVideo() - } else { - mSeekBar.progress = mSeekBar.max - mCurrTimeView.text = mDuration.getFormattedDuration() - pauseVideo() - } + mSeekBar.progress = mSeekBar.max + mCurrTimeView.text = mDuration.getFormattedDuration() + pauseVideo() } private fun cleanup() { From 61ded74c064f9e1ba788d36bca95f76e19a12f69 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 28 Jan 2020 18:45:22 +0100 Subject: [PATCH 35/98] update commons to 5.21.28 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 9b9269853..9fefcf351 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.21.25' + implementation 'com.simplemobiletools:commons:5.21.28' 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 2476b974524c261fd69b15e3eb53707dd785fac9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 28 Jan 2020 18:51:28 +0100 Subject: [PATCH 36/98] properly launch the main activity on first app use --- .../simplemobiletools/gallery/pro/activities/SplashActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt index 45332bcd2..9d0c0cc79 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SplashActivity.kt @@ -18,6 +18,7 @@ class SplashActivity : BaseSplashActivity() { } else { if (config.appRunCount == 0) { config.wereFavoritesMigrated = true + launchActivity() } else { config.wereFavoritesMigrated = true ensureBackgroundThread { From 6bb6853d4907d787b0b278badd27c0b1033ad49e Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 28 Jan 2020 19:02:48 +0100 Subject: [PATCH 37/98] update version to 6.12.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9fefcf351..759a1442b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 288 - versionName "6.11.8" + versionCode 289 + versionName "6.12.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 8840a1ad0a945f6464576e281a9c051291d4fa74 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 28 Jan 2020 19:02:56 +0100 Subject: [PATCH 38/98] updating changelog --- CHANGELOG.md | 12 ++++++++++++ fastlane/metadata/android/en-US/changelogs/289.txt | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/289.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index a76981def..c4d6db2ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ Changelog ========== +Version 6.12.0 *(2020-01-28)* +---------------------------- + + * Properly handle sorting by date taken after using "Fix Date Taken values" on the wrong files + * Fixed some issues at copying files, when the source was on an SD card + * Change the way Favorite items are stored, to avoid accidental removal + * Improved video looping (by ForgottenUmbrella) + * Recognize a new type of panoramic photos + * Properly remember last video playback position if the video is paused on exit + * Properly color the top status bar icons at using light primary colors + * Other UX and translation improvements + Version 6.11.8 *(2020-01-19)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/289.txt b/fastlane/metadata/android/en-US/changelogs/289.txt new file mode 100644 index 000000000..6c4167f4f --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/289.txt @@ -0,0 +1,8 @@ + * Properly handle sorting by date taken after using "Fix Date Taken values" on the wrong files + * Fixed some issues at copying files, when the source was on an SD card + * Change the way Favorite items are stored, to avoid accidental removal + * Improved video looping (by ForgottenUmbrella) + * Recognize a new type of panoramic photos + * Properly remember last video playback position if the video is paused on exit + * Properly color the top status bar icons at using light primary colors + * Other UX and translation improvements From 4d96af4d7fbafb9561efee321530fe3361bc3f16 Mon Sep 17 00:00:00 2001 From: akcanSoft Date: Wed, 29 Jan 2020 12:15:04 +0300 Subject: [PATCH 39/98] new tr strings updated --- app/src/main/res/values-tr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index bb700f47a..f04d9abc6 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -317,9 +317,9 @@ - Basit Galeri Pro - Fotoğraf Yönetici & Düzenleyici + Basit Galeri Pro - Fotoğraf Yönetici, Düzenleyici - Browse your memories without any interruptions with this photo and video gallery + Bu fotoğraf ve video galerisinde kesintisiz olarak anılarınıza göz atın Basit Galeri Pro, özelleştirilebilir bir çevrimdışı galeridir. Fotoğraflarınızı düzenleyin ve organize edin, geri dönüşüm kutusuyla silinen dosyaları kurtarın, dosyaları koruyun ve gizleyin ve RAW, SVG ve çok daha fazlası dahil olmak üzere çok çeşitli fotoğraf ve video formatlarını görüntüleyin. From 0faf477e41f66dd4f9253d6e4e8f3862d571882b Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 29 Jan 2020 11:04:38 +0100 Subject: [PATCH 40/98] updating the turkish app fastlane data --- fastlane/metadata/android/tr/short_description.txt | 2 +- fastlane/metadata/android/tr/title.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/tr/short_description.txt b/fastlane/metadata/android/tr/short_description.txt index 690c2cc5a..66c5ba9e8 100644 --- a/fastlane/metadata/android/tr/short_description.txt +++ b/fastlane/metadata/android/tr/short_description.txt @@ -1 +1 @@ -Reklamsız çevrimdışı galeri. Fotoğraf & videolarınızı yönetin ve düzenleyin +Bu fotoğraf ve video galerisinde kesintisiz olarak anılarınıza göz atın diff --git a/fastlane/metadata/android/tr/title.txt b/fastlane/metadata/android/tr/title.txt index 7110dfc6f..5a8fd5a45 100644 --- a/fastlane/metadata/android/tr/title.txt +++ b/fastlane/metadata/android/tr/title.txt @@ -1 +1 @@ -Basit Galeri Pro - Fotoğraf Yönetici & Düzenleyici +Basit Galeri Pro - Fotoğraf Yönetici, Düzenleyici From 193b5c1f2f8eb152bd59433daed91410802fdfbe Mon Sep 17 00:00:00 2001 From: Luis Alfredo Figueroa Bracamontes Date: Wed, 29 Jan 2020 20:14:14 -0600 Subject: [PATCH 41/98] =?UTF-8?q?Update=20strings.xml=20Espa=C3=B1ol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new editor translations --- app/src/main/res/values-es/strings.xml | 148 ++++++++++++------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e5ab52d0e..f64c4896c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -203,85 +203,85 @@ Alternar visibilidad de archivo - Custom - Reset - Square - Transform - Filter - None - Adjust - Shadows - Exposure - Highlights - Brightness - Contrast - Saturation - Clarity - Gamma - Blacks - Whites - Temperature - Sharpness - Reset - Focus - None + Personalizado + Reiniciar + Cuadrado + Recortar + Filtros + Ninguno + Ajustes + Sombras + Exposición + Luces + Brillo + Contraste + Saturación + Claridad + Colores + Negros + Blancos + Temperatura + Nitidez + Reiniciar + Enfoque + Ninguno Radial - Linear - Mirrored - Gaussian - Text - Text Options - Text Color - Font - Add - Edit - Straighten - Font + Lineal + Reflejado + Gaussiano + Texto + Opciones de texto + Color de texto + Fuente + Añadir + Editar + Enderezar + Fuente Color - BG Color - Alignment - To Front - Delete - Your text - Brush + Color de fondo + Alineación + Traer al frente + Eliminar + Tu texto + Pincel Color - Size - Hardness - To Front - Delete - Brush Color + Tamaño + Dureza + Traer al frente + Eliminar + Color del pincel Editor - Close Editor? - Do you really want to discard the image? - Yes + ¿Cerrar editor? + ¿Realmente quieres descartar la imagen? + No - Cancel - Accept - Save - Exporting image… - Exporting image %s. - Flip H - Flip V - Undo - Redo - Color Picker - Transparent - White - Gray - Black - Light blue - Blue - Purple - Orchid - Pink - Red - Orange - Gold - Yellow - Olive - Green - Aquamarin - Pipettable color + Cancelar + Aceptar + Guardar + Exportando imagen… + Exportando imagen %s. + Girar Hor + Girar Vert + Deshacer + Rehacer + Cuentagotas + Transparente + Blanco + Gris + Negro + Azul claro + Azul + Púrpura + Orquídea + Rosa + Rojo + Naranja + Dorado + Amarillo + Oliva + Verde + Aguamarina + Color pipetable ¿Cómo puedo hacer que Simple Gallery sea la galería de dispositivos predeterminada? From cd76fdb345b0dcf6730290ac0a3d10d22d8db4da Mon Sep 17 00:00:00 2001 From: FTno <16176811+FTno@users.noreply.github.com> Date: Thu, 6 Feb 2020 17:13:56 +0100 Subject: [PATCH 42/98] Update strings.xml Norwegian (nb) translation update --- app/src/main/res/values-nb/strings.xml | 70 +++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index e0172c233..e28349369 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -226,16 +226,16 @@ Fokus Ingen Radial - Linear - Mirrored - Gaussian + Lineær + Speilet + Gaussisk Tekst Tekstvalg Tekstfarge Skrift Legg til Rediger - Straighten + Rette Skrift Farge Bakg.farge @@ -250,38 +250,38 @@ Til front Slett Penselfarge - Editor - Close Editor? - Do you really want to discard the image? - Yes - No - Cancel - Accept - Save - Exporting image… - Exporting image %s. - Flip H - Flip V - Undo - Redo - Color Picker - Transparent - White - Gray - Black - Light blue - Blue - Purple - Orchid - Pink - Red + Redigering + Lukke Redigering? + Vil du forkaste bildet? + Ja + Nei + Avbryt + Aksepter + Lagre + Eksporterer bilde… + Eksporterer bilde %s. + Speilvend H + Speilvend V + Angre + Annuler angre + Fargevelger + Gjennomsiktig + Hvit + Grå + Svart + Lyseblå + Blå + Lilla + Orkide + Rosa + Rød Orange - Gold - Yellow - Olive - Green - Aquamarin - Pipettable color + Gull + Gul + Oliven + Grønn + Akvamarin + Pipettefarge How can I make Simple Gallery the default device gallery? From c3dc3ce2751ca155c3b70c816f09a88ded644b6e Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 7 Feb 2020 11:42:28 +0100 Subject: [PATCH 43/98] update commons to 5.22.7 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 759a1442b..fa1a5bfe7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.21.28' + implementation 'com.simplemobiletools:commons:5.22.7' 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 e465f73f9becabb5f0dd8c97e468ca3c695b919f Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 7 Feb 2020 17:54:27 +0100 Subject: [PATCH 44/98] updating gif drawable to 1.2.19 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index fa1a5bfe7..a85dd4db3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,7 +73,7 @@ dependencies { 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' - implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.18' + implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6' implementation 'com.google.vr:sdk-panowidget:1.180.0' From 0cfcba6c8f6da440e12690366647b32ea1ab740d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 7 Feb 2020 20:04:45 +0100 Subject: [PATCH 45/98] avoid fetching the same folder twice, or after exiting the app --- .../gallery/pro/activities/MainActivity.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 7cad1ca04..b61f08f97 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 @@ -73,6 +73,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private var mTempShowHiddenHandler = Handler() private var mZoomListener: MyRecyclerView.MyZoomListener? = null private var mSearchMenuItem: MenuItem? = null + private var mLastMediaFetcher: MediaFetcher? = null private var mDirs = ArrayList() private var mStoredAnimateGifs = true @@ -245,6 +246,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { unregisterFileUpdateListener() if (!config.showAll) { + mLastMediaFetcher?.shouldStop = true GalleryDatabase.destroyInstance() } } @@ -881,7 +883,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } // cached folders have been loaded, recheck folders one by one starting with the first displayed - val mediaFetcher = MediaFetcher(applicationContext) + mLastMediaFetcher?.shouldStop = true + mLastMediaFetcher = MediaFetcher(applicationContext) val getImagesOnly = mIsPickImageIntent || mIsGetImageContentIntent val getVideosOnly = mIsPickVideoIntent || mIsGetVideoContentIntent val hiddenString = getString(R.string.hidden) @@ -900,7 +903,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val curMedia = mediaFetcher.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) + val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { if (directory.path != tempFolderPath) { dirPathsToRemove.add(directory.path) @@ -955,7 +958,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } catch (ignored: Exception) { } - val foldersToScan = mediaFetcher.getFoldersToScan() + val foldersToScan = mLastMediaFetcher!!.getFoldersToScan() foldersToScan.add(FAVORITES) if (config.showRecycleBinAtFolders) { foldersToScan.add(RECYCLE_BIN) @@ -973,7 +976,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val newMedia = mediaFetcher.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) + val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) { continue } From 02bc49a25912b73c6f9de1f199e66c567a5d33ec Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 7 Feb 2020 20:18:06 +0100 Subject: [PATCH 46/98] avoid fetching files at a destroyed MainActivity --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 4 ++-- 1 file changed, 2 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 b61f08f97..a2c193d49 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 @@ -899,7 +899,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { try { for (directory in dirs) { - if (mShouldStopFetching) { + if (mShouldStopFetching || isDestroyed || isFinishing) { return } @@ -972,7 +972,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { // check the remaining folders which were not cached at all yet for (folder in foldersToScan) { - if (mShouldStopFetching) { + if (mShouldStopFetching || isDestroyed || isFinishing) { return } From 37d8f4babf5ec995c9c07083fa258bf401827a3a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Feb 2020 22:22:56 +0100 Subject: [PATCH 47/98] store temporarily editor files at the cacheDir, not filesDir --- .../simplemobiletools/gallery/pro/activities/NewEditActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index 62215b769..8509b0e14 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -247,7 +247,7 @@ class NewEditActivity : SimpleActivity() { settingsList.getSettingsModel(EditorSaveSettings::class.java) .setExportFormat(EditorSaveSettings.FORMAT.AUTO) - .setOutputFilePath("$filesDir/editor/$filename") + .setOutputFilePath("$cacheDir/editor/$filename") .savePolicy = EditorSaveSettings.SavePolicy.RETURN_SOURCE_OR_CREATE_OUTPUT_IF_NECESSARY return settingsList From 6f565f5828860d0caf57a7eb2e46e0056ca03f4d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Feb 2020 22:33:34 +0100 Subject: [PATCH 48/98] upgrade the new editor to 7.0.10 --- app/build.gradle | 35 +++-- .../gallery/pro/activities/NewEditActivity.kt | 133 +++++++++--------- build.gradle | 2 +- 3 files changed, 87 insertions(+), 83 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a85dd4db3..0842c2b06 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -92,31 +92,28 @@ dependencies { } // Apply the PESDKPlugin -apply plugin: 'ly.img.android.pesdk' +apply plugin: 'ly.img.android.sdk' -pesdkConfig { - licencePath 'pesdk_license' +imglyConfig { + pesdk { + enabled true + licencePath 'pesdk_license' + } supportLibVersion "28.0.0" modules { - include 'ly.img.android.pesdk.operation:text' - include 'ly.img.android.pesdk.operation:focus' - include 'ly.img.android.pesdk.operation:brush' - include 'ly.img.android.pesdk.operation:filter' - include 'ly.img.android.pesdk.operation:adjustment' + include 'ui:core' + include 'ui:text' + include 'ui:focus' + include 'ui:brush' + include 'ui:filter' + include 'ui:transform' + include 'ui:adjustment' - include 'ly.img.android.pesdk.ui.mobile_ui:core' - include 'ly.img.android.pesdk.ui.mobile_ui:text' - include 'ly.img.android.pesdk.ui.mobile_ui:focus' - include 'ly.img.android.pesdk.ui.mobile_ui:brush' - include 'ly.img.android.pesdk.ui.mobile_ui:filter' - include 'ly.img.android.pesdk.ui.mobile_ui:transform' - include 'ly.img.android.pesdk.ui.mobile_ui:adjustment' + include 'backend:serializer' - include 'ly.img.android.pesdk:serializer' - - include 'ly.img.android.pesdk.assets:font-basic' - include 'ly.img.android.pesdk.assets:filter-basic' + include 'assets:font-basic' + include 'assets:filter-basic' } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index 8509b0e14..1b47f849a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -17,12 +17,14 @@ import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.dialogs.SaveAsDialog import com.simplemobiletools.gallery.pro.extensions.config import com.simplemobiletools.gallery.pro.extensions.fixDateTaken +import ly.img.android.pesdk.PhotoEditorSettingsList import ly.img.android.pesdk.assets.filter.basic.FilterPackBasic import ly.img.android.pesdk.assets.font.basic.FontPackBasic import ly.img.android.pesdk.backend.model.config.CropAspectAsset import ly.img.android.pesdk.backend.model.state.BrushSettings -import ly.img.android.pesdk.backend.model.state.EditorLoadSettings -import ly.img.android.pesdk.backend.model.state.EditorSaveSettings +import ly.img.android.pesdk.backend.model.state.LoadSettings +import ly.img.android.pesdk.backend.model.state.PhotoEditorSaveSettings +import ly.img.android.pesdk.backend.model.state.SaveSettings import ly.img.android.pesdk.backend.model.state.manager.SettingsList import ly.img.android.pesdk.ui.activity.PhotoEditorBuilder import ly.img.android.pesdk.ui.model.state.* @@ -30,8 +32,6 @@ import ly.img.android.pesdk.ui.panels.item.CropAspectItem import ly.img.android.pesdk.ui.panels.item.ToggleAspectItem import ly.img.android.pesdk.ui.panels.item.ToolItem import java.io.File -import java.util.* -import kotlin.collections.LinkedHashMap import kotlin.collections.set class NewEditActivity : SimpleActivity() { @@ -181,75 +181,82 @@ class NewEditActivity : SimpleActivity() { private fun openEditor(inputImage: Uri) { sourceImageUri = inputImage val filename = inputImage.toString().getFilenameFromPath() + val settingsList = createPesdkSettingsList(filename) - settingsList.getSettingsModel(EditorLoadSettings::class.java).imageSource = sourceImageUri + settingsList.configure { + it.source = inputImage + } + + settingsList[LoadSettings::class].source = inputImage PhotoEditorBuilder(this) .setSettingsList(settingsList) .startActivityForResult(this, PESDK_EDIT_IMAGE) } - private fun createPesdkSettingsList(filename: String): SettingsList { - val settingsList = SettingsList() - settingsList.config.getAssetMap(CropAspectAsset::class.java).apply { - add(CropAspectAsset("my_crop_1_2", 1, 2, false)) - add(CropAspectAsset("my_crop_2_1", 2, 1, false)) - add(CropAspectAsset("my_crop_19_9", 19, 9, false)) - add(CropAspectAsset("my_crop_9_19", 9, 19, false)) - add(CropAspectAsset("my_crop_5_4", 5, 4, false)) - add(CropAspectAsset("my_crop_4_5", 4, 5, false)) - add(CropAspectAsset("my_crop_37_18", 37, 18, false)) - add(CropAspectAsset("my_crop_18_37", 18, 37, false)) - add(CropAspectAsset("my_crop_16_10", 16, 10, false)) - add(CropAspectAsset("my_crop_10_16", 10, 16, false)) + private fun createPesdkSettingsList(filename: String): PhotoEditorSettingsList { + val settingsList = PhotoEditorSettingsList().apply { + configure { + it.setFilterList(FilterPackBasic.getFilterPack()) + } + + configure { + it.setFontList(FontPackBasic.getFontPack()) + } + + config.getAssetMap(CropAspectAsset::class.java).apply { + add(CropAspectAsset("my_crop_1_2", 1, 2, false)) + add(CropAspectAsset("my_crop_2_1", 2, 1, false)) + add(CropAspectAsset("my_crop_19_9", 19, 9, false)) + add(CropAspectAsset("my_crop_9_19", 9, 19, false)) + add(CropAspectAsset("my_crop_5_4", 5, 4, false)) + add(CropAspectAsset("my_crop_4_5", 4, 5, false)) + add(CropAspectAsset("my_crop_37_18", 37, 18, false)) + add(CropAspectAsset("my_crop_18_37", 18, 37, false)) + add(CropAspectAsset("my_crop_16_10", 16, 10, false)) + add(CropAspectAsset("my_crop_10_16", 10, 16, false)) + } + + getSettingsModel(UiConfigAspect::class.java).aspectList.apply { + add(ToggleAspectItem(CropAspectItem("my_crop_2_1"), CropAspectItem("my_crop_1_2"))) + add(ToggleAspectItem(CropAspectItem("my_crop_19_9"), CropAspectItem("my_crop_9_19"))) + add(ToggleAspectItem(CropAspectItem("my_crop_5_4"), CropAspectItem("my_crop_4_5"))) + add(ToggleAspectItem(CropAspectItem("my_crop_37_18"), CropAspectItem("my_crop_18_37"))) + add(ToggleAspectItem(CropAspectItem("my_crop_16_10"), CropAspectItem("my_crop_10_16"))) + } + + getSettingsModel(BrushSettings::class.java).apply { + brushColor = applicationContext.config.editorBrushColor + brushHardness = applicationContext.config.editorBrushHardness + brushSize = applicationContext.config.editorBrushSize + } + + // do not use Text Design, it takes up too much space + val tools = getSettingsModel(UiConfigMainMenu::class.java).toolList + val newTools = tools.filterNot { + it.name!!.isEmpty() + }.toMutableList() as ArrayList + + // move Focus at the end, as it is the least used + // on some devices it is not obvious that the toolbar can be scrolled horizontally, so move the best ones at the beginning to make them visible + val focus = newTools.firstOrNull { it.name == getString(R.string.pesdk_focus_title_name) } + if (focus != null) { + newTools.remove(focus) + newTools.add(focus) + } + + getSettingsModel(UiConfigMainMenu::class.java).setToolList(newTools) + + getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen + + configure { + it.exportFormat = SaveSettings.FORMAT.AUTO + it.setOutputFilePath("$cacheDir/editor/$filename") + it.savePolicy = SaveSettings.SavePolicy.RETURN_SOURCE_OR_CREATE_OUTPUT_IF_NECESSARY + } } - settingsList.getSettingsModel(UiConfigAspect::class.java).aspectList.apply { - add(ToggleAspectItem(CropAspectItem("my_crop_2_1"), CropAspectItem("my_crop_1_2"))) - add(ToggleAspectItem(CropAspectItem("my_crop_19_9"), CropAspectItem("my_crop_9_19"))) - add(ToggleAspectItem(CropAspectItem("my_crop_5_4"), CropAspectItem("my_crop_4_5"))) - add(ToggleAspectItem(CropAspectItem("my_crop_37_18"), CropAspectItem("my_crop_18_37"))) - add(ToggleAspectItem(CropAspectItem("my_crop_16_10"), CropAspectItem("my_crop_10_16"))) - } - - settingsList.getSettingsModel(UiConfigFilter::class.java).setFilterList( - FilterPackBasic.getFilterPack() - ) - - settingsList.getSettingsModel(UiConfigText::class.java).setFontList( - FontPackBasic.getFontPack() - ) - - settingsList.getSettingsModel(BrushSettings::class.java).apply { - brushColor = config.editorBrushColor - brushHardness = config.editorBrushHardness - brushSize = config.editorBrushSize - } - - // do not use Text Design, it takes up too much space - val tools = settingsList.getSettingsModel(UiConfigMainMenu::class.java).toolList - val newTools = tools.filterNot { - it.name!!.isEmpty() - }.toMutableList() as ArrayList - - // move Focus to the end, as it is the least used - // on some devices it is not obvious that the toolbar can be scrolled horizontally, so move the best ones to the start to make them visible - val focus = newTools.firstOrNull { it.name == getString(R.string.pesdk_focus_title_name) } - if (focus != null) { - newTools.remove(focus) - newTools.add(focus) - } - - settingsList.getSettingsModel(UiConfigMainMenu::class.java).setToolList(newTools) - - settingsList.getSettingsModel(UiConfigTheme::class.java).theme = R.style.Imgly_Theme_NoFullscreen - - settingsList.getSettingsModel(EditorSaveSettings::class.java) - .setExportFormat(EditorSaveSettings.FORMAT.AUTO) - .setOutputFilePath("$cacheDir/editor/$filename") - .savePolicy = EditorSaveSettings.SavePolicy.RETURN_SOURCE_OR_CREATE_OUTPUT_IF_NECESSARY - return settingsList } } diff --git a/build.gradle b/build.gradle index f16279588..846e1e568 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.5.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'ly.img.android.pesdk:plugin:6.6.4' + classpath 'ly.img.android.pesdk:plugin:7.0.10' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From 8d5a47ce6c2de9f6815b7bd1fcfd94ab59a35f62 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 11:10:46 +0100 Subject: [PATCH 49/98] get proper file last modified value only when actually needed --- .../gallery/pro/activities/MainActivity.kt | 5 +++-- .../pro/asynctasks/GetMediaAsynctask.kt | 18 +++++++++++++---- .../gallery/pro/extensions/Context.kt | 3 ++- .../gallery/pro/helpers/MediaFetcher.kt | 20 +++++++++++++------ 4 files changed, 33 insertions(+), 13 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 a2c193d49..65d981fc3 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 @@ -893,6 +893,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val tempFolderPath = config.tempFolderPath val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val dirPathsToRemove = ArrayList() @@ -903,7 +904,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) + val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { if (directory.path != tempFolderPath) { dirPathsToRemove.add(directory.path) @@ -976,7 +977,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) + val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) { continue } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt index 365eb673d..955d55df8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.gallery.pro.asynctasks import android.content.Context import android.os.AsyncTask +import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN import com.simplemobiletools.commons.helpers.SORT_BY_SIZE import com.simplemobiletools.gallery.pro.extensions.config @@ -18,22 +19,31 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage override fun doInBackground(vararg params: Void): ArrayList { val pathToUse = if (showAll) SHOW_ALL else mPath - val getProperDateTaken = context.config.getFileSorting(pathToUse) and SORT_BY_DATE_TAKEN != 0 || context.config.getFolderGrouping(pathToUse) and GROUP_BY_DATE_TAKEN_DAILY != 0 - val getProperFileSize = context.config.getFileSorting(pathToUse) and SORT_BY_SIZE != 0 + val folderGrouping = context.config.getFolderGrouping(pathToUse) + val fileSorting = context.config.getFileSorting(pathToUse) + val getProperDateTaken = fileSorting and SORT_BY_DATE_TAKEN != 0 || + folderGrouping and GROUP_BY_DATE_TAKEN_DAILY != 0 || + folderGrouping and GROUP_BY_DATE_TAKEN_MONTHLY != 0 + + val getProperLastModified = fileSorting and SORT_BY_DATE_MODIFIED != 0 || + folderGrouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 || + folderGrouping and GROUP_BY_LAST_MODIFIED_MONTHLY != 0 + + val getProperFileSize = fileSorting and SORT_BY_SIZE != 0 val favoritePaths = context.getFavoritePaths() val getVideoDurations = context.config.showThumbnailVideoDuration val media = if (showAll) { val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES && !context.config.isFolderProtected(it) } val media = ArrayList() foldersToScan.forEach { - val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, getProperFileSize, favoritePaths, getVideoDurations, false) + val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, getVideoDurations, false) media.addAll(newMedia) } mediaFetcher.sortMedia(media, context.config.getFileSorting(SHOW_ALL)) media } else { - mediaFetcher.getFilesFrom(mPath, isPickImage, isPickVideo, getProperDateTaken, getProperFileSize, favoritePaths, getVideoDurations) + mediaFetcher.getFilesFrom(mPath, isPickImage, isPickVideo, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, getVideoDurations) } return mediaFetcher.groupMedia(media, pathToUse) } 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 a3d542674..363b9cb19 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 @@ -888,9 +888,10 @@ fun Context.updateDirectoryPath(path: String) { val includedFolders = config.includedFolders val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() - val curMedia = mediaFetcher.getFilesFrom(path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperFileSize, favoritePaths, false) + val curMedia = mediaFetcher.getFilesFrom(path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val directory = createDirectoryFromMedia(path, curMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) updateDBDirectory(directory) } 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 8f060f922..37b8207fc 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 @@ -20,8 +20,8 @@ import java.util.* class MediaFetcher(val context: Context) { var shouldStop = false - fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean, getProperDateTaken: Boolean, getProperFileSize: Boolean, - favoritePaths: ArrayList, getVideoDurations: Boolean, sortMedia: Boolean = true): ArrayList { + fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean, getProperDateTaken: Boolean, getProperLastModified: Boolean, + getProperFileSize: Boolean, favoritePaths: ArrayList, getVideoDurations: Boolean, sortMedia: Boolean = true): ArrayList { val filterMedia = context.config.filterMedia if (filterMedia == 0) { return ArrayList() @@ -34,7 +34,7 @@ class MediaFetcher(val context: Context) { curMedia.addAll(newMedia) } } else { - val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia, getProperDateTaken, getProperFileSize, favoritePaths, getVideoDurations) + val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, getVideoDurations) curMedia.addAll(newMedia) } @@ -212,7 +212,7 @@ class MediaFetcher(val context: Context) { } private fun getMediaInFolder(folder: String, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int, getProperDateTaken: Boolean, - getProperFileSize: Boolean, favoritePaths: ArrayList, getVideoDurations: Boolean): ArrayList { + getProperLastModified: Boolean, getProperFileSize: Boolean, favoritePaths: ArrayList, getVideoDurations: Boolean): ArrayList { val media = ArrayList() val isRecycleBin = folder == RECYCLE_BIN val deletedMedia = if (isRecycleBin) { @@ -297,12 +297,20 @@ class MediaFetcher(val context: Context) { media.add(this) } } else { - val lastModified = file.lastModified() + val lastModified = if (getProperLastModified) file.lastModified() else 0L var dateTaken = lastModified val videoDuration = if (getVideoDurations && isVideo) path.getVideoDuration() else 0 if (getProperDateTaken) { - dateTaken = dateTakens.remove(path) ?: lastModified + var newDateTaken = dateTakens.remove(path) + if (newDateTaken == null) { + newDateTaken = if (getProperLastModified) { + lastModified + } else { + file.lastModified() + } + } + dateTaken = newDateTaken } val type = when { From 8360b8d9b1d76c7394ad432bcab02a973ffc03ed Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 12:37:38 +0100 Subject: [PATCH 50/98] update commons to 5.22.8 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0842c2b06..db5140226 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.22.7' + implementation 'com.simplemobiletools:commons:5.22.8' 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 0a020b9381540f9fd4b12319ad32c006c549e7c7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 12:42:51 +0100 Subject: [PATCH 51/98] update version to 6.12.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index db5140226..158bcf9da 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 289 - versionName "6.12.0" + versionCode 290 + versionName "6.12.1" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 3cd303dddea17c98929d3950001b4cd48bd136c0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 12:42:58 +0100 Subject: [PATCH 52/98] updating changelog --- CHANGELOG.md | 6 ++++++ fastlane/metadata/android/en-US/changelogs/290.txt | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/290.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d6db2ea..0274f058d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 6.12.1 *(2020-02-10)* +---------------------------- + + * Improved the performance of the initial screen loading + * Fixed some editor related glitches + Version 6.12.0 *(2020-01-28)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/290.txt b/fastlane/metadata/android/en-US/changelogs/290.txt new file mode 100644 index 000000000..cc5309fac --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/290.txt @@ -0,0 +1,2 @@ + * Improved the performance of the initial screen loading + * Fixed some editor related glitches From 0e01026774c30decbdb585aec312a518ff729756 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 21:59:35 +0100 Subject: [PATCH 53/98] fixing some thumbnail and sorting related glitches --- .../gallery/pro/activities/MainActivity.kt | 13 +++- .../pro/asynctasks/GetMediaAsynctask.kt | 2 +- .../gallery/pro/extensions/Context.kt | 62 ++++++++++++++----- .../gallery/pro/extensions/Int.kt | 5 ++ .../gallery/pro/helpers/MediaFetcher.kt | 6 +- .../gallery/pro/interfaces/DirectoryDao.kt | 6 +- .../gallery/pro/models/Directory.kt | 3 +- 7 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt 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 65d981fc3..e780d62c4 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 @@ -472,7 +472,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun showSortingDialog() { ChangeSortingDialog(this, true, false) { directories_grid.adapter = null - if (config.directorySorting and SORT_BY_DATE_MODIFIED > 0 || config.directorySorting and SORT_BY_DATE_TAKEN > 0) { + if (config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.directorySorting and SORT_BY_DATE_TAKEN != 0) { getDirectories() } else { ensureBackgroundThread { @@ -893,7 +893,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val tempFolderPath = config.tempFolderPath val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 - val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 + var getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val dirPathsToRemove = ArrayList() @@ -904,6 +904,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } + if (!getProperLastModified) { + getProperLastModified = config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 + } + val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { if (directory.path != tempFolderPath) { @@ -927,6 +931,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { taken = newDir.taken this@apply.size = newDir.size types = newDir.types + sortValue = getDirectorySortingValue(curMedia) } setupAdapter(dirs) @@ -977,6 +982,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } + if (!getProperLastModified) { + getProperLastModified = config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 + } + val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) { continue diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt index 955d55df8..c459a0b30 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/asynctasks/GetMediaAsynctask.kt @@ -36,7 +36,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES && !context.config.isFolderProtected(it) } val media = ArrayList() foldersToScan.forEach { - val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, getVideoDurations, false) + val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, getVideoDurations) media.addAll(newMedia) } 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 363b9cb19..d481041e8 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 @@ -165,25 +165,26 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList o1 as Directory o2 as Directory + var result = when { sorting and SORT_BY_NAME != 0 -> { if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.name.toLowerCase(), o2.name.toLowerCase()) + AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) } else { - o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) + o1.sortValue.toLowerCase().compareTo(o2.sortValue.toLowerCase()) } } sorting and SORT_BY_PATH != 0 -> { if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) } else { - o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) + o1.sortValue.toLowerCase().compareTo(o2.sortValue.toLowerCase()) } } - sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) - sorting and SORT_BY_SIZE != 0 -> o1.size.compareTo(o2.size) - sorting and SORT_BY_DATE_MODIFIED != 0 -> o1.modified.compareTo(o2.modified) - else -> o1.taken.compareTo(o2.taken) + sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) + sorting and SORT_BY_SIZE != 0 -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) + sorting and SORT_BY_DATE_MODIFIED != 0 -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) + else -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) } if (sorting and SORT_DESCENDING != 0) { @@ -252,7 +253,7 @@ fun Context.getDirectParentSubfolders(dirs: ArrayList, currentPathPre val parent = File(path).parent if (parent != null && !folders.contains(parent) && dirs.none { it.path == parent }) { currentPaths.add(parent) - val isSortingAscending = config.sorting and SORT_DESCENDING == 0 + val isSortingAscending = config.sorting.isSortingAscending() val subDirs = dirs.filter { File(it.path).parent.equals(File(path).parent, true) } as ArrayList if (subDirs.isNotEmpty()) { val lastModified = if (isSortingAscending) { @@ -281,7 +282,8 @@ fun Context.getDirectParentSubfolders(dirs: ArrayList, currentPathPre dateTaken, subDirs.sumByLong { it.size }, getPathLocation(parent), - mediaTypes) + mediaTypes, + "") directory.containsMediaFilesDirectly = false dirs.add(directory) @@ -479,7 +481,7 @@ fun Context.addTempFolderIfNeeded(dirs: ArrayList): ArrayList() - val newFolder = Directory(null, tempFolderPath, "", tempFolderPath.getFilenameFromPath(), 0, 0, 0, 0L, getPathLocation(tempFolderPath), 0) + val newFolder = Directory(null, tempFolderPath, "", tempFolderPath.getFilenameFromPath(), 0, 0, 0, 0L, getPathLocation(tempFolderPath), 0, "") directories.add(newFolder) directories.addAll(dirs) directories @@ -706,7 +708,7 @@ fun Context.updateDBMediaPath(oldPath: String, newPath: String) { fun Context.updateDBDirectory(directory: Directory) { try { - directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) + directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types, directory.sortValue) } catch (ignored: Exception) { } } @@ -858,6 +860,7 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, includedFolders: MutableSet, isSortingAscending: Boolean, getProperFileSize: Boolean): Directory { val OTGPath = config.OTGPath var thumbnail = curMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" + albumCovers.forEach { if (it.path == path && getDoesFilePathExist(it.tmb, OTGPath)) { thumbnail = it.tmb @@ -876,7 +879,36 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, val dateTaken = if (isSortingAscending) Math.min(firstItem.taken, lastItem.taken) else Math.max(firstItem.taken, lastItem.taken) val size = if (getProperFileSize) curMedia.sumByLong { it.size } else 0L val mediaTypes = curMedia.getDirMediaTypes() - return Directory(null, path, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes) + return Directory(null, path, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes, getDirectorySortingValue(curMedia)) +} + +fun Context.getDirectorySortingValue(media: ArrayList): String { + val sorting = config.directorySorting + val sorted = when { + sorting and SORT_BY_NAME != 0 -> media.sortedBy { it.name } + sorting and SORT_BY_PATH != 0 -> media.sortedBy { it.path } + sorting and SORT_BY_SIZE != 0 -> media.sortedBy { it.size } + sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified } + sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken } + else -> media + } + + val relevantMedium = if (sorting.isSortingAscending()) { + sorted.first() + } else { + sorted.last() + } + + val result: Any = when { + sorting and SORT_BY_NAME != 0 -> relevantMedium.name + sorting and SORT_BY_PATH != 0 -> relevantMedium.path + sorting and SORT_BY_SIZE != 0 -> relevantMedium.size + sorting and SORT_BY_DATE_MODIFIED != 0 -> relevantMedium.modified + sorting and SORT_BY_DATE_TAKEN != 0 -> relevantMedium.taken + else -> 0 + } + + return result.toString() } fun Context.updateDirectoryPath(path: String) { @@ -886,7 +918,7 @@ fun Context.updateDirectoryPath(path: String) { val hiddenString = getString(R.string.hidden) val albumCovers = config.parseAlbumCovers() val includedFolders = config.includedFolders - val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 + val isSortingAscending = config.directorySorting.isSortingAscending() val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 @@ -919,5 +951,3 @@ fun Context.getFileDateTaken(path: String): Long { return 0L } - -fun Context.isChromebook() = packageManager.hasSystemFeature("org.chromium.arc.device_management") diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt new file mode 100644 index 000000000..7792ef112 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Int.kt @@ -0,0 +1,5 @@ +package com.simplemobiletools.gallery.pro.extensions + +import com.simplemobiletools.commons.helpers.SORT_DESCENDING + +fun Int.isSortingAscending() = this and SORT_DESCENDING == 0 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 37b8207fc..f80f1aece 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 @@ -21,7 +21,7 @@ class MediaFetcher(val context: Context) { var shouldStop = false fun getFilesFrom(curPath: String, isPickImage: Boolean, isPickVideo: Boolean, getProperDateTaken: Boolean, getProperLastModified: Boolean, - getProperFileSize: Boolean, favoritePaths: ArrayList, getVideoDurations: Boolean, sortMedia: Boolean = true): ArrayList { + getProperFileSize: Boolean, favoritePaths: ArrayList, getVideoDurations: Boolean): ArrayList { val filterMedia = context.config.filterMedia if (filterMedia == 0) { return ArrayList() @@ -38,9 +38,7 @@ class MediaFetcher(val context: Context) { curMedia.addAll(newMedia) } - if (sortMedia) { - sortMedia(curMedia, context.config.getFileSorting(curPath)) - } + sortMedia(curMedia, context.config.getFileSorting(curPath)) return curMedia } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt index 57d6807c2..75acd43c4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/interfaces/DirectoryDao.kt @@ -9,7 +9,7 @@ import com.simplemobiletools.gallery.pro.models.Directory @Dao interface DirectoryDao { - @Query("SELECT path, thumbnail, filename, media_count, last_modified, date_taken, size, location, media_types FROM directories") + @Query("SELECT path, thumbnail, filename, media_count, last_modified, date_taken, size, location, media_types, sort_value FROM directories") fun getAll(): List @Insert(onConflict = REPLACE) @@ -21,8 +21,8 @@ interface DirectoryDao { @Query("DELETE FROM directories WHERE path = :path COLLATE NOCASE") fun deleteDirPath(path: String) - @Query("UPDATE OR REPLACE directories SET thumbnail = :thumbnail, media_count = :mediaCnt, last_modified = :lastModified, date_taken = :dateTaken, size = :size, media_types = :mediaTypes WHERE path = :path COLLATE NOCASE") - fun updateDirectory(path: String, thumbnail: String, mediaCnt: Int, lastModified: Long, dateTaken: Long, size: Long, mediaTypes: Int) + @Query("UPDATE OR REPLACE directories SET thumbnail = :thumbnail, media_count = :mediaCnt, last_modified = :lastModified, date_taken = :dateTaken, size = :size, media_types = :mediaTypes, sort_value = :sortValue WHERE path = :path COLLATE NOCASE") + fun updateDirectory(path: String, thumbnail: String, mediaCnt: Int, lastModified: Long, dateTaken: Long, size: Long, mediaTypes: Int, sortValue: String) @Query("UPDATE directories SET thumbnail = :thumbnail, filename = :name, path = :newPath WHERE path = :oldPath COLLATE NOCASE") fun updateDirectoryAfterRename(thumbnail: String, name: String, newPath: String, oldPath: String) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt index 3b2ebedc5..f68ae3171 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/models/Directory.kt @@ -23,13 +23,14 @@ data class Directory( @ColumnInfo(name = "size") var size: Long, @ColumnInfo(name = "location") var location: Int, @ColumnInfo(name = "media_types") var types: Int, + @ColumnInfo(name = "sort_value") var sortValue: String, // used with "Group direct subfolders" enabled @Ignore var subfoldersCount: Int = 0, @Ignore var subfoldersMediaCount: Int = 0, @Ignore var containsMediaFilesDirectly: Boolean = true) { - constructor() : this(null, "", "", "", 0, 0L, 0L, 0L, 0, 0, 0, 0) + constructor() : this(null, "", "", "", 0, 0L, 0L, 0L, 0, 0, "", 0, 0) fun getBubbleText(sorting: Int, context: Context) = when { sorting and SORT_BY_NAME != 0 -> name From 21cc0b97bc7debd194fa5c567e5fe572057dd984 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 22:02:58 +0100 Subject: [PATCH 54/98] properly update the database by adding the new sort_value column --- .../gallery/pro/databases/GalleryDatabase.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt index 690ce2fe5..aef29c659 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt @@ -9,7 +9,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase import com.simplemobiletools.gallery.pro.interfaces.* import com.simplemobiletools.gallery.pro.models.* -@Database(entities = [Directory::class, Medium::class, Widget::class, DateTaken::class, Favorite::class], version = 7) +@Database(entities = [Directory::class, Medium::class, Widget::class, DateTaken::class, Favorite::class], version = 8) abstract class GalleryDatabase : RoomDatabase() { abstract fun DirectoryDao(): DirectoryDao @@ -34,6 +34,7 @@ abstract class GalleryDatabase : RoomDatabase() { .addMigrations(MIGRATION_4_5) .addMigrations(MIGRATION_5_6) .addMigrations(MIGRATION_6_7) + .addMigrations(MIGRATION_7_8) .build() } } @@ -67,5 +68,11 @@ abstract class GalleryDatabase : RoomDatabase() { database.execSQL("CREATE UNIQUE INDEX `index_favorites_full_path` ON `favorites` (`full_path`)") } } + + private val MIGRATION_7_8 = object : Migration(7, 8) { + override fun migrate(database: SupportSQLiteDatabase) { + database.execSQL("ALTER TABLE directories ADD COLUMN sort_value TEXT NOT NULL") + } + } } } From b27877c10919cffca13321f819ba04b3917c5990 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 22:05:51 +0100 Subject: [PATCH 55/98] make sort_value be empty by default --- .../simplemobiletools/gallery/pro/databases/GalleryDatabase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt index aef29c659..6e2be4788 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt @@ -71,7 +71,7 @@ abstract class GalleryDatabase : RoomDatabase() { private val MIGRATION_7_8 = object : Migration(7, 8) { override fun migrate(database: SupportSQLiteDatabase) { - database.execSQL("ALTER TABLE directories ADD COLUMN sort_value TEXT NOT NULL") + database.execSQL("ALTER TABLE directories ADD COLUMN sort_value TEXT default '' NOT NULL") } } } From bd9dc8b04bee471cd5507ce68134f34e91e64e6a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 22:09:06 +0100 Subject: [PATCH 56/98] properly handle empty size or dates at comparing --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 d481041e8..adbc6c957 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 @@ -182,9 +182,9 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase()) - sorting and SORT_BY_SIZE != 0 -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) - sorting and SORT_BY_DATE_MODIFIED != 0 -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) - else -> (o1.sortValue.toLong()).compareTo(o2.sortValue.toLong()) + sorting and SORT_BY_SIZE != 0 -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) + sorting and SORT_BY_DATE_MODIFIED != 0 -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) + else -> (o1.sortValue.toLongOrNull() ?: 0).compareTo(o2.sortValue.toLongOrNull() ?: 0) } if (sorting and SORT_DESCENDING != 0) { From e8ce13f359ea25084b37b7ce8bef0745ac51f42f Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 22:18:26 +0100 Subject: [PATCH 57/98] update version to 6.12.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 158bcf9da..9a3221820 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 290 - versionName "6.12.1" + versionCode 291 + versionName "6.12.2" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From e4d8abd5a31a8e60ff7c3e9eeaa8ebbc502b41ee Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 22:18:33 +0100 Subject: [PATCH 58/98] updating changelog --- CHANGELOG.md | 5 +++++ fastlane/metadata/android/en-US/changelogs/291.txt | 1 + 2 files changed, 6 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/291.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 0274f058d..1e1c56fe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 6.12.2 *(2020-02-10)* +---------------------------- + + * Fixed some sorting and thumbnail related issues + Version 6.12.1 *(2020-02-10)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/291.txt b/fastlane/metadata/android/en-US/changelogs/291.txt new file mode 100644 index 000000000..22d3aad0c --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/291.txt @@ -0,0 +1 @@ + * Fixed some sorting and thumbnail related issues From f17ffb8642645bf8dd41f96a5ac5a448a6a141c0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 23:47:20 +0100 Subject: [PATCH 59/98] properly copy over the exif data after image editing --- .../gallery/pro/activities/NewEditActivity.kt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index 1b47f849a..461f52e14 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -1,8 +1,11 @@ package com.simplemobiletools.gallery.pro.activities +import android.annotation.TargetApi import android.app.Activity import android.content.Intent +import android.media.ExifInterface import android.net.Uri +import android.os.Build import android.os.Bundle import android.provider.MediaStore import androidx.core.util.Pair @@ -11,6 +14,7 @@ import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.CONFLICT_OVERWRITE import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE import com.simplemobiletools.commons.helpers.REAL_FILE_PATH +import com.simplemobiletools.commons.helpers.isNougatPlus import com.simplemobiletools.commons.interfaces.CopyMoveListener import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.gallery.pro.R @@ -32,6 +36,7 @@ import ly.img.android.pesdk.ui.panels.item.CropAspectItem import ly.img.android.pesdk.ui.panels.item.ToggleAspectItem import ly.img.android.pesdk.ui.panels.item.ToolItem import java.io.File +import java.io.InputStream import kotlin.collections.set class NewEditActivity : SimpleActivity() { @@ -42,6 +47,7 @@ class NewEditActivity : SimpleActivity() { private var destinationFilePath = "" private var imagePathFromEditor = "" // delete the file stored at the internal app storage (the editor saves it there) in case moving to the selected location fails private var sourceImageUri: Uri? = null + private var oldExif: ExifInterface? = null private lateinit var uri: Uri private lateinit var saveUri: Uri @@ -125,6 +131,11 @@ class NewEditActivity : SimpleActivity() { sourceString.substringAfter("file://") } + if (source == imagePathFromEditor) { + finish() + return + } + SaveAsDialog(this, source, true, cancelCallback = { toast(R.string.image_editing_failed) finish() @@ -132,6 +143,7 @@ class NewEditActivity : SimpleActivity() { destinationFilePath = it handleSAFDialog(destinationFilePath) { if (it) { + storeOldExif(source) sourceFileLastModified = File(source).lastModified() val newFile = File("${imagePathFromEditor.getParentPath()}/${destinationFilePath.getFilenameFromPath()}") File(imagePathFromEditor).renameTo(newFile) @@ -154,11 +166,33 @@ class NewEditActivity : SimpleActivity() { super.onActivityResult(requestCode, resultCode, resultData) } + @TargetApi(Build.VERSION_CODES.N) + private fun storeOldExif(sourcePath: String) { + var inputStream: InputStream? = null + try { + if (isNougatPlus()) { + inputStream = contentResolver.openInputStream(Uri.fromFile(File(sourcePath))) + oldExif = ExifInterface(inputStream!!) + } + } catch (ignored: Exception) { + } finally { + inputStream?.close() + } + } + private val editCopyMoveListener = object : CopyMoveListener { override fun copySucceeded(copyOnly: Boolean, copiedAll: Boolean, destinationPath: String) { if (config.keepLastModified) { // add 1 s to the last modified time to properly update the thumbnail updateLastModified(destinationFilePath, sourceFileLastModified + 1000) + + try { + if (isNougatPlus()) { + val newExif = ExifInterface(destinationFilePath) + oldExif?.copyTo(newExif, false) + } + } catch (ignored: Exception) { + } } val paths = arrayListOf(destinationFilePath) From d029381271aba619da4b5e97e2ad5d0cc9ed6973 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 23:48:06 +0100 Subject: [PATCH 60/98] renaming a renaming a variable to make it clearer --- .../gallery/pro/activities/NewEditActivity.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index 461f52e14..c7fb6b29b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -45,7 +45,7 @@ class NewEditActivity : SimpleActivity() { private val RESULT_IMAGE_PATH = "RESULT_IMAGE_PATH" private var sourceFileLastModified = 0L private var destinationFilePath = "" - private var imagePathFromEditor = "" // delete the file stored at the internal app storage (the editor saves it there) in case moving to the selected location fails + private var cacheImagePathFromEditor = "" // delete the file stored at the internal app cache storage (the editor saves it there) in case moving to the selected location fails private var sourceImageUri: Uri? = null private var oldExif: ExifInterface? = null @@ -108,7 +108,7 @@ class NewEditActivity : SimpleActivity() { override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) { if (requestCode == PESDK_EDIT_IMAGE) { val extras = resultData?.extras - imagePathFromEditor = extras?.getString(RESULT_IMAGE_PATH, "") ?: "" + cacheImagePathFromEditor = extras?.getString(RESULT_IMAGE_PATH, "") ?: "" val settings = extras?.getParcelable(SETTINGS_LIST) if (settings != null) { @@ -118,7 +118,7 @@ class NewEditActivity : SimpleActivity() { config.editorBrushSize = brush.brushSize } - if (resultCode != Activity.RESULT_OK || sourceImageUri == null || sourceImageUri.toString().isEmpty() || imagePathFromEditor.isEmpty() || sourceImageUri.toString() == imagePathFromEditor) { + if (resultCode != Activity.RESULT_OK || sourceImageUri == null || sourceImageUri.toString().isEmpty() || cacheImagePathFromEditor.isEmpty() || sourceImageUri.toString() == cacheImagePathFromEditor) { toast(R.string.image_editing_failed) finish() } else { @@ -131,7 +131,7 @@ class NewEditActivity : SimpleActivity() { sourceString.substringAfter("file://") } - if (source == imagePathFromEditor) { + if (source == cacheImagePathFromEditor) { finish() return } @@ -145,8 +145,8 @@ class NewEditActivity : SimpleActivity() { if (it) { storeOldExif(source) sourceFileLastModified = File(source).lastModified() - val newFile = File("${imagePathFromEditor.getParentPath()}/${destinationFilePath.getFilenameFromPath()}") - File(imagePathFromEditor).renameTo(newFile) + val newFile = File("${cacheImagePathFromEditor.getParentPath()}/${destinationFilePath.getFilenameFromPath()}") + File(cacheImagePathFromEditor).renameTo(newFile) val sourceFile = FileDirItem(newFile.absolutePath, newFile.name) val conflictResolutions = LinkedHashMap() @@ -156,7 +156,7 @@ class NewEditActivity : SimpleActivity() { CopyMoveTask(this, false, true, conflictResolutions, editCopyMoveListener, true).execute(pair) } else { toast(R.string.image_editing_failed) - File(imagePathFromEditor).delete() + File(cacheImagePathFromEditor).delete() finish() } } @@ -207,7 +207,7 @@ class NewEditActivity : SimpleActivity() { override fun copyFailed() { toast(R.string.unknown_error_occurred) - File(imagePathFromEditor).delete() + File(cacheImagePathFromEditor).delete() finish() } } From ff99043c01d85d1ee9b938bfd4bdc7d5dcf0e2ce Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 23:55:19 +0100 Subject: [PATCH 61/98] update version to 6.12.3 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9a3221820..f32e949ce 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 291 - versionName "6.12.2" + versionCode 292 + versionName "6.12.3" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From c25d0d9361dd7408e68dd12116758692797d73f4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Feb 2020 23:55:26 +0100 Subject: [PATCH 62/98] updating changelog --- CHANGELOG.md | 6 ++++++ fastlane/metadata/android/en-US/changelogs/292.txt | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/292.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e1c56fe7..4294c3b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 6.12.3 *(2020-02-10)* +---------------------------- + + * Fixed image disappearing at using the Editor + * Properly copy over EXIF values after editing an image + Version 6.12.2 *(2020-02-10)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/292.txt b/fastlane/metadata/android/en-US/changelogs/292.txt new file mode 100644 index 000000000..73e1c803b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/292.txt @@ -0,0 +1,2 @@ + * Fixed image disappearing at using the Editor + * Properly copy over EXIF values after editing an image From 98da1d37b0ceff2bcc5bf071add33de638c6f1aa Mon Sep 17 00:00:00 2001 From: floppyD Date: Tue, 11 Feb 2020 01:57:09 -0300 Subject: [PATCH 63/98] Update strings.xml pt-BR Fixed typos and inconsistencies. --- app/src/main/res/values-pt-rBR/strings.xml | 107 +++++++++++---------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index f76355c3e..8852d3b44 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -5,15 +5,15 @@ Editar Abrir câmera (oculto) - (excluído) + (ignorado) Fixar pasta Desafixar pasta Fixar no topo - Mostrar conteúdo de todas as pastas + Exibir conteúdo de todas as pastas Todas as pastas Alternar para a visualização de pastas Outra pasta - Mostrar no mapa + Exibir no mapa Localização desconhecida Aumentar número de colunas Reduzir número de colunas @@ -32,7 +32,7 @@ Corrigindo… Datas corrigidas com sucesso Compartilhar uma versão redimensionada - Olá,\n\nparece que você atualizou o antigo aplicativo gratuito. Agora você poderá desinstalar a velha versão que tem o botão de atualizar para a versão Pro no topo das Configurações.\n\nVocê terá os itens da Lixeira excluídos, itens favoritos desmarcados e também terá que redefinir as configurações do seu aplicativo.\n\nObrigado! + Olá,\n\nparece que você está atualizando do antigo aplicativo gratuito. Agora você já pode desinstalar a versão antiga, que tem o botão de atualizar para a versão Pro no topo da pagina de Configurações.\n\nVocê terá os itens da Lixeira excluídos, itens favoritos desmarcados e também terá que redefinir as configurações do seu aplicativo.\n\nObrigado! Alternar para a pesquisa de arquivos em todas as pastas visíveis @@ -47,25 +47,25 @@ Alterar filtros - Esta opção oculta a pasta com a adição de um arquivo \".nomedia\" dentro dela, o que também ocultará todas as subpastas que estejam dentro da mesma. Você poderá voltar a exibir estas pastas com a opção \"Mostrar pastas ocultas\". Continuar? + Esta opção oculta a pasta ao adicionar um arquivo \".nomedia\" dentro dela, o que também ocultará todas as suas subpastas. Você poderá voltar a exibir estas pastas com a opção \"Exibir pastas ocultas\". Continuar? Ignorar Pastas ignoradas Gerenciar pastas ignoradas - Esta ação deixará de exibir as pastas selecionadas apenas dentro deste aplicativo. Você pode gerenciar as pastas ignoradas nas Configurações do aplicativo. + Esta ação deixará de exibir as pastas selecionadas apenas dentro deste aplicativo. Você pode gerenciar as pastas ignoradas nas configurações do aplicativo. Ignorar a pasta raiz ao invés desta? - Ignorar uma pasta apenas deixa de exibi-la nesta galeria. Ela continuará visível para outros aplicativos.\n\nSe você quiser ocultar a pasta para todos os aplicativos, utilize a função ocultar. + Ignorar uma pasta apenas deixa de exibi-la nesta galeria. Ela continuará visível para outros aplicativos.\n\nSe você quiser ocultar a pasta para todos os aplicativos, utilize a função Ocultar. Remover todas Remover todas as pastas da lista de pastas ignoradas? Esta ação não exclui as pastas. Pastas ocultas Gerenciar pastas ocultas - Parece que você não tem nenhuma pasta ocultada por um arquivo \".nomedia\". + Parece que você não tem nenhuma pasta oculta por um arquivo \".nomedia\". - Pastas incluídas - Gerenciar pastas incluídas + Pastas inclusas + Gerenciar pastas inclusas Adicionar pasta - Se você possuir pastas com dados multimídia não reconhecidos pelo aplicativo, aqui você pode adicioná-las manualmente. - Nenhum arquivo de mídia foi encontrado. Como alternativa você pode tentar incluir manualmente as pastas com arquivos de mídia. + Se você possuir pastas contendo mídia, mas que não foram reconhecidas pelo aplicativo, aqui você pode adicioná-las manualmente. + Nenhum arquivo de mídia foi encontrado. Você pode resolver isso incluindo manualmente as pastas com arquivos de mídia. Redimensionar @@ -84,8 +84,8 @@ Falha na edição da imagem Arquivo editado com sucesso Editar imagem com: - Editor não encontrado - Localização desconhecida + Nenhum editor de imagem encontrado + Localização de arquivo desconhecida Não foi possível substituir o arquivo original Girar para a esquerda Girar para a direita @@ -101,7 +101,7 @@ Definir como papel de parede Falha ao definir como papel de parede Definir papel de parede com: - Definindo como papel de parede + Definindo como papel de parede… Papel de parede definido com sucesso Retrato Paisagem @@ -116,7 +116,7 @@ Incluir vídeos Incluir GIFs Ordem aleatória - Retroceder + Ordem inversa Apresentação em ciclo Animação Nenhuma @@ -151,8 +151,8 @@ Reproduzir vídeos automaticamente - Lembrar da última posição de reprodução de vídeo - Mostrar/ocultar nome do arquivo + Lembrar posição da última reprodução de vídeo + Exibir/ocultar nome do arquivo Reproduzir vídeos em ciclo Animar GIFs nas miniaturas Maximizar o brilho ao visualizar mídia em tela cheia @@ -162,48 +162,48 @@ Padrão do sistema Sensor do aparelho Proporção da mídia - Fundo de tela e barra de status preta quando em visualização de tela cheia + Fundo preto quando mídia estiver em tela cheia Rolar miniaturas horizontalmente Esconder interface do sistema quando em tela cheia Apagar pastas vazias após excluir o seu conteúdo Permitir controle do brilho com gestos na vertical Permitir controle do volume e brilho com gestos na vertical - Mostrar quantidade de arquivos em cada pasta na tela inicial + Exibir quantidade de arquivos em cada pasta na tela inicial Exibir detalhes adicionais quando em tela cheia Gerenciar detalhes adicionais Permitir zoom com um dedo quando em exibição de tela cheia - Tocar na lateral da tela navega para a próxima imagem ou vídeo + Permitir a troca instantânea de mídia tocando nas laterais da tela Permitir zoom aprofundado para imagens Ocultar detalhes adicionais quando a barra de status estiver oculta - Mostrar alguns botões de ação na parte inferior da tela - Mostrar a Lixeira na tela inicial + Exibir alguns botões de ação na parte inferior da tela + Exibir a Lixeira na tela inicial Zoom aprofundado para imagens - Mostrar imagens na maior qualidade possível - Mostrar a Lixeira como o último item na tela inicial - Gesto para baixo sai da exibição em tela cheia - Dois toques duplos fazem zoom 1:1 + Exibir imagens na maior qualidade possível + Exibir a Lixeira como o último item na tela inicial + Permite fechar a exibição em tela cheia com um gesto para baixo + Permitir zoom 1:1 com dois toques duplos Sempre abrir vídeos em uma tela separada com novos gestos horizontais - Mostrar o notch, se existente + Exibir o notch, se existente Permitir rotação de imagens com gestos Prioridade de carregamento de arquivos Velocidade Meio termo Evitar a exibição de arquivos inválidos - Mostrar tipos de arquivo de imagem + Exibir tipos de arquivo de imagem Miniaturas Mídia em tela cheia Detalhes adicionais - Botões de ação + Barra inferior - Gerenciar botões de ação - Favoritar/Desfavoritar - Exibir/Ocultar arquivo + Gerenciar botões visíveis + Favoritar/desfavoritar + Exibir/ocultar arquivo - Personalizadar + Personalizar Redefinir Quadrado Modificar @@ -284,44 +284,46 @@ Cor pipetável - O que devo fazer para que a Simple Galeria seja o aplicativo de galeria padrão do meu aparelho? - Primeiro, você deve encontrar o aplicativo padrão atual nas configurações do seu aparelho, e apertar o botão que diz "Limpar Padrões". - Na próxima vez que você abrir uma imagem ou vídeo, você deverá ver um seletor do aplicativo, no qual você terá a oportunidade de selecionar a Simple Galeria como o app padrão. - Eu protegi o app com senha, mas me esqueci da senha. O que posso fazer? - Você pode resolver isto de duas formas. A primeira é reinstalar o aplicativo. A segunda é ir nas configurações do seu dispositivo e selecionar a opção "Restaurar preferências do app". - Como posso fazer para que uma pasta sempre apareça no topo da lista? - Faça um toque longo na pasta em questão, e depois toque no ícone de alfinete na parte superior da tela para fixar a pasta ao topo. Se você fixar múltiplas pastas, elas serão ordenadas de acordo como seu critério de ordenação padrão. + Como posso fazer do Simple Galeria a galeria padrão do dispositivo? + Primeiro, você deve encontrar o aplicativo padrão atual nas configurações do seu dispositivo, procurar um botão que diga algo como "Abrir por padrão", clicar nele e selecionar \"Limpar padrão\" + Na próxima vez que você abrir uma imagem ou vídeo, você deverá ver um seletor do aplicativo, no qual você terá a oportunidade de selecionar a Simple Galeria como o app padrão. + Eu protegi o app com senha, mas a esqueci. O que posso fazer? + Você pode resolver isto de duas formas. Você pode reinstalar o aplicativo ou ir nas configurações do seu dispositivo e selecionar a opção "Limpar armazenamento". Isto irá redefinir todas as suas configurações, não removerá nenhum arquivo de mídia. + O que posso fazer para que uma pasta sempre apareça no topo da lista? + Faça um toque longo na pasta em questão, e depois toque no ícone de alfinete na parte superior da tela, isto irá fixá-la no topo. Você também pode fixar várias pastas; os itens fixados serão classificados pelo método de ordenação padrão. Como faço para avançar rapidamente um vídeo (fast-forward)? Você pode fazer um gesto horizontal como dedo, ou tocar nos números de tempo atual ou tempo total do vídeo, que se encontram próximos à barra de posicionamento. Qual é a diferença entre ocultar e ignorar uma pasta? - O opção de ignorar deixa de exibir a pasta apenas na Simple Galeria, enquanto a opção de ocultar afeta todo o sistema, e também irá deixar de exibir a pasta em outros apps de galeria. A função de ocultar cria um arquivo vazio chamado \".nomedia\" na raiz da pasta em questão. Caso você queira fazer a pasta voltar a ser exibida, você pode excluir o arquivo \".nomedia\" usando o gerenciador de arquivos. + Ignorar deixa de exibir a pasta apenas no Simple Galeria, enquanto Ocultar afeta todo o sistema e pode ocultar pastas de outras galerias também. A função ocultar funciona adicionando um arquivo vazio chamado \".nomedia\" na pasta em questão, arquivo este você também pode excluir com um gerenciador de arquivos, se quiser. Porque pastas com capas de CD de música ou figurinhas aparecem na lista? - Você pode pedir para a Simple Galeria ignorar estas pastas, adicionando a pasta raiz onde você guarda as suas músicas à lista de pastas ignoradas. Uma maneira de fazer isso é fazer um toque longo em uma destas pastas, e selecionar a opção Ignorar e, em seguida, seleciona a pasta pai. + Pode acontecer de que algumas pastas incomuns apareçam. Você pode utlizar a opção Ignorar nestas pastas, adicionando-as a lista de pastas ignoradas. Uma maneira de fazer isso é realizar um toque longo em uma destas pastas, selecionar a opção Ignorar e, em seguida, selecionar a pasta pai. Uma das minhas pastas não aparece, ou nem todos os seus itens são exibidos. O que posso fazer? Isso pode ocorrer por diversos motivos, mas resolver o problema é fácil. Entre em Configurações --> Gerenciar pastas incluídas, toque no botão \"+\", e selecione a pasta em questão. Como posso fazer para exibir apenas certas pastas? Adicionar uma pasta à lista de Pastas Incluídas não remove outras pastas da exibição. O que você pode fazer é ir em Configurações -> Gerenciar pastas ignoradas, excluir a pasta raiz \"/\", e finalmente incluir somente as pastas desejadas através de Configurações -> Gerenciar pastas incluídas. + Isso tornará apenas as pastas selecionadas visíveis, já que ignorar e incluir são funçoes recursivas e, se uma pasta for ignorada e incluída ao mesmo tempo, ela será exibida. Posso recortar imagens usando este app? Sim, você pode recortar imagens no editor, arrastando os cantos da imagem. Você pode entrar no editor fazendo um toque longo na imagem e selecionando Editar, ou selecionando Editar a partir da visualização de tela cheia. É possível exibir os meus arquivos de mídia em subgrupos ao invés de em uma única grande lista? - Você pode usar a opção \"Agrupar por\" para agrupar os seus arquivos de mídia por data, formato ou outros critérios. Se a opção \"Mostrar conteúdo de todas as pastas\" estiver ativada, você também poderá agrupar por subpasta. + Você pode usar a opção \"Agrupar por\" para agrupar os seus arquivos de mídia por data, formato ou outros critérios. Se a opção \"Exibir conteúdo de todas as pastas\" estiver ativada, você também poderá agrupar por subpasta. A ordenação por Data da Foto não funciona corretamente. O que posso fazer? Isto pode ter ocorrer caso as suas fotos tenham sido copiadas de outro local. Para resolver o problema, você pode selecionar a função \"Corrigir data da foto\" no menu deste aplicativo. Algumas imagens exibem artefatos de exibição, como bandas de cor. Como posso melhorar a qualidade da exibição? - O nosso método atual para a exibição de imagens funciona bem na grande maioria dos casos, mas caso você queira uma qualidade ainda melhor, ative a opção \"Mostrar imagens na maior qualidade possível\" na seção \"Zoom aprofundado para imagens\" das configurações deste aplicativo. + O nosso método atual para a exibição de imagens funciona bem na grande maioria dos casos, mas caso você queira uma qualidade ainda melhor, ative a opção \"Exibir imagens na maior qualidade possível\" na seção \"Zoom aprofundado para imagens\" das configurações deste aplicativo. Eu ocultei um arquivo/pasta. Como posso desfazer isso? - Você pode pressionar no item do menu \"Mostrar temporariamente itens ocultos\", localizado na tela principal. Você também pode alterar para \"Mostrar itens ocultos\" nas configurações do aplicativo e ver os itens escondidos. Se você quiser reexibir, basta pressionar e selecionar \"Mostrar\". As pastas estão ocultas, adicionando um arquivo oculto \".nomedia\" dentro delas e você pode excluir o arquivo com qualquer gerenciador de arquivos também. - Porque este app gasta tanto espaço? - O cache deste app, que garante que as imagens sejam carregadas mais rapidamente, pode gastar até 250 MB. Se o app estiver gastando mais espaço que isso, pode ser por que você tem muitos arquivos na sua Lixeira. Arquivos na Lixeira são removidos permanentemente após 30 dias, mas se sua Lixeira estiver usando muito espaço apesar disso você pode esvaziá-la manualmente. Para fazer isso, você pode abrir a Lixeira e excluir os arquivos dentro dela, ou você pode fazer o mesmo na tela de configurações deste app. + Você pode pressionar o item de menu \"Exibir ocultos temporariamente\" na tela principal, ou ativar \"Exibir itens ocultos\" nas configurações do aplicativo para ver o item oculto. Se você quiser reexibir-lo, basta pressionar e selecionar \"Exibir\". As pastas são ocultas adicionando um arquivo oculto \".nomedia\" dentro delas, arquivo este que você também pode excluir com um gerenciador de arquivos, se quiser. + Porque este app ocupa tanto espaço? + O cache deste app, que garante que as imagens sejam carregadas mais rapidamente, pode ocupar até 250MB. Se o app estiver ocupando mais espaço que isso, pode ser por que você tem muitos arquivos na sua Lixeira. Arquivos na Lixeira são removidos permanentemente após 30 dias, mas se mesmo assim sua Lixeira estiver ocupando muito espaço, você pode esvaziá-la manualmente. Para fazer isso, você pode abrir a Lixeira e excluir os arquivos dentro dela, ou você pode fazer o mesmo na tela de Configurações deste app. Simple Galeria Pro - Gerenciador de Imagens - Browse your memories without any interruptions with this photo and video gallery + Navegue por suas memórias sem distrações com esta galeria de fotos e vídeos A Simple Galeria Pro é uma galeria de imagens e vídeos altamente customizável. Organize e edite suas fotos e vídeos, recupere arquivos movidos para a lixeira, proteja e oculte seus arquivos, e visualize arquivos em uma grande variedade de formatos, incluindo RAW, SVG, e muito mais. - Este app não inclui anúncios ou permissões desnecessárias e também não acessa a internet. Sua privacidade está protegida. + + Este app não inclui anúncios ou permissões desnecessárias e também não acessa a internet. Sua privacidade está protegida. ------------------------------------------------- SIMPLE GALERIA PRO – FUNCIONALIDADES @@ -364,6 +366,9 @@ Dê uma olhada nos nossos outros aplicativos Simple: https://www.simplemobiletools.com + Site dedicado do Simple Galeria Pro: + https://www.simplemobiletools.com/gallery + Facebook: https://www.facebook.com/simplemobiletools @@ -372,7 +377,7 @@ From da5f534539f8fdb821d87ba16b2d41713faba5fe Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 09:49:00 +0100 Subject: [PATCH 64/98] fixing some folder sorting issues --- .../gallery/pro/activities/MainActivity.kt | 2 +- .../gallery/pro/extensions/Context.kt | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 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 e780d62c4..b58652a18 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 @@ -931,7 +931,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { taken = newDir.taken this@apply.size = newDir.size types = newDir.types - sortValue = getDirectorySortingValue(curMedia) + sortValue = getDirectorySortingValue(curMedia, path, name, size) } setupAdapter(dirs) 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 adbc6c957..8da181faf 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 @@ -879,30 +879,28 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, val dateTaken = if (isSortingAscending) Math.min(firstItem.taken, lastItem.taken) else Math.max(firstItem.taken, lastItem.taken) val size = if (getProperFileSize) curMedia.sumByLong { it.size } else 0L val mediaTypes = curMedia.getDirMediaTypes() - return Directory(null, path, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes, getDirectorySortingValue(curMedia)) + val sortValue = getDirectorySortingValue(curMedia, path, dirName, size) + return Directory(null, path, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes, sortValue) } -fun Context.getDirectorySortingValue(media: ArrayList): String { +fun Context.getDirectorySortingValue(media: ArrayList, path: String, name: String, size: Long): String { val sorting = config.directorySorting val sorted = when { - sorting and SORT_BY_NAME != 0 -> media.sortedBy { it.name } - sorting and SORT_BY_PATH != 0 -> media.sortedBy { it.path } - sorting and SORT_BY_SIZE != 0 -> media.sortedBy { it.size } + sorting and SORT_BY_NAME != 0 -> return name + sorting and SORT_BY_PATH != 0 -> return path + sorting and SORT_BY_SIZE != 0 -> return size.toString() sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified } sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken } else -> media } val relevantMedium = if (sorting.isSortingAscending()) { - sorted.first() + sorted.firstOrNull() ?: return "" } else { - sorted.last() + sorted.lastOrNull() ?: return "" } val result: Any = when { - sorting and SORT_BY_NAME != 0 -> relevantMedium.name - sorting and SORT_BY_PATH != 0 -> relevantMedium.path - sorting and SORT_BY_SIZE != 0 -> relevantMedium.size sorting and SORT_BY_DATE_MODIFIED != 0 -> relevantMedium.modified sorting and SORT_BY_DATE_TAKEN != 0 -> relevantMedium.taken else -> 0 From f8b6e14312e20a9b4e38a57eaa1a64b95fc83f63 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 09:55:09 +0100 Subject: [PATCH 65/98] removing a wrong string tag --- app/src/main/res/values-pt-rBR/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8852d3b44..f2cc12aec 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -300,7 +300,7 @@ Uma das minhas pastas não aparece, ou nem todos os seus itens são exibidos. O que posso fazer? Isso pode ocorrer por diversos motivos, mas resolver o problema é fácil. Entre em Configurações --> Gerenciar pastas incluídas, toque no botão \"+\", e selecione a pasta em questão. Como posso fazer para exibir apenas certas pastas? - Adicionar uma pasta à lista de Pastas Incluídas não remove outras pastas da exibição. O que você pode fazer é ir em Configurações -> Gerenciar pastas ignoradas, excluir a pasta raiz \"/\", e finalmente incluir somente as pastas desejadas através de Configurações -> Gerenciar pastas incluídas. + Adicionar uma pasta à lista de Pastas Incluídas não remove outras pastas da exibição. O que você pode fazer é ir em Configurações -> Gerenciar pastas ignoradas, excluir a pasta raiz \"/\", e finalmente incluir somente as pastas desejadas através de Configurações -> Gerenciar pastas incluídas. Isso tornará apenas as pastas selecionadas visíveis, já que ignorar e incluir são funçoes recursivas e, se uma pasta for ignorada e incluída ao mesmo tempo, ela será exibida. Posso recortar imagens usando este app? Sim, você pode recortar imagens no editor, arrastando os cantos da imagem. Você pode entrar no editor fazendo um toque longo na imagem e selecionando Editar, ou selecionando Editar a partir da visualização de tela cheia. From 4b6da9811bee70a12d4f6228d6c11e1834331d72 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 09:55:16 +0100 Subject: [PATCH 66/98] update commons to 5.22.9 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f32e949ce..f1e7cb6d5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.22.8' + implementation 'com.simplemobiletools:commons:5.22.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' From a385be80a8f1c324ea831768ee0db5e6e0ffeb73 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 10:06:53 +0100 Subject: [PATCH 67/98] use parent path at folder sorting --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8da181faf..08ad5f80e 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 @@ -887,7 +887,7 @@ fun Context.getDirectorySortingValue(media: ArrayList, path: String, nam val sorting = config.directorySorting val sorted = when { sorting and SORT_BY_NAME != 0 -> return name - sorting and SORT_BY_PATH != 0 -> return path + sorting and SORT_BY_PATH != 0 -> return path.getParentPath() sorting and SORT_BY_SIZE != 0 -> return size.toString() sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified } sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken } From 6e0ec2e9adbdc5ac4b5909619b6486f10dd614e1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 10:12:47 +0100 Subject: [PATCH 68/98] update version to 6.12.4 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f1e7cb6d5..cbfdddea6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 292 - versionName "6.12.3" + versionCode 293 + versionName "6.12.4" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 4beef98aba0380bdd519d095918664bebc07ddbe Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 10:12:53 +0100 Subject: [PATCH 69/98] updating changelog --- CHANGELOG.md | 5 +++++ fastlane/metadata/android/en-US/changelogs/293.txt | 1 + 2 files changed, 6 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/293.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 4294c3b7a..64ba6b9fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 6.12.4 *(2020-02-11)* +---------------------------- + + * Fixed some folder sorting related glitches + Version 6.12.3 *(2020-02-10)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/293.txt b/fastlane/metadata/android/en-US/changelogs/293.txt new file mode 100644 index 000000000..9077f804d --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/293.txt @@ -0,0 +1 @@ + * Fixed some folder sorting related glitches From 0fb235af6d59dc4c4012696c5ec4961d2802f80d Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 10:16:01 +0100 Subject: [PATCH 70/98] replacing some tabs with spaces --- app/src/main/res/values-pt-rBR/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index f2cc12aec..b20eb4a39 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -323,7 +323,7 @@ A Simple Galeria Pro é uma galeria de imagens e vídeos altamente customizável. Organize e edite suas fotos e vídeos, recupere arquivos movidos para a lixeira, proteja e oculte seus arquivos, e visualize arquivos em uma grande variedade de formatos, incluindo RAW, SVG, e muito mais. - Este app não inclui anúncios ou permissões desnecessárias e também não acessa a internet. Sua privacidade está protegida. + Este app não inclui anúncios ou permissões desnecessárias e também não acessa a internet. Sua privacidade está protegida. ------------------------------------------------- SIMPLE GALERIA PRO – FUNCIONALIDADES From a0f8c6ddda6486128f8adfb29a52e606a5b96fe9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 10:25:57 +0100 Subject: [PATCH 71/98] adding the gallery website at the portugal app description --- fastlane/metadata/android/pt-rBR/full_description.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastlane/metadata/android/pt-rBR/full_description.txt b/fastlane/metadata/android/pt-rBR/full_description.txt index d82469b02..748daf8c9 100644 --- a/fastlane/metadata/android/pt-rBR/full_description.txt +++ b/fastlane/metadata/android/pt-rBR/full_description.txt @@ -42,6 +42,9 @@ Usando um PIN, padrão, ou sua impressão digital, você pode proteger ou oculta Dê uma olhada nos nossos outros aplicativos Simple: https://www.simplemobiletools.com +Site dedicado do Simple Galeria Pro: +https://www.simplemobiletools.com/gallery + Facebook: https://www.facebook.com/simplemobiletools From d479cc7c3dd908b036c533dd0791460c4791ecf0 Mon Sep 17 00:00:00 2001 From: floppyD Date: Tue, 11 Feb 2020 13:17:30 -0300 Subject: [PATCH 72/98] Improve pt-BR translation --- app/src/main/res/values-pt-rBR/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index b20eb4a39..f88bb0472 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -166,25 +166,25 @@ Rolar miniaturas horizontalmente Esconder interface do sistema quando em tela cheia Apagar pastas vazias após excluir o seu conteúdo - Permitir controle do brilho com gestos na vertical - Permitir controle do volume e brilho com gestos na vertical + Habilitar controle do brilho com gestos na vertical + Habilitar controle de volume e brilho com gestos na vertical Exibir quantidade de arquivos em cada pasta na tela inicial Exibir detalhes adicionais quando em tela cheia Gerenciar detalhes adicionais - Permitir zoom com um dedo quando em exibição de tela cheia - Permitir a troca instantânea de mídia tocando nas laterais da tela - Permitir zoom aprofundado para imagens - Ocultar detalhes adicionais quando a barra de status estiver oculta + Habilitar zoom com um dedo em exibição de tela cheia + Habilitar a troca de mídia tocando nas laterais da tela + Habilitar zoom aprofundado para imagens + Ocultar detalhes adicionais quando a barra de status estiver escondida Exibir alguns botões de ação na parte inferior da tela Exibir a Lixeira na tela inicial Zoom aprofundado para imagens Exibir imagens na maior qualidade possível Exibir a Lixeira como o último item na tela inicial - Permite fechar a exibição em tela cheia com um gesto para baixo - Permitir zoom 1:1 com dois toques duplos + Habilitar fechar a exibição em tela cheia com um gesto para baixo + Habilitar zoom 1:1 com dois toques duplos Sempre abrir vídeos em uma tela separada com novos gestos horizontais Exibir o notch, se existente - Permitir rotação de imagens com gestos + Habilitar rotação de imagens com gestos Prioridade de carregamento de arquivos Velocidade Meio termo From 8e8cb0bd0fc9550ae9b687cf7f6bcdb3d3d79373 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Feb 2020 22:39:16 +0100 Subject: [PATCH 73/98] revert to the previous way of sorting by path, do not use parent path --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 08ad5f80e..8da181faf 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 @@ -887,7 +887,7 @@ fun Context.getDirectorySortingValue(media: ArrayList, path: String, nam val sorting = config.directorySorting val sorted = when { sorting and SORT_BY_NAME != 0 -> return name - sorting and SORT_BY_PATH != 0 -> return path.getParentPath() + sorting and SORT_BY_PATH != 0 -> return path sorting and SORT_BY_SIZE != 0 -> return size.toString() sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified } sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken } From 80e049c033886227d085e0e819549bb9f9119edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Tue, 11 Feb 2020 22:24:36 +0000 Subject: [PATCH 74/98] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 64 +++++++++++++------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 7e387b5c0..d5bd52983 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -251,37 +251,37 @@ Apagar Cor do pincel Editor - Close Editor? - Do you really want to discard the image? - Yes - No - Cancel - Accept - Save - Exporting image… - Exporting image %s. - Flip H - Flip V - Undo - Redo - Color Picker - Transparent - White - Gray - Black - Light blue - Blue - Purple - Orchid - Pink - Red - Orange - Gold - Yellow - Olive - Green - Aquamarin - Pipettable color + Fechar editor? + Tem a certeza de que deseja descartar as alterações? + Sim + Não + Cancelar + Aceitar + Guardar + A exportar imagem… + A exportar a imagem %s. + Inversão horizontal + Inversão vertical + Desfazer + Refazer + Seletor de cores + Transparente + Branco + Cinzento + Preto + Azul claro + Azul + Púrpura + Orquídea + Cor de rosa + Vermelho + Cor de laranja + Dourado + Amarelo + Oliva + Verde + Aquamarino + Pipeta de cores How can I make Simple Gallery the default device gallery? @@ -319,7 +319,7 @@ Simple Gallery Pro - Editor e gestor de fotos - Browse your memories without any interruptions with this photo and video gallery + Explore as suas memórias sem interrupções com esta aplicação Simple Gallery Pro é uma aplicação local para gerir fotos e vídeos. Pode organizar e editar as suas fotos, recuperar ficheiros através da reciclagem, proteger e ocultar ficheiros e ver imagens e vídeos disponíveis em vários formatos tais como RAW, SVG e muito mais. From 722fd49d616b1fa981abe68e285d6a840ce02bde Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 09:54:49 +0100 Subject: [PATCH 75/98] updating the portugal app short desc --- fastlane/metadata/android/pt-rPT/short_description.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/metadata/android/pt-rPT/short_description.txt b/fastlane/metadata/android/pt-rPT/short_description.txt index 3ebb2c472..a63966b5b 100644 --- a/fastlane/metadata/android/pt-rPT/short_description.txt +++ b/fastlane/metadata/android/pt-rPT/short_description.txt @@ -1 +1 @@ -Explore as suas memórias sem interrupções. +Explore as suas memórias sem interrupções com esta aplicação From 8a26a6c27271e8d55b9c89a1363596ef40d53503 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 16:29:47 +0100 Subject: [PATCH 76/98] fix a glitch at determining if proper date taken and last modified should be fetched --- .../gallery/pro/activities/MainActivity.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 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 b58652a18..ea356969d 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 @@ -892,8 +892,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val includedFolders = config.includedFolders val tempFolderPath = config.tempFolderPath val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 - val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 - var getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val dirPathsToRemove = ArrayList() @@ -904,9 +902,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - if (!getProperLastModified) { - getProperLastModified = config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 - } + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { @@ -982,9 +979,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - if (!getProperLastModified) { - getProperLastModified = config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 - } + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(folder) and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) { From 4dfa4c9ea8bb409645435d5f740abbd99f342f06 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 17:06:38 +0100 Subject: [PATCH 77/98] make sure we get the proper thumbnail at file grouping too --- .../gallery/pro/activities/MainActivity.kt | 26 ++++++++++++++++--- .../gallery/pro/extensions/Context.kt | 20 +++++++++++--- 2 files changed, 39 insertions(+), 7 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 ea356969d..895d99ebf 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 @@ -902,8 +902,17 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_TAKEN != 0 - val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 + val sorting = config.getFileSorting(directory.path) + val grouping = config.getFolderGrouping(directory.path) + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || + sorting and SORT_BY_DATE_TAKEN != 0 || + grouping and GROUP_BY_DATE_TAKEN_DAILY != 0 || + grouping and GROUP_BY_DATE_TAKEN_MONTHLY != 0 + + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || + sorting and SORT_BY_DATE_MODIFIED != 0 || + grouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 || + grouping and GROUP_BY_LAST_MODIFIED_MONTHLY != 0 val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { @@ -979,8 +988,17 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(folder) and SORT_BY_DATE_TAKEN != 0 - val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 + val sorting = config.getFileSorting(folder) + val grouping = config.getFolderGrouping(folder) + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || + sorting and SORT_BY_DATE_TAKEN != 0 || + grouping and GROUP_BY_DATE_TAKEN_DAILY != 0 || + grouping and GROUP_BY_DATE_TAKEN_MONTHLY != 0 + + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || + sorting and SORT_BY_DATE_MODIFIED != 0 || + grouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 || + grouping and GROUP_BY_LAST_MODIFIED_MONTHLY != 0 val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) { 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 8da181faf..39f71e0d7 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 @@ -859,7 +859,10 @@ fun Context.addPathToDB(path: String) { fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, albumCovers: ArrayList, hiddenString: String, includedFolders: MutableSet, isSortingAscending: Boolean, getProperFileSize: Boolean): Directory { val OTGPath = config.OTGPath - var thumbnail = curMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" + val grouped = MediaFetcher(this).groupMedia(curMedia, path) + val sortedMedia = grouped.filter { it is Medium }.toMutableList() as ArrayList + + var thumbnail = sortedMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" albumCovers.forEach { if (it.path == path && getDoesFilePathExist(it.tmb, OTGPath)) { @@ -917,8 +920,19 @@ fun Context.updateDirectoryPath(path: String) { val albumCovers = config.parseAlbumCovers() val includedFolders = config.includedFolders val isSortingAscending = config.directorySorting.isSortingAscending() - val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 - val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 + + val sorting = config.getFileSorting(path) + val grouping = config.getFolderGrouping(path) + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || + sorting and SORT_BY_DATE_TAKEN != 0 || + grouping and GROUP_BY_DATE_TAKEN_DAILY != 0 || + grouping and GROUP_BY_DATE_TAKEN_MONTHLY != 0 + + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || + sorting and SORT_BY_DATE_MODIFIED != 0 || + grouping and GROUP_BY_LAST_MODIFIED_DAILY != 0 || + grouping and GROUP_BY_LAST_MODIFIED_MONTHLY != 0 + val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val curMedia = mediaFetcher.getFilesFrom(path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) From 57e77abde057925f3943bc22dca6f87e898e6227 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 17:12:10 +0100 Subject: [PATCH 78/98] removing a redundant parameter --- .../gallery/pro/activities/MainActivity.kt | 5 ++--- .../simplemobiletools/gallery/pro/extensions/Context.kt | 7 +++---- 2 files changed, 5 insertions(+), 7 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 895d99ebf..997c8413d 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 @@ -891,7 +891,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val albumCovers = config.parseAlbumCovers() val includedFolders = config.includedFolders val tempFolderPath = config.tempFolderPath - val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val dirPathsToRemove = ArrayList() @@ -921,7 +920,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } directory } else { - createDirectoryFromMedia(directory.path, curMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) + createDirectoryFromMedia(directory.path, curMedia, albumCovers, hiddenString, includedFolders, getProperFileSize) } // we are looping through the already displayed folders looking for changes, do not do anything if nothing changed @@ -1014,7 +1013,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } } - val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) + val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, getProperFileSize) dirs.add(newDir) setupAdapter(dirs) try { 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 39f71e0d7..b2f2136c9 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 @@ -857,11 +857,10 @@ fun Context.addPathToDB(path: String) { } fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, albumCovers: ArrayList, hiddenString: String, - includedFolders: MutableSet, isSortingAscending: Boolean, getProperFileSize: Boolean): Directory { + includedFolders: MutableSet, getProperFileSize: Boolean): Directory { val OTGPath = config.OTGPath val grouped = MediaFetcher(this).groupMedia(curMedia, path) val sortedMedia = grouped.filter { it is Medium }.toMutableList() as ArrayList - var thumbnail = sortedMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" albumCovers.forEach { @@ -874,6 +873,7 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, thumbnail = thumbnail.getOTGPublicPath(applicationContext) } + val isSortingAscending = config.directorySorting.isSortingAscending() val defaultMedium = Medium(0, "", "", "", 0L, 0L, 0L, 0, 0, false, 0L) val firstItem = curMedia.firstOrNull() ?: defaultMedium val lastItem = curMedia.lastOrNull() ?: defaultMedium @@ -919,7 +919,6 @@ fun Context.updateDirectoryPath(path: String) { val hiddenString = getString(R.string.hidden) val albumCovers = config.parseAlbumCovers() val includedFolders = config.includedFolders - val isSortingAscending = config.directorySorting.isSortingAscending() val sorting = config.getFileSorting(path) val grouping = config.getFolderGrouping(path) @@ -936,7 +935,7 @@ fun Context.updateDirectoryPath(path: String) { val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val curMedia = mediaFetcher.getFilesFrom(path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) - val directory = createDirectoryFromMedia(path, curMedia, albumCovers, hiddenString, includedFolders, isSortingAscending, getProperFileSize) + val directory = createDirectoryFromMedia(path, curMedia, albumCovers, hiddenString, includedFolders, getProperFileSize) updateDBDirectory(directory) } From 2f0bf7cbec87865de33e8b302f75fbaf11cae05b Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 17:15:04 +0100 Subject: [PATCH 79/98] do all that thumbnail fetching only if there is no custom image set --- .../gallery/pro/extensions/Context.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 b2f2136c9..8fe4f8b67 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 @@ -860,8 +860,7 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, includedFolders: MutableSet, getProperFileSize: Boolean): Directory { val OTGPath = config.OTGPath val grouped = MediaFetcher(this).groupMedia(curMedia, path) - val sortedMedia = grouped.filter { it is Medium }.toMutableList() as ArrayList - var thumbnail = sortedMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" + var thumbnail: String? = null albumCovers.forEach { if (it.path == path && getDoesFilePathExist(it.tmb, OTGPath)) { @@ -869,8 +868,13 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, } } - if (config.OTGPath.isNotEmpty() && thumbnail.startsWith(config.OTGPath)) { - thumbnail = thumbnail.getOTGPublicPath(applicationContext) + if (thumbnail == null) { + val sortedMedia = grouped.filter { it is Medium }.toMutableList() as ArrayList + thumbnail = sortedMedia.firstOrNull { getDoesFilePathExist(it.path, OTGPath) }?.path ?: "" + } + + if (config.OTGPath.isNotEmpty() && thumbnail!!.startsWith(config.OTGPath)) { + thumbnail = thumbnail!!.getOTGPublicPath(applicationContext) } val isSortingAscending = config.directorySorting.isSortingAscending() @@ -883,7 +887,7 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList, val size = if (getProperFileSize) curMedia.sumByLong { it.size } else 0L val mediaTypes = curMedia.getDirMediaTypes() val sortValue = getDirectorySortingValue(curMedia, path, dirName, size) - return Directory(null, path, thumbnail, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes, sortValue) + return Directory(null, path, thumbnail!!, dirName, curMedia.size, lastModified, dateTaken, size, getPathLocation(path), mediaTypes, sortValue) } fun Context.getDirectorySortingValue(media: ArrayList, path: String, name: String, size: Long): String { From b3945d5e27296b531f68b9833ed6b131f418f8c2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 19:00:21 +0100 Subject: [PATCH 80/98] update commons to 5.22.10 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index cbfdddea6..db2faa4b7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.22.9' + implementation 'com.simplemobiletools:commons:5.22.10' 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 067caeeeeb6f52e22d33a49d55b05d2f46c7d7cf Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 22:42:30 +0100 Subject: [PATCH 81/98] always copy over exif data at file editing --- .../gallery/pro/activities/NewEditActivity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index c7fb6b29b..c7b625ae0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -185,14 +185,14 @@ class NewEditActivity : SimpleActivity() { if (config.keepLastModified) { // add 1 s to the last modified time to properly update the thumbnail updateLastModified(destinationFilePath, sourceFileLastModified + 1000) + } - try { - if (isNougatPlus()) { - val newExif = ExifInterface(destinationFilePath) - oldExif?.copyTo(newExif, false) - } - } catch (ignored: Exception) { + try { + if (isNougatPlus()) { + val newExif = ExifInterface(destinationFilePath) + oldExif?.copyTo(newExif, false) } + } catch (ignored: Exception) { } val paths = arrayListOf(destinationFilePath) From 5cc0a804b6ce17d8774e38fd4fc47c1a3e383a41 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 22:55:18 +0100 Subject: [PATCH 82/98] after editing update exif first, the last modified --- .../gallery/pro/activities/NewEditActivity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index c7b625ae0..b3b8e4905 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -122,7 +122,7 @@ class NewEditActivity : SimpleActivity() { toast(R.string.image_editing_failed) finish() } else { - // the image is stored at the internal app storage first, for example /data/user/0/com.simplemobiletools.gallery.pro/files/editor/IMG_20191207_183023.jpg + // the image is stored at the internal app storage first, for example /data/user/0/com.simplemobiletools.gallery.pro/cache/editor/IMG_20191207_183023.jpg // first we rename it to the desired name, then move val sourceString = Uri.decode(sourceImageUri.toString())?.toString() ?: "" val source = if (sourceString.isEmpty() || sourceString.startsWith("content")) { @@ -182,11 +182,6 @@ class NewEditActivity : SimpleActivity() { private val editCopyMoveListener = object : CopyMoveListener { override fun copySucceeded(copyOnly: Boolean, copiedAll: Boolean, destinationPath: String) { - if (config.keepLastModified) { - // add 1 s to the last modified time to properly update the thumbnail - updateLastModified(destinationFilePath, sourceFileLastModified + 1000) - } - try { if (isNougatPlus()) { val newExif = ExifInterface(destinationFilePath) @@ -195,6 +190,11 @@ class NewEditActivity : SimpleActivity() { } catch (ignored: Exception) { } + if (config.keepLastModified) { + // add 1 s to the last modified time to properly update the thumbnail + updateLastModified(destinationFilePath, sourceFileLastModified + 1000) + } + val paths = arrayListOf(destinationFilePath) rescanPaths(paths) { fixDateTaken(paths, false) From 6b666a66dca52504abf9b0772c34c087367010a4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 23:03:57 +0100 Subject: [PATCH 83/98] update version to 6.12.5 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index db2faa4b7..7dda3beb3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.simplemobiletools.gallery.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 293 - versionName "6.12.4" + versionCode 294 + versionName "6.12.5" multiDexEnabled true setProperty("archivesBaseName", "gallery") vectorDrawables.useSupportLibrary = true From 8c2ac0359151bfed9413edc4fa16859ec4bd0971 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 23:04:05 +0100 Subject: [PATCH 84/98] updating changelog --- CHANGELOG.md | 6 ++++++ fastlane/metadata/android/en-US/changelogs/294.txt | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/294.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ba6b9fd..2d8d3bfed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 6.12.5 *(2020-02-12)* +---------------------------- + + * Fixed some sorting related glitches + * Keep the old last modified value at file editing + Version 6.12.4 *(2020-02-11)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/294.txt b/fastlane/metadata/android/en-US/changelogs/294.txt new file mode 100644 index 000000000..a594eb2da --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/294.txt @@ -0,0 +1,2 @@ + * Fixed some sorting related glitches + * Keep the old last modified value at file editing From 018ec4b0a5db0123fa522ffe113f571f68befc37 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Feb 2020 20:19:33 +0100 Subject: [PATCH 85/98] tweaking instant video changing by screen side clicks, remove some views --- .../gallery/pro/fragments/VideoFragment.kt | 50 ++++++++++++------- app/src/main/res/layout/pager_video_item.xml | 11 ---- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index bc7a69b56..8a1de7ec2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -81,14 +81,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mMedium = arguments!!.getSerializable(MEDIUM) as Medium mConfig = context!!.config mView = inflater.inflate(R.layout.pager_video_item, container, false).apply { - instant_prev_item.setOnClickListener { listener?.goToPrevItem() } - instant_next_item.setOnClickListener { listener?.goToNextItem() } panorama_outline.setOnClickListener { openPanorama() } video_curr_time.setOnClickListener { skip(false) } video_duration.setOnClickListener { skip(true) } video_holder.setOnClickListener { toggleFullscreen() } video_preview.setOnClickListener { toggleFullscreen() } - video_surface_frame.setOnClickListener { toggleFullscreen() } + video_play_outline.setOnClickListener { if (mConfig.openVideosOnSeparateScreen) { launchVideoPlayer() @@ -114,6 +112,25 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mTextureView = video_surface mTextureView.surfaceTextureListener = this@VideoFragment + val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() { + override fun onSingleTapConfirmed(e: MotionEvent?): Boolean { + if (!mConfig.allowInstantChange) { + toggleFullscreen() + return true + } + + val viewWidth = width + val twentyPercent = viewWidth / 5 + val clickedX = e?.rawX ?: 0f + when { + clickedX <= twentyPercent -> listener?.goToPrevItem() + clickedX >= viewWidth - twentyPercent -> listener?.goToNextItem() + else -> toggleFullscreen() + } + return true + } + }) + if (mConfig.allowDownGesture) { video_preview.setOnTouchListener { view, event -> handleEvent(event) @@ -124,8 +141,11 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S if (video_surface_frame.controller.state.zoom == 1f) { handleEvent(event) } + + gestureDetector.onTouchEvent(event) false } + } } @@ -172,11 +192,19 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mView.apply { mBrightnessSideScroll.initialize(activity!!, slide_info, true, container) { x, y -> - video_holder.performClick() + if (mConfig.allowInstantChange) { + listener?.goToPrevItem() + } else { + toggleFullscreen() + } } mVolumeSideScroll.initialize(activity!!, slide_info, false, container) { x, y -> - video_holder.performClick() + if (mConfig.allowInstantChange) { + listener?.goToNextItem() + } else { + toggleFullscreen() + } } video_surface.onGlobalLayout { @@ -192,7 +220,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S restoreLastVideoSavedPosition() } - updateInstantSwitchWidths() return mView } @@ -201,16 +228,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mConfig = context!!.config // make sure we get a new config, in case the user changed something in the app settings activity!!.updateTextColors(mView.video_holder) val allowVideoGestures = mConfig.allowVideoGestures - val allowInstantChange = mConfig.allowInstantChange mTextureView.beGoneIf(mConfig.openVideosOnSeparateScreen || mIsPanorama) mView.apply { video_surface_frame.beGoneIf(mTextureView.isGone()) video_volume_controller.beVisibleIf(allowVideoGestures && !mIsPanorama) video_brightness_controller.beVisibleIf(allowVideoGestures && !mIsPanorama) - - instant_prev_item.beVisibleIf(allowInstantChange) - instant_next_item.beVisibleIf(allowInstantChange) } checkExtendedDetails() @@ -251,7 +274,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S setVideoSize() initTimeHolder() checkExtendedDetails() - updateInstantSwitchWidths() mView.video_surface_frame.onGlobalLayout { mView.video_surface_frame.controller.resetState() } @@ -453,12 +475,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } } - private fun updateInstantSwitchWidths() { - val newWidth = resources.getDimension(R.dimen.instant_change_bar_width) + if (activity?.portrait == false) activity!!.navigationBarWidth else 0 - mView.instant_prev_item.layoutParams.width = newWidth.toInt() - mView.instant_next_item.layoutParams.width = newWidth.toInt() - } - override fun fullscreenToggled(isFullscreen: Boolean) { mIsFullscreen = isFullscreen val newAlpha = if (isFullscreen) 0f else 1f diff --git a/app/src/main/res/layout/pager_video_item.xml b/app/src/main/res/layout/pager_video_item.xml index 4a18f5add..405f15026 100644 --- a/app/src/main/res/layout/pager_video_item.xml +++ b/app/src/main/res/layout/pager_video_item.xml @@ -35,17 +35,6 @@ android:layout_width="@dimen/media_side_slider_width" android:layout_height="match_parent"/> - - - - Date: Mon, 17 Feb 2020 20:34:23 +0100 Subject: [PATCH 86/98] reduce the instant changer width --- .../gallery/pro/fragments/VideoFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 8a1de7ec2..e0ad02923 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -120,11 +120,11 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } val viewWidth = width - val twentyPercent = viewWidth / 5 + val instantWidth = viewWidth / 7 val clickedX = e?.rawX ?: 0f when { - clickedX <= twentyPercent -> listener?.goToPrevItem() - clickedX >= viewWidth - twentyPercent -> listener?.goToNextItem() + clickedX <= instantWidth -> listener?.goToPrevItem() + clickedX >= viewWidth - instantWidth -> listener?.goToNextItem() else -> toggleFullscreen() } return true From 60b302356499f98b00b06b5bf678426194902427 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Feb 2020 20:37:40 +0100 Subject: [PATCH 87/98] lets use the same instant medium changer width at images --- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 5 ++--- app/src/main/res/layout/pager_photo_item.xml | 4 ++-- app/src/main/res/values-sw600dp/dimens.xml | 1 - app/src/main/res/values/dimens.xml | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) 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 d7555a5b4..8b0934274 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 @@ -767,9 +767,8 @@ class PhotoFragment : ViewPagerFragment() { } private fun updateInstantSwitchWidths() { - val newWidth = resources.getDimension(R.dimen.instant_change_bar_width) + if (activity?.portrait == false) activity!!.navigationBarWidth else 0 - mView.instant_prev_item.layoutParams.width = newWidth.toInt() - mView.instant_next_item.layoutParams.width = newWidth.toInt() + mView.instant_prev_item.layoutParams.width = mScreenWidth / 7 + mView.instant_next_item.layoutParams.width = mScreenWidth / 7 } override fun fullscreenToggled(isFullscreen: Boolean) { diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index 2198768c1..2b90a6bb3 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -98,12 +98,12 @@ diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index 1f8450696..529b78d53 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -5,6 +5,5 @@ 30dp 38dp 70dp - 100dp 80dp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index e8fec8163..574dffa98 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -9,7 +9,6 @@ 70dp 60dp 60dp - 50dp 72dp 64dp 128dp From f175c71621fbe5e0b52aef1641fbd7ca44fe5542 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Feb 2020 22:22:17 +0100 Subject: [PATCH 88/98] fix #1223, updating video player gestures a bit add double tap to skip forward/backward, double tap center to toggle play/pause --- app/build.gradle | 2 +- .../gallery/pro/fragments/VideoFragment.kt | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7dda3beb3..7e2290627 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -81,7 +81,7 @@ dependencies { implementation 'org.apache.sanselan:sanselan:0.97-incubator' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.caverock:androidsvg-aar:1.3' - implementation 'com.github.tibbi:gestureviews:8dccb8450b' + implementation 'com.github.tibbi:gestureviews:512f929d82' implementation 'com.github.tibbi:subsampling-scale-image-view:d404e74e39' kapt 'com.github.bumptech.glide:compiler:4.10.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index e0ad02923..c6662e523 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -39,6 +39,7 @@ import java.io.FileInputStream class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener { private val PROGRESS = "progress" + private val DOUBLE_TAP_SKIP_MS = 10000 private var mIsFullscreen = false private var mWasFragmentInit = false @@ -86,6 +87,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S video_duration.setOnClickListener { skip(true) } video_holder.setOnClickListener { toggleFullscreen() } video_preview.setOnClickListener { toggleFullscreen() } + video_surface_frame.controller.settings.swallowDoubleTaps = true video_play_outline.setOnClickListener { if (mConfig.openVideosOnSeparateScreen) { @@ -129,6 +131,19 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } return true } + + override fun onDoubleTap(e: MotionEvent?): Boolean { + val viewWidth = width + val instantWidth = viewWidth / 7 + val clickedX = e?.rawX ?: 0f + when { + clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_MS, false) + clickedX >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_MS, true) + else -> togglePlayPause() + } + + return true + } }) if (mConfig.allowDownGesture) { @@ -521,9 +536,13 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } mPositionAtPause = 0L - val curr = mExoPlayer!!.currentPosition val twoPercents = Math.max((mExoPlayer!!.duration / 50).toInt(), MIN_SKIP_LENGTH) - val newProgress = if (forward) curr + twoPercents else curr - twoPercents + doSkip(twoPercents, forward) + } + + private fun doSkip(millis: Int, forward: Boolean) { + val curr = mExoPlayer!!.currentPosition + val newProgress = if (forward) curr + millis else curr - millis val roundProgress = Math.round(newProgress / 1000f) val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt(), roundProgress), 0) setPosition(limitedProgress) From 641df80b21333f04ff34616754dceadcfbbc94ad Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Feb 2020 22:45:50 +0100 Subject: [PATCH 89/98] apply the double tap skipping on the separate window player too --- .../pro/activities/VideoPlayerActivity.kt | 27 ++++++++++++++++--- .../gallery/pro/fragments/VideoFragment.kt | 7 +++-- .../gallery/pro/helpers/Constants.kt | 1 + 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 27839af11..5e506f966 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -163,6 +163,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen video_duration.setOnClickListener { skip(true) } video_toggle_play_pause.setOnClickListener { togglePlayPause() } video_surface_frame.setOnClickListener { toggleFullscreen() } + video_surface_frame.controller.settings.swallowDoubleTaps = true video_next_file.beVisibleIf(intent.getBooleanExtra(SHOW_NEXT_ITEM, false)) video_next_file.setOnClickListener { handleNextFile() } @@ -170,8 +171,24 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen video_prev_file.beVisibleIf(intent.getBooleanExtra(SHOW_PREV_ITEM, false)) video_prev_file.setOnClickListener { handlePrevFile() } + + val gestureDetector = GestureDetector(this, object : GestureDetector.SimpleOnGestureListener() { + override fun onDoubleTap(e: MotionEvent?): Boolean { + val instantWidth = mScreenWidth / 7 + val clickedX = e?.rawX ?: 0f + when { + clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + clickedX >= mScreenWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + else -> togglePlayPause() + } + + return true + } + }) + video_surface_frame.setOnTouchListener { view, event -> handleEvent(event) + gestureDetector.onTouchEvent(event) false } @@ -475,11 +492,15 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen return } - val curr = mExoPlayer!!.currentPosition val twoPercents = Math.max((mExoPlayer!!.duration / 50).toInt(), MIN_SKIP_LENGTH) - val newProgress = if (forward) curr + twoPercents else curr - twoPercents + doSkip(twoPercents, forward) + } + + private fun doSkip(millis: Int, forward: Boolean) { + val curr = mExoPlayer!!.currentPosition + val newProgress = if (forward) curr + millis else curr - millis val roundProgress = Math.round(newProgress / 1000f) - val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt(), roundProgress), 0) + val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt() / 1000, roundProgress), 0) setPosition(limitedProgress) if (!mIsPlaying) { togglePlayPause() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index c6662e523..39a67edb8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -39,7 +39,6 @@ import java.io.FileInputStream class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, SeekBar.OnSeekBarChangeListener { private val PROGRESS = "progress" - private val DOUBLE_TAP_SKIP_MS = 10000 private var mIsFullscreen = false private var mWasFragmentInit = false @@ -137,8 +136,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S val instantWidth = viewWidth / 7 val clickedX = e?.rawX ?: 0f when { - clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_MS, false) - clickedX >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_MS, true) + clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + clickedX >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) else -> togglePlayPause() } @@ -544,7 +543,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S val curr = mExoPlayer!!.currentPosition val newProgress = if (forward) curr + millis else curr - millis val roundProgress = Math.round(newProgress / 1000f) - val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt(), roundProgress), 0) + val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt() / 1000, roundProgress), 0) setPosition(limitedProgress) if (!mIsPlaying) { togglePlayPause() 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 9b549de78..78f8b8043 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 @@ -118,6 +118,7 @@ const val MONTH_MILLISECONDS = MONTH_SECONDS * 1000L const val MIN_SKIP_LENGTH = 2000 const val HIDE_SYSTEM_UI_DELAY = 500L const val MAX_PRINT_SIDE_SIZE = 4096 +const val DOUBLE_TAP_SKIP_VIDEO_MS = 10000 const val DIRECTORY = "directory" const val MEDIUM = "medium" From f1e5be6f600f1cd7e80f0f1bfb6c10f1f829147a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Feb 2020 22:55:03 +0100 Subject: [PATCH 90/98] shortening some code --- .../gallery/pro/fragments/VideoFragment.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 39a67edb8..c89e3cf0b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -243,12 +243,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S activity!!.updateTextColors(mView.video_holder) val allowVideoGestures = mConfig.allowVideoGestures mTextureView.beGoneIf(mConfig.openVideosOnSeparateScreen || mIsPanorama) - mView.apply { - video_surface_frame.beGoneIf(mTextureView.isGone()) + mView.video_surface_frame.beGoneIf(mTextureView.isGone()) - video_volume_controller.beVisibleIf(allowVideoGestures && !mIsPanorama) - video_brightness_controller.beVisibleIf(allowVideoGestures && !mIsPanorama) - } + mVolumeSideScroll.beVisibleIf(allowVideoGestures && !mIsPanorama) + mBrightnessSideScroll.beVisibleIf(allowVideoGestures && !mIsPanorama) checkExtendedDetails() initTimeHolder() From c7bc9167840d48852f87eb5d3c8b9cdb133effb4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 18 Feb 2020 12:09:23 +0100 Subject: [PATCH 91/98] simplify the brightness/volume area clicks, use a gesture detector --- .../gallery/pro/views/MediaSideScroll.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt index 50a338666..e21fce85b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt @@ -6,6 +6,7 @@ import android.media.AudioManager import android.os.Handler import android.provider.Settings import android.util.AttributeSet +import android.view.GestureDetector import android.view.MotionEvent import android.view.ViewGroup import android.widget.RelativeLayout @@ -13,8 +14,6 @@ import android.widget.TextView import com.simplemobiletools.commons.extensions.onGlobalLayout import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.audioManager -import com.simplemobiletools.gallery.pro.helpers.CLICK_MAX_DISTANCE -import com.simplemobiletools.gallery.pro.helpers.CLICK_MAX_DURATION import com.simplemobiletools.gallery.pro.helpers.DRAG_THRESHOLD // allow horizontal swipes through the layout, else it can cause glitches at zoomed in images @@ -51,6 +50,15 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co } } + private val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() { + override fun onSingleTapConfirmed(e: MotionEvent?): Boolean { + if (e != null) { + callback(e.rawX, e.rawY) + } + return true + } + }) + override fun dispatchTouchEvent(ev: MotionEvent): Boolean { if (mPassTouches) { if (ev.actionMasked == MotionEvent.ACTION_DOWN) { @@ -66,6 +74,7 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co return false } + gestureDetector.onTouchEvent(event) when (event.actionMasked) { MotionEvent.ACTION_DOWN -> { mTouchDownX = event.x @@ -107,12 +116,6 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co mLastTouchY = event.y } MotionEvent.ACTION_UP -> { - val diffX = mTouchDownX - event.x - val diffY = mTouchDownY - event.y - if (Math.abs(diffX) < CLICK_MAX_DISTANCE && Math.abs(diffY) < CLICK_MAX_DISTANCE && System.currentTimeMillis() - mTouchDownTime < CLICK_MAX_DURATION) { - callback(event.rawX, event.rawY) - } - if (mIsBrightnessScroll) { mTouchDownValue = mTempBrightness } From 0d7aa81442be4235d249fc0c7c87296cb14aba4f Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 18 Feb 2020 15:56:16 +0100 Subject: [PATCH 92/98] adding a double tap listener at the volume/brightness controllers --- .../pro/activities/VideoPlayerActivity.kt | 8 ++++---- .../gallery/pro/fragments/PhotoFragment.kt | 4 ++-- .../gallery/pro/fragments/VideoFragment.kt | 8 ++++---- .../gallery/pro/views/MediaSideScroll.kt | 18 ++++++++++++++---- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 5e506f966..01daa6fbc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -196,13 +196,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen video_surface.surfaceTextureListener = this if (config.allowVideoGestures) { - video_brightness_controller.initialize(this, slide_info, true, video_player_holder) { x, y -> + video_brightness_controller.initialize(this, slide_info, true, video_player_holder, singleTap = { x, y -> toggleFullscreen() - } + }) - video_volume_controller.initialize(this, slide_info, false, video_player_holder) { x, y -> + video_volume_controller.initialize(this, slide_info, false, video_player_holder, singleTap = { x, y -> toggleFullscreen() - } + }) } else { video_brightness_controller.beGone() video_volume_controller.beGone() 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 8b0934274..6f7064d55 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 @@ -111,7 +111,7 @@ class PhotoFragment : ViewPagerFragment() { instant_prev_item.parentView = container instant_next_item.parentView = container - photo_brightness_controller.initialize(activity!!, slide_info, true, container) { x, y -> + photo_brightness_controller.initialize(activity!!, slide_info, true, container, singleTap = { x, y -> mView.apply { if (subsampling_view.isVisible()) { subsampling_view.sendFakeClick(x, y) @@ -119,7 +119,7 @@ class PhotoFragment : ViewPagerFragment() { gestures_view.sendFakeClick(x, y) } } - } + }) if (context.config.allowDownGesture) { gif_view.setOnTouchListener { v, event -> diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index c89e3cf0b..63fb3688f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -205,21 +205,21 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S setVideoSize() mView.apply { - mBrightnessSideScroll.initialize(activity!!, slide_info, true, container) { x, y -> + mBrightnessSideScroll.initialize(activity!!, slide_info, true, container, singleTap = { x, y -> if (mConfig.allowInstantChange) { listener?.goToPrevItem() } else { toggleFullscreen() } - } + }) - mVolumeSideScroll.initialize(activity!!, slide_info, false, container) { x, y -> + mVolumeSideScroll.initialize(activity!!, slide_info, false, container, singleTap = { x, y -> if (mConfig.allowInstantChange) { listener?.goToNextItem() } else { toggleFullscreen() } - } + }) video_surface.onGlobalLayout { if (mIsFragmentVisible && mConfig.autoplayVideos && !mConfig.openVideosOnSeparateScreen) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt index e21fce85b..61ff895a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt @@ -34,14 +34,17 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co private var mSlideInfoFadeHandler = Handler() private var mParentView: ViewGroup? = null private var activity: Activity? = null + private var doubleTap: ((Float, Float) -> Unit)? = null private lateinit var slideInfoView: TextView - private lateinit var callback: (Float, Float) -> Unit + private lateinit var singleTap: (Float, Float) -> Unit - fun initialize(activity: Activity, slideInfoView: TextView, isBrightness: Boolean, parentView: ViewGroup?, callback: (x: Float, y: Float) -> Unit) { + fun initialize(activity: Activity, slideInfoView: TextView, isBrightness: Boolean, parentView: ViewGroup?, singleTap: (x: Float, y: Float) -> Unit, + doubleTap: ((x: Float, y: Float) -> Unit)? = null) { this.activity = activity this.slideInfoView = slideInfoView - this.callback = callback + this.singleTap = singleTap + this.doubleTap = doubleTap mParentView = parentView mIsBrightnessScroll = isBrightness mSlideInfoText = activity.getString(if (isBrightness) R.string.brightness else R.string.volume) @@ -53,7 +56,14 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co private val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() { override fun onSingleTapConfirmed(e: MotionEvent?): Boolean { if (e != null) { - callback(e.rawX, e.rawY) + singleTap(e.rawX, e.rawY) + } + return true + } + + override fun onDoubleTap(e: MotionEvent?): Boolean { + if (e != null && doubleTap != null) { + doubleTap!!.invoke(e.rawX, e.rawY) } return true } From da8aaa71d043cb3c067f10d6e3da8768661cb85f Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Feb 2020 11:45:51 +0100 Subject: [PATCH 93/98] handle double clicks on volume/brightness controllers too --- .../pro/activities/VideoPlayerActivity.kt | 21 ++++++++++++----- .../gallery/pro/fragments/VideoFragment.kt | 23 +++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 01daa6fbc..6b08ef6c3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -174,12 +174,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen val gestureDetector = GestureDetector(this, object : GestureDetector.SimpleOnGestureListener() { override fun onDoubleTap(e: MotionEvent?): Boolean { - val instantWidth = mScreenWidth / 7 - val clickedX = e?.rawX ?: 0f - when { - clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) - clickedX >= mScreenWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) - else -> togglePlayPause() + if (e != null) { + handleDoubleTap(e.rawX) } return true @@ -198,10 +194,14 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen if (config.allowVideoGestures) { video_brightness_controller.initialize(this, slide_info, true, video_player_holder, singleTap = { x, y -> toggleFullscreen() + }, doubleTap = {x, y -> + doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) }) video_volume_controller.initialize(this, slide_info, false, video_player_holder, singleTap = { x, y -> toggleFullscreen() + }, doubleTap = {x, y -> + doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) }) } else { video_brightness_controller.beGone() @@ -304,6 +304,15 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } } + private fun handleDoubleTap(x: Float) { + val instantWidth = mScreenWidth / 7 + when { + x <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + x >= mScreenWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + else -> togglePlayPause() + } + } + private fun resumeVideo() { video_toggle_play_pause.setImageResource(R.drawable.ic_pause_outline) if (mExoPlayer == null) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 63fb3688f..8d7557fd3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -132,13 +132,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } override fun onDoubleTap(e: MotionEvent?): Boolean { - val viewWidth = width - val instantWidth = viewWidth / 7 - val clickedX = e?.rawX ?: 0f - when { - clickedX <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) - clickedX >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) - else -> togglePlayPause() + if (e != null) { + handleDoubleTap(e.rawX) } return true @@ -211,6 +206,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } + }, doubleTap = {x, y -> + doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) }) mVolumeSideScroll.initialize(activity!!, slide_info, false, container, singleTap = { x, y -> @@ -219,6 +216,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } + }, doubleTap = {x, y -> + doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) }) video_surface.onGlobalLayout { @@ -428,6 +427,16 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S listener?.fragmentClicked() } + private fun handleDoubleTap(x: Float) { + val viewWidth = mView.width + val instantWidth = viewWidth / 7 + when { + x <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + x >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + else -> togglePlayPause() + } + } + private fun checkExtendedDetails() { if (mConfig.showExtendedDetails) { mView.video_details.apply { From 349dfd414a76898c6cc1e262cbf89b9b49654720 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Feb 2020 11:58:22 +0100 Subject: [PATCH 94/98] updating a FAQ item about fast forwarding, add double tapping on screen side --- app/src/main/res/values-ar/strings.xml | 2 +- app/src/main/res/values-az/strings.xml | 4 ++-- app/src/main/res/values-ca/strings.xml | 2 +- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-da/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-el/strings.xml | 4 ++-- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-fi/strings.xml | 4 ++-- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-gl/strings.xml | 2 +- app/src/main/res/values-hr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-id/strings.xml | 2 +- app/src/main/res/values-in/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-ko-rKR/strings.xml | 4 ++-- app/src/main/res/values-lt/strings.xml | 2 +- app/src/main/res/values-nb/strings.xml | 4 ++-- app/src/main/res/values-ne/strings.xml | 4 ++-- app/src/main/res/values-nl/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-pt-rBR/strings.xml | 4 ++-- app/src/main/res/values-pt/strings.xml | 4 ++-- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 6 +++--- app/src/main/res/values-sl/strings.xml | 2 +- app/src/main/res/values-sr/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 4 ++-- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-uk/strings.xml | 2 +- app/src/main/res/values-vi/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rHK/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 4 ++-- 37 files changed, 49 insertions(+), 49 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 344bcce6b..fc5b86b7c 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -291,7 +291,7 @@ كيف يمكنني جعل ألبوماً يظهر دائماً في الأعلى ؟ يمكنك الضغط مطولاً علي الألبوم المطلوب وحدد أيقونة "التثبيت" في قائمة الإجراءات، التي ستقوم بتثبيته في الأعلي. يمكنك تثبيت مجلدات متعددة أيضا، سيتم فرز العناصر المثبتة حسب طريقة الفرز الإفتراضية. كيف يمكنني تسريع مقاطع الفيديو؟ - يمكنك إما سحب إصبعك أفقياً على مشغل الفيديو، أو النقر على نصوص المدة الحالية أو أقصي مدة النصوص بالقرب من شريط التحكم (seekbar) . هذا سوف يحرك الفيديو إما إلى الخلف، أو إلى الأمام. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. ما هو الفرق بين إخفاء المجلد وإستبعاده ؟ الإستبعاد يمنع عرض المجلد فقط في الاستديو، بينما الإخفاء يعمل على مستوى النظام ويخفي المجلد من المعارض الأخرى أيضاً. يعمل عن طريق إنشاء ملف فارغ \ ".nomedia \" في المجلد المحدد ، والذي يمكنك إزالته بعد ذلك بواسطة أي مدير ملفات أيضًا. لماذا تظهر المجلدات مع صورة غلاف الموسيقى أو الملصقات؟ diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 449778d15..5ecd24f39 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index bf388a9fd..6a260fd4e 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -292,7 +292,7 @@ Com puc fer que un àlbum sempre aparegui a la part superior? Podeu prémer l’àlbum desitjat i seleccionar la icona de la xinxeta al menú d’acció i el fixarà a la part superior. També podeu enganxar diverses carpetes, els elements fixats s’ordenaran pel mètode de classificació predeterminat. Com puc fer avançar els vídeos? - Podeu arrossegar el dit horitzontalment al reproductor de vídeo o fer clic als textos actuals o de màxima duració a prop de la barra de cerca. Això mourà el vídeo ja sigui cap enrere o cap endavant. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Quina és la diferència entre ocultar i excloure una carpeta? Excloure impedeix mostrar la carpeta només a Simple Galery, mentre que Ocultar també amaga la carpeta a altres galeries. Funciona creant un fitxer \". Nomedia \" buit a la carpeta donada, que podeu eliminar amb qualsevol gestor de fitxers. Per què apareixen les carpetes amb les portades de la música o adhesius? diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 9ed63b894..af697b7c1 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -292,7 +292,7 @@ Jak mohu dosáhnout, aby bylo dané album stále zobrazeno jako první? Můžete označit danou složku dlouhým podržením a zvolit tlačítko s obrázkem připínáčku, to ji připne nahoru. Můžete připnout i více složek, budou seřazeny podle zvoleného řazení. Jak mohu video posunout vpřed? - Můžete toho dosáhnout buď tažením prstu vodorovně přes okno přehrávače nebo klepnutím na text aktuální či celkové délky videa, který najdete po bocích indikátoru aktuální pozice. To posune video buď zpět nebo vpřed. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Jaký je rozdíl mezi Skrytím a Vyloučením složky? Zatímco vyloučení zamezí zobrazení složky pouze vrámci Jednoduché galerie, skrytí ji ukryje v celém systému, tedy to ovlivní i ostatní galerie. Skrytí funguje pomocí vytvoření prázdného souboru \".nomedia\" v daném adresáři, který můžete vymazat i libovolným správcem souborů. Proč se mi zobrazují složky s obaly hudebních alb, nebo nálepkami? diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index a4fc7e372..9321a1ec3 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -292,7 +292,7 @@ Hvordan kan jeg altid få et bestemt album vist i toppen? Du kan holde fingeren nede på det ønskede album, og vælge tegnestift-ikonet i menuen, dette vil fastgøre den til toppen. Du kan fastgøre flere mapper også. Fastgjorte elementer vil blive sorteret efter standard sorterings-metoden. Hvordan kan jeg spole fremad i videoer? - Du kan enten trække din finger vandret over videoafspilleren, eller klikke på den nuværende eller maksimum varighedsteksterne, nær søgefeltet. Det vil enten spole videoen tilbage eller fremad. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Hvad er forskellen på at skjule og ekskludere en mappe? Eksludering forhindrer kun visning af mappen i Simple Gallery, mens Skjul virker på systemniveau og skjuler mappen fra andre gallerier også. Det fungerer ved at oprette en tom \".nomedia\"-fil i den givne mappe, som du kan slette med enhver filhåndterings-app. Hvorfor dukker mapper med musikomslag eller klistermærker op? diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 0e04da922..ce4e3c495 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -292,7 +292,7 @@ Wie kann ich ein Album immer zuoberst erscheinen lassen? Du kannst lange auf das gewünschte Album drücken und im Aktionsmenü das Stecknadelsymbol auswählen; es wird nun zuoberst angepinnt. Ebenso kannst du mehrere Ordner anpinnen. Angepinnte Objekte werden nach der Standardmethode sortiert. Wie kann ich in Videos vor- oder zurückspringen? - Du kannst deinen Finger horizontal über den Videoplayer ziehen oder in der Nähe der Suchleiste auf die aktuelle oder maximale Dauer klicken. Das Video wird so entweder vorwärts oder rückwärts bewegt. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Was ist der Unterschied zwischen \'Verstecken\' und \'Ausschließen\' eines Ordners? \'Ausschließen\' verhindert lediglich, dass der Ordner in Schlichte Galerie angezeigt wird. \'Verstecken\' hingegen versteckt den Ordner auch vor anderen Apps. Dies funktioniert durch das Erstellen einer leeren \".nomedia\"-Datei im betroffenen Ordner, welche du mit jedem Dateimanager wieder löschen kannst. Wieso erscheinen Ordner mit Musik-Cover oder Stickers? diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index aa1793702..205ace50f 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -292,8 +292,8 @@ Υπάρχουν 2 λύσεις. Είτε επανεγκατάσταση της εφαρμογής, ή να εντοπίσετε την εφαρμογή στις ρυθμίσεις της συσκευής και να επιλέξετε \"Καθαρισμό δεδομένων\". Θα επαναφέρει όλες τις ρυθμίσεις και δεν θα σβήσει κάποιο αρχείο πολυμέσου. Πώς μπορώ να κάνω ένα άλμπουμ να φαίνεται στην κορυφή; Μπορείτε να πατήσετε παρατεταμένα στο άλμπουμ και να επιλέξετε το εικονίδιο καρφιτσώματος στο μενού, αυτό θα το καρφιτσώσει στην κορυφή. Επίσης μπορείτε να καρφιτσώσετε πολλαπλούς φακέλους, τα καρφιτσωμένα αντικείμενα θα είναι ταξινομημένα με την προεπιλεγμένη μέθοδο. - Πώς μπορώ να τρέξω μπροστά (fast-forward) τα βίντεο; - Μπορείτε είτε να σύρετε το δάχτυλό σας οριζόντια πάνω από το πρόγραμμα αναπαραγωγής Βίντεο ή να κάνετε κλικ στα γράμματα της τρέχουσας ή της μέγιστης διάρκειας κοντά στο Γραμμή Αναζήτησης. Αυτό θα μετακινήσει το βίντεο προς τα πίσω ή προς τα εμπρός. + Πώς μπορώ να τρέξω μπροστά (fast forward) τα βίντεο; + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Ποια είναι διαφορά μεταξύ απόκρυψης και εξαίρεσης ενός φακέλου; Η εξαίρεση δεν επιτρέπει την εμφάνιση του φακέλου μόνο στην Απλή Συλλογή, ενώ η απόκρυψη λειτουργεί σε επίπεδο συστήματος και θα αποκρύψει τον φάκελο και από άλλες εφαρμογές γκάλερι. Λειτουργεί δημιουργώντας ένα άδειο \".nomedia\" αρχείο στον επιλεγμένο φάκελο, το οποίο μπορείτε να το διαγράψετε και με οποιονδήποτε διαχειριστή αρχείων. Γιατί εμφανίζονται φάκελοι με εξώφυλλο μουσικής ή αυτόκολλητα; diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f64c4896c..486a0ec65 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -292,7 +292,7 @@ ¿Cómo puedo hacer que un álbum siempre aparezca en la parte superior? Puede aguantar pulsado el álbum deseado y seleccionar el ícono Pin en el menú de acción, que lo fijará en la parte superior. También puede anclar varias carpetas, los artículos fijados se ordenarán por el método de clasificación predeterminado. ¿Cómo puedo avanzar videos? - Puede arrastrar el dedo horizontalmente sobre el reproductor de video, o hacer clic en los textos de duración actual o máxima cerca de la barra de búsqueda, que moverán el video hacia atrás o hacia adelante. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. ¿Cuál es la diferencia entre ocultar y excluir una carpeta? Excluir evita mostrar la carpeta solo en Simple Gallery, mientras que Ocultar funciona en el sistema y oculta la carpeta de otras galerías también. Funciona al crear un archivo \".nomedia \" vacío en la carpeta determinada, que luego puede eliminar también con cualquier administrador de archivos. ¿Por qué aparecen las carpetas con la portada de la música o las pegatinas? diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index ec6c7a99e..08e769e2f 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2f372892e..634295785 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -291,7 +291,7 @@ Comment faire pour qu\'un album soit toujours affiché tout en haut ? Vous devez simplement à effectuer un appui prolongé sur l\'album en question et choisir l\'icône \"Épingler\" dans le menu d\'actions. Vous pouvez en épingler plusieurs. Les éléments épinglés seront alors triés selon l\'ordre par défaut. Comment avancer rapidement dans les vidéos ? - Vous pouvez soit faire glisser votre doigt horizontalement sur le lecteur vidéo, soit cliquer sur le texte en cours ou la durée maximale près de la barre de recherche. Cela déplacera la vidéo vers l\'arrière ou vers l\'avant. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Quelle est la différence entre cacher et exclure un dossier ? \"Exclure un dossier\" permet de ne pas l\'afficher uniquement dans Simple Gallery, alors que \"Cacher un dossier\" rend le dossier invisible sur l\'ensemble de l\'appareil, y compris les autres applications de galerie. Dans le dernier cas, un fichier \".nomedia\" est créé dans le dossier caché, et peut être supprimé avec n\'importe quel explorateur de fichiers. Pourquoi des dossiers avec des pochettes d\'albums musicaux ou des miniatures d\'images sont affichés ? diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index dc9b48aa7..a07cc170a 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -292,7 +292,7 @@ Cómo podo facer que un álbume apareza sempre arriba de todo? Pode manter premido o álbume e escoller a icona de Fixar no menú de accións, esto fixarao arriba. Pode fixar varios cartafoles tambén, os elementos fixados estarán ordenados polo criterio por omisión. Cómo podo aumentar a velocidade de reprodución de vídeo? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Cal é a diferenza entre agochar e excluír un cartafol? A Exclusión prevén que se mostre o cartafol só en Simple Gallery, mentras Agochar funciona para todo o sistema e agocha o cartafol para outras galerías tamén. Esto funciona creando un ficheiro baldeiro de nome \".nomedia\" no cartafol, que tamén pode quitar con calquer xestor de ficheiros. Por qué aparecen cartafoles de música con portadas ou pegatinas? diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index ebb3c745c..05754191b 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -292,7 +292,7 @@ Kako postići da je album uvijek na vrhu? Dugo pritisnute željeni album i odaberite ikonu igle na akcijskom izborniku, koji će ga pričvrstiti na vrh. Možete prikvačiti više mapa odjednom, prikvačene stavke će biti razvrstane prema zadanom načinu razvrstavanja. Kako mogu ubrzati video? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Koja je razlika između skrivanja i izuzimanja mape? Izuzimanje sprječava prikaz mape samo u Jednostavnoj galeriji, a skrivanje radi na razini sustava i skriva mapu iz drugih galerija. Djeluje stvaranjem praznih \".nomedia\" datoteka u zadanoj mapi, koju možete ukloniti pomoću bilo kojeg upraviteljem datoteka. Zašto se prikazuju mape s naslovnicama albuma i minijaturama slika? diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index b052836be..5a4befa5f 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -295,7 +295,7 @@ A következő alkalommal, amikor megpróbál megnyitni egy képet vagy videót, Hogyan állíthatok be egy albumot úgy, hogy mindig felül legyen? Hosszan nyomja meg a kívánt albumot, és válassza ki a Kitűzés ikont a művelet menüben, ami rögzíti felülre. Többféle mappát is kitűzhet, ezeket az elemeket az alapértelmezett rendezési mód szerint rendezi. Hogyan tudom előre tekerni a videókat? - Húzhatja az ujját vízszintesen a videolejátszón, vagy kattintson az aktuális vagy a max. időtartam szövegekre a keresősáv közelében. Ez visszafelé vagy előre mozgatja a videót. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Mi a különbség a mappa elrejtése és kizárása között? A Kizárás megakadályozza, hogy a mappát a Simple Gallery megjelenítse, az Elrejtés pedig rendszer szinten működik, és elrejti a mappát más galériákból is. Úgy működik, hogy létrehoz egy üres \". nomedia\" nevű fájlt az adott mappában, amelyet bármikor eltávolíthat bármilyen fájlkezelővel is. Miért jelennek meg a zenei borítóval vagy matricával rendelkező mappák? diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 6536c8373..9260359f5 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -292,7 +292,7 @@ Bagaimana agar album selalu muncul paling atas di dalam daftar? Anda bisa menekan lama album tersebut dan pilih ikon Pin di menu tindakan, hal tersebut akan membuat album tetap berada di bagian paling atas daftar. Anda juga bisa menyematkan beberapa folder, item yang di-pin akan diurutkan berdasarkan metode urutan default. Bagaimana cara mempercepat laju video? - Anda bisa menyeret jari anda secara horizontal pada pemutar video, atau klik pada teks durasi saat ini atau maks dekat bilah laju. Hal tersebut akan memundurkan atau memajukan laju video. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Apa perbedaan antara menyembunyikan dan mengecualikan folder? Mengecualikan tidak akan menampilkan folder di Simple Gallery saja, sedangkan Sembunyikan bekerja sesuai aturan sistem dan akan menyembunyikan folder dari aplikasi galeri yang lain. Cara kerjanya dengan membuat berkas \".nomedia\" kosong pada folder yang diinginkan, yang bisa anda hapus juga dengan aplikasi pengelola berkas. Mengapa folder dengan gambar album musik atau stiker muncul? diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 21a731990..a132752bd 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -292,7 +292,7 @@ Bagaimana agar album selalu muncul paling atas di dalam daftar? Anda bisa menekan lama album tersebut dan pilih ikon Pin di menu tindakan, hal tersebut akan membuat album tetap berada di bagian paling atas daftar. Anda juga bisa menyematkan beberapa folder, item yang di-pin akan diurutkan berdasarkan metode urutan default. Bagaimana cara mempercepat laju video? - Anda bisa menyeret jari anda secara horizontal pada pemutar video, atau klik pada teks durasi saat ini atau maks dekat bilah laju. Hal tersebut akan memundurkan atau memajukan laju video. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Apa perbedaan antara menyembunyikan dan mengecualikan folder? Mengecualikan tidak akan menampilkan folder di Simple Gallery saja, sedangkan Sembunyikan bekerja sesuai aturan sistem dan akan menyembunyikan folder dari aplikasi galeri yang lain. Cara kerjanya dengan membuat berkas \".nomedia\" kosong pada folder yang diinginkan, yang bisa anda hapus juga dengan aplikasi pengelola berkas. Mengapa folder dengan gambar album musik atau stiker muncul? diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 34eb9b92c..30a80d7cd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -292,7 +292,7 @@ Come posso fare apparire un album sempre in cima? Si può toccare a lungo l\'album desiderato e selezionare l\'icona puntina nel menù azioni, ciò lo fisserà in cima. Si possono anche fissare varie cartelle, gli elementi fissati saranno ordinati dal metodo di ordinamento predefinito. Come avanzo velocemente nei video? - Si possono trascinare le proprie dita orrizontalmente sul video, oppure cliccando i testi accanto alla barra di avanzamento. In questo modo il video andrà avanti o indietro. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Che differenza c\'è tra nascondere ed escludere una cartella? Escludere impedisce la visualizzazione della cartella solo in Semplice Galleria, mentre nascondere ha effetto in tutto il sistema e nasconde la cartella anche alle altre gallerie. Funziona creando un file vuoto \".nomedia\" nella cartella in questione, si possono anche rimuovere successivamente con qualsiasi gestore dei file. Perchè vengono mostrate cartelle con copertine o adesivi di musica? diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f35577c8c..210e3eb79 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -292,7 +292,7 @@ How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. 動画を早送りするにはどうすればよいですか? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index bf2c14a64..f20bfe470 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 7a8138d85..2dfd8336a 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -292,7 +292,7 @@ Kaip aš galiu padaryti albumą visada rodomą viršuje? Galite ilgai paspausti norimą albumą ir pasirinkti "Prisegti" piktogramą, esančią meniu "Veiksmo meniu", viršuje. Galite prisegti kelis aplankus, prisegti elementai bus rūšiuojami pagal numatytąjį rūšiavimo metodą. Kaip galėčiau greitai prasukti vaizdo įrašus? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Koks skirtumas tarp slėpimo ir išskyrimo iš aplanko? Išskyrimas neleidžia rodyti aplanko tik paprastoje galerijoje, tuo tarpu slėpimas slepia aplanką iš kitų galerijų. Tai veikia, sukuriant tuščią \ ". Nomedia \" bylą tam tikrame aplanke, kurį vėliau galite pašalinti bet kuria bylų tvarkykle. Kodėl pasirodo aplankai su muzikos viršeliu ar lipdukais? diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index e28349369..753550269 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 68e3e162f..0042c3ff4 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 922dd0b3f..7c0fceed6 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -292,7 +292,7 @@ Hoe kan ik een map bovenaan vastzetten? Druk lang op het map en kies vervolgens de punaise in het actiemenu. Als er meerdere mappen zijn vastgezet, zullen deze worden weergeven op basis van de standaardsortering. Hoe kan ik terug- of vooruitspoelen in video’s? - Sleep horizontaal over de videospeler, of klik bij de zoekbalk op de cijfers die de huidige voortgang of de lengte weergeven. Hierbij zal de video respectievelijk terug- of vooruitspringen. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Wat is het verschil tussen het verbergen en het uitsluiten van mappen? Met \"Uitsluiten\" wordt het tonen van de map alleen binnen deze app voorkomen, terwijl \"Verbergen\" de map ook zal verbergen voor andere galerij-apps. Met \"Verbergen\" wordt een bestand genaamd \".nomedia\" in de te verbergen map aangemaakt (het verwijderen van dit bestand uit de map maakt het verbergen ongedaan). Waarom zie ik mappen met stickers of covers van muziekalbums? diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 62cbd7aad..100bb5c3b 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -291,7 +291,7 @@ Jak sprawić, aby album(y) zawsze pojawiał(y) się na górze? Przytrzymaj album(y) i wybierz ikonę przypięcia w pasku akcji. Jak mogę przwijać filmy? - Na dwa sposoby: albo przeciągając poziomo palcem po filmie, albo klikając obecny (przewinięcie do tyłu) lub całkowity czas trwania (do przodu). + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Jaka jest różnica między ukryciem, a wykluczeniem folderu? Wykluczenie działa tylko w obrębie niniejszej aplikacji (wszędzie indziej pliki są normalnie widoczne), ukrywanie - w obrębie całego systemu (nie widać ich nigdzie), dodawany jest wtedy do folderu pusty plik \'.nomedia\', który możesz usunąć w dowolnym menedżerze plików. Dlaczego pokazują mi się foldery z okładkami do piosenek i tym podobne rzeczy? diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index f88bb0472..f69dcfe08 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -291,8 +291,8 @@ Você pode resolver isto de duas formas. Você pode reinstalar o aplicativo ou ir nas configurações do seu dispositivo e selecionar a opção "Limpar armazenamento". Isto irá redefinir todas as suas configurações, não removerá nenhum arquivo de mídia. O que posso fazer para que uma pasta sempre apareça no topo da lista? Faça um toque longo na pasta em questão, e depois toque no ícone de alfinete na parte superior da tela, isto irá fixá-la no topo. Você também pode fixar várias pastas; os itens fixados serão classificados pelo método de ordenação padrão. - Como faço para avançar rapidamente um vídeo (fast-forward)? - Você pode fazer um gesto horizontal como dedo, ou tocar nos números de tempo atual ou tempo total do vídeo, que se encontram próximos à barra de posicionamento. + Como faço para avançar rapidamente um vídeo (fast forward)? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Qual é a diferença entre ocultar e ignorar uma pasta? Ignorar deixa de exibir a pasta apenas no Simple Galeria, enquanto Ocultar afeta todo o sistema e pode ocultar pastas de outras galerias também. A função ocultar funciona adicionando um arquivo vazio chamado \".nomedia\" na pasta em questão, arquivo este você também pode excluir com um gerenciador de arquivos, se quiser. Porque pastas com capas de CD de música ou figurinhas aparecem na lista? diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d5bd52983..c1d226674 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 66cd4eeff..f006f3a6b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -292,7 +292,7 @@ Как я могу сделать альбом всегда отображающимся сверху? Вы можете длительным нажатием на желаемый альбом открыть меню действий в нём выбрать пункт \"Закрепить\". Можно закрепить несколько альбомов (папок); прикреплённые элементы будут отсортированы по методу сортировки по умолчанию. Как ускорить перемотку видео? - Вы можете либо перемещать пальцем по горизонтали над видеопроигрывателем, либо нажать на цифры текущего положения или максимальной длительности видео рядом с панелью поиска, что приведёт к перемещению позиции воспроизведения назад или вперёд. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. В чём разница между скрытием и исключением папки? Исключение запрещает отображение папки только в Simple Gallery, в то время как скрытие работает системно и скрывает папку из других галерей. Это достигается путём создания пустого файла \".nomedia\" в данной папке, который впоследствии можно удалить любым файловым менеджером. Почему отображаются папки с музыкальными обложками? diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 565448a00..5a4667b57 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -182,7 +182,7 @@ Zobraziť odpadkový kôš ako poslednú položku na hlavnej obrazovke Povoliť zatváranie celoobrazovkového režimu potiahnutím prsta dole Povoliť 1:1 priblíženie dvojnásobným dvojklikom - Vždy otvárať videá na vlastnej obrazovke s novými vodorovnými gestami + Vždy otvárať videá na novej obrazovke s novými vodorovnými gestami Zobraziť výrez obrazovky, ak je dostupný Povoliť otáčanie obrázkov gestami Priorita pri načítavaní súborov @@ -291,8 +291,8 @@ Viete to vyriešǐť 2 spôsobmi. Môžete apku buď preinštalovať, alebo ju nájsť v nastaveniach zariadenia a zvoliť \"Vymazať údaje\". Vymaže to iba nastavenia, nie súbory. Ako môžem dosiahnuť, aby bol daný album stále zobrazený prvý? Môžete označiť daný priečinok dlhým podržaním a zvoliť tlačidlo s obrázkom pripinačky, to ho pripne na vrch. Môžete pripnúť aj viacero priečinkov, budú zoradené podľa zvoleného radenia. - Ako viem posunúť video vpred? - Môžete to dosiahnuť vodorovným potiahnutím prsta cez video prehrávač, alebo kliknúť na texty súčasnej, alebo maximálnej dĺžky videa, ktoré sú vedľa indikátora súčasného progresu. To posunie video buď vpred, alebo vzad. + Ako viem posunúť video rýchlo vpred? + Viete to dosiahnuť dvojitým kliknutím na boky obrazovky, alebo kliknutím na texty súčasnej, alebo maximálnej dĺžky videa, ktoré sú vedľa indikátora súčasného progresu. Ak v nastaveniach apky zapnete možnosť spúšťania videí na novej obrazovke, budete môcť použiť aj vodorovné gestá. Aký je rozdiel medzi Skrytím a Vylúčením priečinka? Kým vylúčenie predíde zobrazeniu priečinka iba vrámci Jednoduchej Galérie, skrytie ho ukryje vrámci celého systému, teda to ovplyvní aj ostatné galérie. Skrytie funguje pomocou vytvorenia prázdneho \".nomedia\" súboru v danom priečinku, ktorý viete vymazať aj nejakým správcom súborov. Prečo sa mi zobrazujú priečinky s obalmi hudobných albumov, alebo nálepkami? diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index 58c3230db..ec48ba0e4 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -292,7 +292,7 @@ Kako nastaviti, da se določen album vedno prikaže na vrhu? Z dolgim pritiskom na album se vam prikaže meni, v katerem je na voljo bucika, s katero pripnete album na željeno mesto. Na ta način lahko pripnete več albumov, ki bodo razvrščeni v skladu s privzetim načinom razvrščanja. Ali lahko hitro predvajam videoposnetke? - To lahko storite tako, da s prstom vodoravno potegnete čez predvajalnik ali kliknete na izpis trenutnega oz. skupnega trajanja, kar bo videoposnetek premaknilo naprej ali nazaj. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Kakšna je razlika med skrivanjem in izključevanjem mape? Izključevanje mape jo skrije le v Simple galeriji, medtem ko jo skrivanje skrije tudi v ostalih aplikacijah oz. galerijah. Deluje tako, da kreira prazno \".nomedia\" datoteko v izbrani mapi, katero lahko odstranite tudi s katerimkoli urejevalnikom datotek. Zakaj se v galeriji prikažejo datoteke z naslovnicami glasbenih map ali nalepk? diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 0a5ab8092..765aed483 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -292,7 +292,7 @@ Како да подесим да се неки албум увек појављује на врху? Дуго притисните на жељени албум и изаберите Закачи икону у менију за акције, то ће га поставити на врх. Можете да закачите више фасцикли истовремено, с тим што ће бити сортирани према подразумевајућем методу за сортирање. Како да премотавам видео снимке? - Можете да вучете прст хоризонтално преко видео плејера, или да кликнете на тренутно или максимално поред траке за премотавање. То ће премотати видео назад или напред. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Која је разлика између скривања и изузимања фасцикле? Изузимање спречава приказивање фасцикле само у Једноставној галерији, док се скривање односи на цео систем и скрива фасциклу од свих других галерија. Он функционише тако што прави празан \".nomedia\" фајл у задатој фасцикли, који затим можете да уклоните са било којим фајл менаџером. Зашто се фасцикле са сликама музичких извођача или налепницама приказују? diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index a0cf7883a..74d6f1c1d 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar, that will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index f04d9abc6..c2a1d8d30 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -292,7 +292,7 @@ Bir albümün her zaman en üstte görünmesini nasıl sağlayabilirim? İstediğiniz albüme uzunca basabilir ve eylem menüsündeki Sabitle simgesini seçebilirsiniz. Birden çok klasörü de sabitleyebilirsiniz, sabitlenmiş öğeler varsayılan sıralama yöntemine göre sıralanır. Videoları nasıl hızlıca ileri sarabilirim? - Parmağınızı video oynatıcı üzerinde yatay olarak sürükleyebilir veya videoyu ileri veya geri hareket ettirecek arama çubuğunun yanındaki geçerli veya maksimum süre metinlerine tıklayabilirsiniz. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Klasörün gizlenmesi ve hariç tutulması arasındaki fark nedir? Hariç tut, klasörü yalnızca Basit Galeri\'de görüntülemeyi engellerken, Gizle sistem genelinde çalışır ve klasörü diğer galerilerden de gizler. Verilen klasörde boş bir \".nomedia\" dosyası oluşturarak çalışır, daha sonra herhangi bir dosya yöneticisi ile kaldırabilirsiniz. Neden albüm resimlerini içeren klasörler görünüyor? diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index b30d57e3f..c9011b067 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -292,7 +292,7 @@ Як зробити альбом завжди доступним у верхній частині? Ви можете виконати довге натискання на бажаному альбомі і вибрати піктограму \"Закріпити\" у меню дій, що закріпить його вгорі. Ви також можете закріпити декілька тек; закріплені елементи будуть відсортовані за методом сортування за-замовчуванням. Як я можу швидко прокручувати відео? - Ви можете або провести пальцем горизонтально під час відтворення відео, або натиснути на текст поточної або максимальної тривалості відео біля прогрес-бару, що прокрутить відео або назад, або вперед. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. В чому полягає різниця між приховуванням та виключенням теки? \"Виключити\" запобігає відображенню теки тільки в додатку Simple Gallery, в той час як \"Приховати\" працює на системному рівні і приховує теку і в інших галереях також. Це здійснюється шляхом створення порожнього файлу \".nomedia\" в заданій теці, який може бути видалений пізніше будь-яким файловим менеджером. Чому відображаються теки з музичними обкладинками або стікерами? diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index f35990c78..6ea39803d 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -292,7 +292,7 @@ Làm thế nào tôi có thể làm cho một album luôn xuất hiện ở đầu? Bạn có thể nhấn và giữ album mong muốn và chọn biểu tượng Ghim ở menu hành động, nó sẽ ghim nó lên trên cùng. Bạn cũng có thể ghim nhiều thư mục, các mục được ghim sẽ được sắp xếp theo phương pháp sắp xếp mặc định. Làm cách nào tôi có tua video nhanh? - Bạn có thể kéo ngón tay của mình theo chiều ngang trên trình phát video hoặc nhấp vào văn bản thời lượng hiện tại hoặc tối đa gần thanh tìm kiếm. Điều đó sẽ di chuyển video hoặc lùi hoặc tiến. + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. Sự khác biệt giữa ẩn và loại trừ một thư mục là gì? Loại trừ ngăn chỉ hiển thị thư mục trong Thư viện đơn giản, trong khi Ẩn hoạt động theo hệ thống và nó cũng ẩn thư mục khỏi các phòng trưng bày khác. Nó hoạt động bằng cách tạo một tệp \".nomedia\" trong thư mục đã cho, sau đó bạn cũng có thể xóa bằng bất kỳ trình quản lý tệp nào. Tại sao hiển thị các thư mục với ảnh bìa hoặc nhãn dán? diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d2c68ffe9..f2aceeda6 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -291,7 +291,7 @@ 如何让某个相册始终显示在最上面? 你可以长按该相册并在操作栏中点击图钉图标,这样 就可以将其固定在顶部了。你也可以固定多个文件夹,固定项目将按照默认排序方法排序。 如何快进/快退视频? - 只需在视频播放器上左右滑动,或点击底栏进度条两侧的时间文本,即可前进或后退视频。 + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. 文件夹的隐藏和排除有什么区别? 排除功能只是防止其在简约图库中显示,而隐藏功能则使用的是系统的方法,这样做也会在其他图库中隐藏。它的工作原理是在给定的文件夹中创建一个空的.nomedia文件,你可以使用任何文件管理器删除它。 为什么会出现音乐艺术家封面或贴纸文件夹? diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 037f78856..7373e776e 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -292,7 +292,7 @@ 我如何讓某個相冊總是出現在頂端? 你可以長按想要的相冊,然後在操作選單中選擇[圖釘]圖示,就會釘選於頂端。你也能釘選多個資料夾,釘選的項目會依預設的排序方法來排序。 我如何快轉影片? - 你可以在影片播放器上水平滑動你的手指,或者點擊進度條附近的當前或總時長文字。這會使影片快轉或倒轉。 + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. 隱藏和排除資料夾,兩者有什麼不同? [排除]只在簡易相簿中避免顯示出來;而[隱藏]則作用於整個系統,資料夾也會被其他相簿隱藏。這是藉由在指定資料夾內建立一個\".nomedia\"空白檔案來進行隱藏,你之後也能用任何檔案管理器移除。 為什麼有些音樂專輯封面或貼圖的資料夾會出現? diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f28bde093..112af1601 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -292,7 +292,7 @@ 我如何讓某個相冊總是出現在頂端? 你可以長按想要的相冊,然後在操作選單中選擇[圖釘]圖示,就會釘選於頂端。你也能釘選多個資料夾,釘選的項目會依預設的排序方法來排序。 我如何快轉影片? - 你可以在影片播放器上水平滑動你的手指,或者點擊進度條附近的當前或總時長文字。這會使影片快轉或倒轉。 + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. 隱藏和排除資料夾,兩者有什麼不同? [排除]只在簡易相簿中避免顯示出來;而[隱藏]則作用於整個系統,資料夾也會被其他相簿隱藏。這是藉由在指定資料夾內建立一個\".nomedia\"空白檔案來進行隱藏,你之後也能用任何檔案管理器移除。 為什麼有些音樂專輯封面或貼圖的資料夾會出現? diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e8c6d123..f17067c6d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -291,8 +291,8 @@ You can solve it in 2 ways. You can either reinstall the app, or find the app in your device settings and select \"Clear data\". It will reset all your settings, it will not remove any media files. How can I make an album always appear at the top? You can long press the desired album and select the Pin icon at the actions menu, that will pin it to the top. You can pin multiple folders too, pinned items will be sorted by the default sorting method. - How can I fast-forward videos? - You can either drag your finger horizontally over the video player, or click on the current or max duration texts near the seekbar. That will move the video either backward, or forward. + How can I fast forward videos? + You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. What is the difference between hiding and excluding a folder? Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. Why do folders with music cover art or stickers show up? From b2da6f50806b20fb0c253f5af06845d643b08b0e Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Feb 2020 12:04:16 +0100 Subject: [PATCH 95/98] skip by 10s at clicking on the curr/max video durations too --- .../gallery/pro/activities/VideoPlayerActivity.kt | 15 +++++++-------- .../gallery/pro/fragments/VideoFragment.kt | 15 +++++++-------- .../gallery/pro/helpers/Constants.kt | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index 6b08ef6c3..eb13b4cf0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -195,13 +195,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen video_brightness_controller.initialize(this, slide_info, true, video_player_holder, singleTap = { x, y -> toggleFullscreen() }, doubleTap = {x, y -> - doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + doSkip(false) }) video_volume_controller.initialize(this, slide_info, false, video_player_holder, singleTap = { x, y -> toggleFullscreen() }, doubleTap = {x, y -> - doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + doSkip(true) }) } else { video_brightness_controller.beGone() @@ -307,8 +307,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen private fun handleDoubleTap(x: Float) { val instantWidth = mScreenWidth / 7 when { - x <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) - x >= mScreenWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + x <= instantWidth -> doSkip(false) + x >= mScreenWidth - instantWidth -> doSkip(true) else -> togglePlayPause() } } @@ -501,13 +501,12 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen return } - val twoPercents = Math.max((mExoPlayer!!.duration / 50).toInt(), MIN_SKIP_LENGTH) - doSkip(twoPercents, forward) + doSkip(forward) } - private fun doSkip(millis: Int, forward: Boolean) { + private fun doSkip(forward: Boolean) { val curr = mExoPlayer!!.currentPosition - val newProgress = if (forward) curr + millis else curr - millis + val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS val roundProgress = Math.round(newProgress / 1000f) val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt() / 1000, roundProgress), 0) setPosition(limitedProgress) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index 8d7557fd3..ab8f93529 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -207,7 +207,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S toggleFullscreen() } }, doubleTap = {x, y -> - doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) + doSkip(false) }) mVolumeSideScroll.initialize(activity!!, slide_info, false, container, singleTap = { x, y -> @@ -217,7 +217,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S toggleFullscreen() } }, doubleTap = {x, y -> - doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + doSkip(true) }) video_surface.onGlobalLayout { @@ -431,8 +431,8 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S val viewWidth = mView.width val instantWidth = viewWidth / 7 when { - x <= instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, false) - x >= viewWidth - instantWidth -> doSkip(DOUBLE_TAP_SKIP_VIDEO_MS, true) + x <= instantWidth -> doSkip(false) + x >= viewWidth - instantWidth -> doSkip(true) else -> togglePlayPause() } } @@ -542,13 +542,12 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } mPositionAtPause = 0L - val twoPercents = Math.max((mExoPlayer!!.duration / 50).toInt(), MIN_SKIP_LENGTH) - doSkip(twoPercents, forward) + doSkip(forward) } - private fun doSkip(millis: Int, forward: Boolean) { + private fun doSkip(forward: Boolean) { val curr = mExoPlayer!!.currentPosition - val newProgress = if (forward) curr + millis else curr - millis + val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS val roundProgress = Math.round(newProgress / 1000f) val limitedProgress = Math.max(Math.min(mExoPlayer!!.duration.toInt() / 1000, roundProgress), 0) setPosition(limitedProgress) 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 78f8b8043..5604bba2a 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 @@ -118,7 +118,7 @@ const val MONTH_MILLISECONDS = MONTH_SECONDS * 1000L const val MIN_SKIP_LENGTH = 2000 const val HIDE_SYSTEM_UI_DELAY = 500L const val MAX_PRINT_SIDE_SIZE = 4096 -const val DOUBLE_TAP_SKIP_VIDEO_MS = 10000 +const val FAST_FORWARD_VIDEO_MS = 10000 const val DIRECTORY = "directory" const val MEDIUM = "medium" From f187a36ebb8e5d0d34364c235c3b097b6ff48e15 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Feb 2020 12:11:38 +0100 Subject: [PATCH 96/98] shortening some code --- .../gallery/pro/activities/VideoPlayerActivity.kt | 10 ++++------ .../gallery/pro/fragments/VideoFragment.kt | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index eb13b4cf0..a432ca076 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -194,13 +194,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen if (config.allowVideoGestures) { video_brightness_controller.initialize(this, slide_info, true, video_player_holder, singleTap = { x, y -> toggleFullscreen() - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(false) }) video_volume_controller.initialize(this, slide_info, false, video_player_holder, singleTap = { x, y -> toggleFullscreen() - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(true) }) } else { @@ -497,11 +497,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } private fun skip(forward: Boolean) { - if (mExoPlayer == null) { - return + if (mExoPlayer != null) { + doSkip(forward) } - - doSkip(forward) } private fun doSkip(forward: Boolean) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index ab8f93529..3944ceabb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -206,7 +206,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(false) }) @@ -216,7 +216,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(true) }) From 9aab2a2a3e108a37da1f59b7a97512a354c20cdc Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 20 Feb 2020 13:09:58 +0100 Subject: [PATCH 97/98] Dutch --- app/src/main/res/values-nl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 7c0fceed6..18971b885 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -292,7 +292,7 @@ Hoe kan ik een map bovenaan vastzetten? Druk lang op het map en kies vervolgens de punaise in het actiemenu. Als er meerdere mappen zijn vastgezet, zullen deze worden weergeven op basis van de standaardsortering. Hoe kan ik terug- of vooruitspoelen in video’s? - You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. + Dubbelklik op de zijkant van het scherm, of tik op de cijfers die de voortgang of de lengte van de video weergeven om resp. terug of vooruit te springen. Als de instelling om video's in een apart scherm te openen is ingeschakeld, dan kunnen ook horizontale veeggebaren worden gebruikt. Wat is het verschil tussen het verbergen en het uitsluiten van mappen? Met \"Uitsluiten\" wordt het tonen van de map alleen binnen deze app voorkomen, terwijl \"Verbergen\" de map ook zal verbergen voor andere galerij-apps. Met \"Verbergen\" wordt een bestand genaamd \".nomedia\" in de te verbergen map aangemaakt (het verwijderen van dit bestand uit de map maakt het verbergen ongedaan). Waarom zie ik mappen met stickers of covers van muziekalbums? From 51916e07c1a25a2d5d5b9fdca327d83f393114bb Mon Sep 17 00:00:00 2001 From: spkprs Date: Thu, 20 Feb 2020 16:30:34 +0300 Subject: [PATCH 98/98] Update strings.xml --- app/src/main/res/values-el/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 205ace50f..f12f66d5a 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -293,7 +293,7 @@ Πώς μπορώ να κάνω ένα άλμπουμ να φαίνεται στην κορυφή; Μπορείτε να πατήσετε παρατεταμένα στο άλμπουμ και να επιλέξετε το εικονίδιο καρφιτσώματος στο μενού, αυτό θα το καρφιτσώσει στην κορυφή. Επίσης μπορείτε να καρφιτσώσετε πολλαπλούς φακέλους, τα καρφιτσωμένα αντικείμενα θα είναι ταξινομημένα με την προεπιλεγμένη μέθοδο. Πώς μπορώ να τρέξω μπροστά (fast forward) τα βίντεο; - You can do it by double tapping the side of the screen, or tapping the current or max duration texts near the seekbar. If you enable opening videos on a separate screen in the app settings, you can use horizontal gestures too. + Μπορείτε να το κάνετε πατώντας δύο φορές την πλευρά της οθόνης ή πατώντας το κείμενο τρέχοντος ή μέγιστης διάρκειας κοντά στη γραμμή αναζήτησης. Αν ενεργοποιήσετε το άνοιγμα βίντεο σε ξεχωριστή οθόνη στις ρυθμίσεις εφαρμογής, μπορείτε επίσης να χρησιμοποιήσετε και τις οριζόντιες κινήσεις. Ποια είναι διαφορά μεταξύ απόκρυψης και εξαίρεσης ενός φακέλου; Η εξαίρεση δεν επιτρέπει την εμφάνιση του φακέλου μόνο στην Απλή Συλλογή, ενώ η απόκρυψη λειτουργεί σε επίπεδο συστήματος και θα αποκρύψει τον φάκελο και από άλλες εφαρμογές γκάλερι. Λειτουργεί δημιουργώντας ένα άδειο \".nomedia\" αρχείο στον επιλεγμένο φάκελο, το οποίο μπορείτε να το διαγράψετε και με οποιονδήποτε διαχειριστή αρχείων. Γιατί εμφανίζονται φάκελοι με εξώφυλλο μουσικής ή αυτόκολλητα;