From ef23aa4d9df1e6485d83a948be8380e7108ae4c1 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sat, 28 Jul 2018 05:10:45 +0200 Subject: [PATCH 01/90] Dutch --- app/src/main/res/values-nl/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index cc848c5e3..e620f3970 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -28,9 +28,9 @@ Portretmodus forceren Landschapsmodus forceren Standaardmodus gebruiken - Fix Date Taken value - Fixing… - Dates fixed successfully + Datum opname corrigeren + Corrigeren… + Datums zijn gecorrigeerd Media filteren From 74e6dc8a9720d1059ab70f8eda2a7e6c842983d1 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Sun, 29 Jul 2018 15:53:49 +0200 Subject: [PATCH 02/90] PL translation update [2018.07.29] --- app/src/main/res/values-pl/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index f6c38477f..d446b28db 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -28,9 +28,9 @@ Wymuś pionową Wymuś poziomą Używaj systemowej - Fix Date Taken value - Fixing… - Dates fixed successfully + Napraw datę utworzenia + Naprawiam… + Daty zostały naprawione Filtruj multimedia @@ -42,7 +42,7 @@ Zmień filtry - Ta funkcja ukrywa foldery, dodając do nich pusty plik .nomedia. Aby móc je zobaczyć, należy włączyć opcję \'Pokazuj ukryte foldery\' w ustawieniach. Kontynuować? + Ta funkcja ukrywa foldery, dodając do nich pusty plik \'.nomedia\'. Aby móc je zobaczyć, należy włączyć opcję \'Pokazuj ukryte foldery\' w ustawieniach. Kontynuować? Wyklucz Wykluczone foldery Zarządzaj wykluczonymi folderami @@ -53,7 +53,7 @@ Usunąć wszystkie foldery z listy wykluczonych? Foldery nie zostaną fizycznie usunięte.   Ukryte foldery    Zarządzaj ukrytymi folderami -    Zdaje się, że nie masz żadnych folderów z plikiem \".nomedia\". + Zdaje się, że nie masz żadnych folderów z plikiem \'.nomedia\'. Dołączone foldery @@ -154,7 +154,7 @@    Zezwalaj na powiększanie jednym palcem w widoku pełnoekranowym    Zezwalaj na natychmiastową zmianę multimediów po kliknięciu boków ekranu    Zamieniaj powiększalne obrazy na te o lepszej jakości -    Ukrywaj dodatkowe szczegóły gdy pasek stanu jest ukryty + Ukrywaj dodatkowe szczegóły, gdy pasek stanu jest ukryty    Dodatkowe sprawdzenie w celu uniknięcia pokazywania niewłaściwych plików Pokazuj niektóre przyciski akcji na dole ekranu Pokazuj kosz w widoku folderów @@ -182,10 +182,10 @@    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? - Aplikacja niestety nie wie, czy dane zdjęcie jest okładką od piosenki czy czymś innym. Aby ukryć niechciane rzeczy, przytrzymaj je i wybierz opcję \'Wyklucz\' z paska akcji. + Aplikacja nie wie, czy dany obraz jest okładką od piosenki czy czymś innym. Aby ukryć niechciane rzeczy, przytrzymaj je i wybierz opcję \'Wyklucz\' z paska akcji.    Nie pokazuje(-ą) mi się folder(y) ze zdjęciami / filmami. Co mogę zrobić?    Wejdź do ustawień aplikacji i w sekcji z dołączonymi folderami dodaj tenże folder do listy. -    Co jeśli chcę widzieć tylko.wybrane foldery? + Co jeśli chcę widzieć tylko wybrane foldery?    Przejdź do sekcji z wykluczonymi folderami w ustawieniach aplikacji, dodaj tam folder główny (\"/\"), a następnie dodaj pożądane foldery w sekcji z dołączonymi folderami.    Zdjęcia w widoku pełnoekranowym mają dziwne artefakty. Jak mogę to naprawić? W ustawieniach aplikacji włącz opcję \'Zamieniaj powiększalne obrazy na te o lepszej jakości\'. Poprawi ona jakość zdjęć, jednak przy bardzo dużych powiększeniach mogą się stać one zbyt rozmazane. @@ -193,8 +193,8 @@ Tak, możesz to zrobić w edytorze, przeciągając krawędzie obrazu. Edytor otworzysz przytrzymując miniaturę obrazu i wybierając opcję \'Edytuj\', bądź wybierając tą samą opcję w menu pełnoekranowym. Czy mogę jakoś grupować miniatury plików? Tak. Użyj opcji \'Grupuj według\', gdy jesteś w widoku miniatur. Grupować je możesz według wielu kryteriów, włącznie z datą ich utworzenia. Ponadto, jeśli użyjesz opcji \'Pokazuj całą zawartość folderów\', możesz je także grupować według folderów. - Sorting by Date Taken doesn\'t seem to work properly, how can I fix it? - It is most likely caused by the files being copied from somewhere. You can fix it by selecting the file thumbnails and selecting \"Fix Date Taken value\". + Sortowanie według daty utworzenia nie działa poprawnie. Dlaczego tak się dzieje i jak mogę to naprawić? + Dzieje się tak, gdyż prawdopodobnie pliki zostały skądś do urządzenia skopiowane. Naprawić to można wybierając miniatury plików, a następnie opcję \'Napraw datę utworzenia\'. From 61f1e6449d5cc5d91a0200611ae9c234b84c9a56 Mon Sep 17 00:00:00 2001 From: chris-w89 <37019071+chris-w89@users.noreply.github.com> Date: Sun, 29 Jul 2018 17:05:31 +0200 Subject: [PATCH 03/90] Update geman strings --- app/src/main/res/values-de/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 53bf36786..744c25617 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -28,9 +28,9 @@ Hochkant erzwingen Breitbild erzwingen Standard Ausrichtung benutzen - Fix Date Taken value - Fixing… - Dates fixed successfully + Aufnahmedatum reparieren + Repariere… + Datum erfolgreich repariert Filter @@ -126,7 +126,7 @@ Dateien nicht gruppieren Ordner Zuletzt geändert - Erstelldatum + Aufnahmedatum Dateityp Extension @@ -144,7 +144,7 @@ Schwarzer Hintergrund & schwarze Systemleiste im Vollbild Kacheln horizontal scrollen Systemleiste im Vollbild ausblenden - Nach Löschen leere Ordner löschen + Nach Löschen, leere Ordner löschen Fotohelligkeit mit vertikalen Gesten ändern Gesten für Videolautstärke/Helligkeit zulassen Medienanzahl bei Ordnern anzeigen From e1214b4d47e4776ca67bff5fa77aff95b7fbd272 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Jul 2018 21:54:27 +0200 Subject: [PATCH 04/90] store MediumDao and DirectoryDao globally in Main and Media activities --- .../gallery/activities/MainActivity.kt | 33 ++++++++++--------- .../gallery/activities/MediaActivity.kt | 20 +++++++---- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index b4434fc41..a31c36f8e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -33,6 +33,7 @@ import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.interfaces.DirectoryDao import com.simplemobiletools.gallery.interfaces.DirectoryOperationsListener +import com.simplemobiletools.gallery.interfaces.MediumDao import com.simplemobiletools.gallery.models.AlbumCover import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Medium @@ -73,11 +74,17 @@ 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() + config.temporarilyShowHidden = false config.tempSkipDeleteConfirmation = false mIsPickImageIntent = isPickImageIntent(intent) @@ -435,9 +442,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } Thread { - val directoryDao = galleryDB.DirectoryDao() folders.filter { !it.exists() }.forEach { - directoryDao.deleteDirPath(it.absolutePath) + mDirectoryDao.deleteDirPath(it.absolutePath) } }.start() } @@ -693,8 +699,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val albumCovers = config.parseAlbumCovers() val includedFolders = config.includedFolders val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 - val mediumDao = galleryDB.MediumDao() - val directoryDao = galleryDB.DirectoryDao() val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 val favoritePaths = getFavoritePaths() @@ -731,14 +735,14 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { // update directories and media files in the local db, delete invalid items updateDBDirectory(directory) if (!directory.isRecycleBin()) { - mediumDao.insertAll(curMedia) + mMediumDao.insertAll(curMedia) } getCachedMedia(directory.path, getVideosOnly, getImagesOnly) { it.forEach { if (!curMedia.contains(it)) { val path = (it as? Medium)?.path if (path != null) { - mediumDao.deleteMediumPath(path) + mMediumDao.deleteMediumPath(path) } } } @@ -782,9 +786,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, isSortingAscending) dirs.add(newDir) showSortedDirs(dirs) - directoryDao.insert(newDir) + mDirectoryDao.insert(newDir) if (folder != RECYCLE_BIN) { - mediumDao.insertAll(newMedia) + mMediumDao.insertAll(newMedia) } } @@ -795,7 +799,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { directories_refresh_layout.isRefreshing = false checkPlaceholderVisibility(dirs) } - checkInvalidDirectories(dirs, directoryDao) + checkInvalidDirectories(dirs) val everShownFolders = config.everShownFolders as HashSet dirs.mapTo(everShownFolders) { it.path } @@ -895,7 +899,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } } - private fun checkInvalidDirectories(dirs: ArrayList, directoryDao: DirectoryDao) { + private fun checkInvalidDirectories(dirs: ArrayList) { val invalidDirs = ArrayList() dirs.filter { !it.areFavorites() && !it.isRecycleBin() }.forEach { if (!getDoesFilePathExist(it.path)) { @@ -918,7 +922,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (config.useRecycleBin) { val binFolder = dirs.firstOrNull { it.path == RECYCLE_BIN } - if (binFolder != null && galleryDB.MediumDao().getDeletedMedia().isEmpty()) { + if (binFolder != null && mMediumDao.getDeletedMedia().isEmpty()) { invalidDirs.add(binFolder) } } @@ -927,7 +931,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { dirs.removeAll(invalidDirs) showSortedDirs(dirs) invalidDirs.forEach { - directoryDao.deleteDirPath(it.path) + mDirectoryDao.deleteDirPath(it.path) } } } @@ -971,11 +975,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun checkRecycleBinItems() { if (config.useRecycleBin) { Thread { - val mediumDao = galleryDB.MediumDao() - val deletedMedia = mediumDao.getDeletedMedia() + val deletedMedia = mMediumDao.getDeletedMedia() deletedMedia.forEach { if (System.currentTimeMillis() > it.deletedTS + MONTH_MILLISECONDS) { - mediumDao.deleteMediumPath(it.path) + mMediumDao.deleteMediumPath(it.path) } } }.start() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 5dc69d41e..50e09efaf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -39,7 +39,9 @@ import com.simplemobiletools.gallery.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.dialogs.FilterMediaDialog import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.* +import com.simplemobiletools.gallery.interfaces.DirectoryDao import com.simplemobiletools.gallery.interfaces.MediaOperationsListener +import com.simplemobiletools.gallery.interfaces.MediumDao import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.ThumbnailItem import com.simplemobiletools.gallery.models.ThumbnailSection @@ -75,6 +77,9 @@ 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() } @@ -82,6 +87,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { override fun onCreate(savedInstanceState: Bundle?) { 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) @@ -447,7 +456,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val paths = mMedia.filter { it is Medium }.map { (it as Medium).path } as ArrayList restoreRecycleBinPaths(paths) { Thread { - galleryDB.DirectoryDao().deleteDirPath(RECYCLE_BIN) + mDirectoryDao.deleteDirPath(RECYCLE_BIN) }.start() finish() } @@ -575,7 +584,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (mPath == FAVORITES) { Thread { - galleryDB.DirectoryDao().deleteDirPath(FAVORITES) + mDirectoryDao.deleteDirPath(FAVORITES) }.start() } @@ -588,7 +597,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun deleteDBDirectory() { Thread { - galleryDB.DirectoryDao().deleteDirPath(mPath) + mDirectoryDao.deleteDirPath(mPath) }.start() } @@ -815,7 +824,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { mLatestMediaDateId = getLatestMediaByDateId() if (!isFromCache) { val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium } - galleryDB.MediumDao().insertAll(mediaToInsert) + mMediumDao.insertAll(mediaToInsert) } } @@ -847,11 +856,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { mMedia.removeAll { filtered.map { it.path }.contains((it as? Medium)?.path) } Thread { - val mediumDao = galleryDB.MediumDao() val useRecycleBin = config.useRecycleBin filtered.forEach { if (!useRecycleBin) { - mediumDao.deleteMediumPath(it.path) + mMediumDao.deleteMediumPath(it.path) } } }.start() From 5ea99ab22dec109fc8930d74e5e47f447f7ad16b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Jul 2018 22:06:49 +0200 Subject: [PATCH 05/90] pass the MediumDao and DirectoryDao to some activity extension functions --- .../gallery/activities/MainActivity.kt | 10 +++++----- .../gallery/activities/MediaActivity.kt | 6 +++--- .../gallery/extensions/Activity.kt | 9 ++++----- .../gallery/extensions/Context.kt | 15 +++++++-------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index a31c36f8e..33cb4bf9c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -336,7 +336,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val getImagesOnly = mIsPickImageIntent || mIsGetImageContentIntent val getVideosOnly = mIsPickVideoIntent || mIsGetVideoContentIntent - getCachedDirectories(getVideosOnly, getImagesOnly) { + getCachedDirectories(getVideosOnly, getImagesOnly, mDirectoryDao) { gotDirectories(addTempFolderIfNeeded(it)) } } @@ -423,7 +423,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { files?.filter { it.absolutePath.isImageVideoGif() }?.mapTo(pathsToDelete) { it.absolutePath } } - movePathsInRecycleBin(pathsToDelete) { + movePathsInRecycleBin(pathsToDelete, mMediumDao) { if (it) { deleteFilteredFolders(fileDirItems, folders) } else { @@ -733,11 +733,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { showSortedDirs(dirs) // update directories and media files in the local db, delete invalid items - updateDBDirectory(directory) + updateDBDirectory(directory, mDirectoryDao) if (!directory.isRecycleBin()) { mMediumDao.insertAll(curMedia) } - getCachedMedia(directory.path, getVideosOnly, getImagesOnly) { + getCachedMedia(directory.path, getVideosOnly, getImagesOnly, mMediumDao) { it.forEach { if (!curMedia.contains(it)) { val path = (it as? Medium)?.path @@ -997,7 +997,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { override fun updateDirectories(directories: ArrayList) { Thread { - storeDirectoryItems(directories) + storeDirectoryItems(directories, mDirectoryDao) removeInvalidDBDirectories() }.start() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 50e09efaf..28cea3331 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -454,7 +454,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun restoreAllFiles() { val paths = mMedia.filter { it is Medium }.map { (it as Medium).path } as ArrayList - restoreRecycleBinPaths(paths) { + restoreRecycleBinPaths(paths, mMediumDao) { Thread { mDirectoryDao.deleteDirPath(RECYCLE_BIN) }.start() @@ -546,7 +546,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { mIsGettingMedia = true if (!mLoadedInitialPhotos) { - getCachedMedia(mPath, mIsGetVideoIntent, mIsGetImageIntent) { + getCachedMedia(mPath, mIsGetVideoIntent, mIsGetImageIntent, mMediumDao) { if (it.isEmpty()) { runOnUiThread { media_refresh_layout.isRefreshing = true @@ -834,7 +834,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { toast(deletingItems) if (config.useRecycleBin && !filtered.first().path.startsWith(filesDir.absolutePath)) { - movePathsInRecycleBin(filtered.map { it.path } as ArrayList) { + movePathsInRecycleBin(filtered.map { it.path } as ArrayList, mMediumDao) { if (it) { deleteFilteredFiles(filtered) } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index 7ea8421e2..a8820e8cd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -16,6 +16,7 @@ import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.dialogs.PickDirectoryDialog import com.simplemobiletools.gallery.helpers.NOMEDIA +import com.simplemobiletools.gallery.interfaces.MediumDao import java.io.File import java.io.InputStream import java.io.OutputStream @@ -200,9 +201,8 @@ fun BaseSimpleActivity.tryDeleteFileDirItem(fileDirItem: FileDirItem, allowDelet } } -fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, callback: ((wasSuccess: Boolean) -> Unit)?) { +fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, mediumDao: MediumDao = galleryDB.MediumDao(), callback: ((wasSuccess: Boolean) -> Unit)?) { Thread { - val mediumDao = galleryDB.MediumDao() var pathsCnt = paths.size paths.forEach { val file = File(it) @@ -220,12 +220,11 @@ fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, callback: } fun BaseSimpleActivity.restoreRecycleBinPath(path: String, callback: () -> Unit) { - restoreRecycleBinPaths(arrayListOf(path), callback) + restoreRecycleBinPaths(arrayListOf(path), galleryDB.MediumDao(), callback) } -fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, callback: () -> Unit) { +fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, mediumDao: MediumDao = galleryDB.MediumDao(), callback: () -> Unit) { Thread { - val mediumDao = galleryDB.MediumDao() paths.forEach { val source = it val destination = it.removePrefix(filesDir.absolutePath) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 5fc78e20e..5a768e1be 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -181,9 +181,9 @@ fun Context.rescanFolderMediaSync(path: String) { } } -fun Context.storeDirectoryItems(items: ArrayList) { +fun Context.storeDirectoryItems(items: ArrayList, directoryDao: DirectoryDao) { Thread { - galleryDB.DirectoryDao().insertAll(items) + directoryDao.insertAll(items) }.start() } @@ -280,9 +280,8 @@ fun Context.loadJpg(path: String, target: MySquareImageView, cropThumbnails: Boo builder.apply(options).transition(DrawableTransitionOptions.withCrossFade()).into(target) } -fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList) -> Unit) { +fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, directoryDao: DirectoryDao = galleryDB.DirectoryDao(), callback: (ArrayList) -> Unit) { Thread { - val directoryDao = galleryDB.DirectoryDao() val directories = try { directoryDao.getAll() as ArrayList } catch (e: SQLiteException) { @@ -326,10 +325,10 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: }.start() } -fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList) -> Unit) { +fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, mediumDao: MediumDao = galleryDB.MediumDao(), + callback: (ArrayList) -> Unit) { Thread { val mediaFetcher = MediaFetcher(this) - val mediumDao = galleryDB.MediumDao() val foldersToScan = if (path.isEmpty()) mediaFetcher.getFoldersToScan() else arrayListOf(path) var media = ArrayList() if (path == FAVORITES) { @@ -394,8 +393,8 @@ fun Context.updateDBMediaPath(oldPath: String, newPath: String) { galleryDB.MediumDao().updateMedium(oldPath, newParentPath, newFilename, newPath) } -fun Context.updateDBDirectory(directory: Directory) { - galleryDB.DirectoryDao().updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) +fun Context.updateDBDirectory(directory: Directory, directoryDao: DirectoryDao) { + directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) } fun Context.getOTGFolderChildren(path: String) = getDocumentFile(path)?.listFiles() From 613bbdd2143c652b16e8f8b17aa9249358e07e16 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 29 Jul 2018 22:28:57 +0200 Subject: [PATCH 06/90] do not allow renaming files in the recycle bin, related to #883 --- .../gallery/activities/ViewPagerActivity.kt | 8 ++++---- .../simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index f6756927b..2a0dba669 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -294,12 +294,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View findItem(R.id.menu_delete).isVisible = visibleBottomActions and BOTTOM_ACTION_DELETE == 0 findItem(R.id.menu_share).isVisible = visibleBottomActions and BOTTOM_ACTION_SHARE == 0 findItem(R.id.menu_edit).isVisible = visibleBottomActions and BOTTOM_ACTION_EDIT == 0 - findItem(R.id.menu_rename).isVisible = visibleBottomActions and BOTTOM_ACTION_RENAME == 0 + findItem(R.id.menu_rename).isVisible = visibleBottomActions and BOTTOM_ACTION_RENAME == 0 && !currentMedium.getIsInRecycleBin() findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() && visibleBottomActions and BOTTOM_ACTION_ROTATE == 0 findItem(R.id.menu_set_as).isVisible = visibleBottomActions and BOTTOM_ACTION_SET_AS == 0 findItem(R.id.menu_save_as).isVisible = mRotationDegrees != 0 - findItem(R.id.menu_hide).isVisible = !currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 - findItem(R.id.menu_unhide).isVisible = currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 + findItem(R.id.menu_hide).isVisible = !currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin() + findItem(R.id.menu_unhide).isVisible = currentMedium.isHidden() && visibleBottomActions and BOTTOM_ACTION_TOGGLE_VISIBILITY == 0 && !currentMedium.getIsInRecycleBin() findItem(R.id.menu_add_to_favorites).isVisible = !currentMedium.isFavorite && visibleBottomActions and BOTTOM_ACTION_TOGGLE_FAVORITE == 0 findItem(R.id.menu_remove_from_favorites).isVisible = currentMedium.isFavorite && visibleBottomActions and BOTTOM_ACTION_TOGGLE_FAVORITE == 0 findItem(R.id.menu_restore_file).isVisible = currentMedium.path.startsWith(filesDir.absolutePath) @@ -839,7 +839,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - bottom_rename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0) + bottom_rename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0 && !getCurrentMedium()!!.getIsInRecycleBin()) bottom_rename.setOnClickListener { renameFile() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 780552920..096cebbec 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -113,7 +113,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList 0 findItem(R.id.cab_restore_recycle_bin_files).isVisible = getSelectedPaths().all { it.startsWith(activity.filesDir.absolutePath) } From 7b2af9faebf4a96a339c49d080ed9518a2bec3a9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 12:28:42 +0200 Subject: [PATCH 07/90] fix #886, fade away both play/pause button after a few secs --- app/build.gradle | 2 +- .../gallery/extensions/Activity.kt | 7 ++++--- .../gallery/fragments/VideoFragment.kt | 13 +++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 41d150111..6c1076458 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.10' + implementation 'com.simplemobiletools:commons:4.5.11' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index a8820e8cd..b3222de9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -76,9 +76,10 @@ fun SimpleActivity.launchAbout() { FAQItem(R.string.faq_12_title, R.string.faq_12_text), FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons)) - startAboutActivity(R.string.app_name, LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL - or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or - LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS, BuildConfig.VERSION_NAME, faqItems) + val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or + LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS + + startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems) } fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 5b5ce0d04..dd8bee650 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -89,7 +89,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } mIsFullscreen = activity!!.window.decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_FULLSCREEN == View.SYSTEM_UI_FLAG_FULLSCREEN - mView!!.video_play_outline.alpha = if (mIsFullscreen) 0f else PLAY_PAUSE_VISIBLE_ALPHA setupPlayer() if (savedInstanceState != null) { @@ -411,9 +410,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mExoPlayer?.playWhenReady = true mView!!.video_play_outline.setImageResource(R.drawable.ic_pause) activity!!.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) - mHidePauseHandler.postDelayed({ - mView!!.video_play_outline.animate().alpha(0f).start() - }, HIDE_PAUSE_DELAY) + schedulePlayPauseFadeOut() } private fun pauseVideo() { @@ -429,6 +426,14 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S mView?.video_play_outline?.setImageResource(R.drawable.ic_play) mView?.video_play_outline?.alpha = PLAY_PAUSE_VISIBLE_ALPHA activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + schedulePlayPauseFadeOut() + } + + private fun schedulePlayPauseFadeOut() { + mHidePauseHandler.removeCallbacksAndMessages(null) + mHidePauseHandler.postDelayed({ + mView!!.video_play_outline.animate().alpha(0f).start() + }, HIDE_PAUSE_DELAY) } private fun videoEnded() = mExoPlayer?.currentPosition ?: 0 >= mExoPlayer?.duration ?: 0 From 1567ca05fb55c4837bbbd9c7e6403387b0578969 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 12:31:54 +0200 Subject: [PATCH 08/90] add a null check at getting current path --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 2a0dba669..6a88aec32 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -1104,7 +1104,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun getCurrentMedia() = if (mAreSlideShowMediaVisible) mSlideshowMedia else mMediaFiles - private fun getCurrentPath() = getCurrentMedium()!!.path + private fun getCurrentPath() = getCurrentMedium()?.path ?: "" private fun getCurrentFile() = File(getCurrentPath()) From 74f88583d27df38a7d50f3112f9e03b7736c70cf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 14:23:48 +0200 Subject: [PATCH 09/90] fix #857, improve fullscreen toggling at Immersive mode --- .../gallery/activities/ViewPagerActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 6a88aec32..e9e6290e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -245,7 +245,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> - mIsFullScreen = visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + mIsFullScreen = if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) { + false + } else { + visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0 + } + view_pager.adapter?.let { (it as MyPagerAdapter).toggleFullscreen(mIsFullScreen) checkSystemUI() From 8e23c54978a2f10417d9401963fd3be0e6f7c884 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 15:38:22 +0200 Subject: [PATCH 10/90] update commons to 4.5.12 --- app/build.gradle | 2 +- .../kotlin/com/simplemobiletools/gallery/extensions/Activity.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6c1076458..8e526ce19 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.11' + implementation 'com.simplemobiletools:commons:4.5.12' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index b3222de9b..10484da70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -79,7 +79,7 @@ fun SimpleActivity.launchAbout() { val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS - startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems) + startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) } fun AppCompatActivity.showSystemUI(toggleActionBarVisibility: Boolean) { From b2222dd1b52cefa198602f1073dee05dcc4f2d7c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 15:50:27 +0200 Subject: [PATCH 11/90] properly check "Slideshow" bottom action at the app settings --- .../gallery/dialogs/ManageBottomActionsDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt index 920c3c404..0bd797c54 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageBottomActionsDialog.kt @@ -21,7 +21,7 @@ class ManageBottomActionsDialog(val activity: BaseSimpleActivity, val callback: manage_bottom_actions_rotate.isChecked = actions and BOTTOM_ACTION_ROTATE != 0 manage_bottom_actions_properties.isChecked = actions and BOTTOM_ACTION_PROPERTIES != 0 manage_bottom_actions_change_orientation.isChecked = actions and BOTTOM_ACTION_CHANGE_ORIENTATION != 0 - manage_bottom_actions_slideshow.isChecked = actions and BOTTOM_ACTION_PROPERTIES != 0 + manage_bottom_actions_slideshow.isChecked = actions and BOTTOM_ACTION_SLIDESHOW != 0 manage_bottom_actions_show_on_map.isChecked = actions and BOTTOM_ACTION_SHOW_ON_MAP != 0 manage_bottom_actions_toggle_visibility.isChecked = actions and BOTTOM_ACTION_TOGGLE_VISIBILITY != 0 manage_bottom_actions_rename.isChecked = actions and BOTTOM_ACTION_RENAME != 0 From 301d3bfe7b7a1b8fe7a5f3de9521fd09cf5580ca Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 16:27:25 +0200 Subject: [PATCH 12/90] update version to 4.4.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8e526ce19..bd0894fa5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 188 - versionName "4.4.0" + versionCode 189 + versionName "4.4.1" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 625e42d04f60256bafac7272a1a030a088bd184f Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 16:27:31 +0200 Subject: [PATCH 13/90] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9337e8609..be0e8f94c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 4.4.1 *(2018-07-30)* +---------------------------- + + * Hide both Play and Pause video buttons after 2 secs + * Improve Immersive mode fullscreen behaviour + * Some other stability improvements + Version 4.4.0 *(2018-07-26)* ---------------------------- From 3065db316d6647c0dfa91382c391703bfc1090b7 Mon Sep 17 00:00:00 2001 From: ScratchBuild Date: Tue, 31 Jul 2018 13:51:45 +0900 Subject: [PATCH 14/90] Update Japanese translation --- app/src/main/res/values-ja/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 87ac44d5a..f29556e96 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -28,9 +28,9 @@ 縦で固定 横で固定 デフォルト仕様 - Fix Date Taken value - Fixing… - Dates fixed successfully + 撮影日の値を修正 + 修正中… + 撮影日が正常に修正されました 表示する形式 @@ -82,7 +82,7 @@ 元のファイルを上書きできません 左に回転 右に回転 - 180o回転 + 180度回転 反転 水平方向に反転 垂直方向に反転 From c680cc9229a224f7b18818e4576ca0b588f5afa8 Mon Sep 17 00:00:00 2001 From: chris-w89 <37019071+chris-w89@users.noreply.github.com> Date: Wed, 1 Aug 2018 11:48:35 +0200 Subject: [PATCH 15/90] Update german strings Added better translation --- app/src/main/res/values-de/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 744c25617..c6185aca2 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -28,9 +28,9 @@ Hochkant erzwingen Breitbild erzwingen Standard Ausrichtung benutzen - Aufnahmedatum reparieren - Repariere… - Datum erfolgreich repariert + Aufnahmedatum korrigieren + Korrigiere… + Datum erfolgreich korrigiert Filter From a7d21a52eb557f816e41e4eb9221300b71602e09 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 14:39:22 +0200 Subject: [PATCH 16/90] update commons to 4.5.13 --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/extensions/Activity.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bd0894fa5..12b3cd2ed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.12' + implementation 'com.simplemobiletools:commons:4.5.13' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index 10484da70..d996874c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -60,6 +60,9 @@ fun Activity.launchCamera() { } fun SimpleActivity.launchAbout() { + val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or + LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS + val faqItems = arrayListOf( FAQItem(R.string.faq_5_title_commons, R.string.faq_5_text_commons), FAQItem(R.string.faq_1_title, R.string.faq_1_text), @@ -76,9 +79,6 @@ fun SimpleActivity.launchAbout() { FAQItem(R.string.faq_12_title, R.string.faq_12_text), FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons)) - val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or - LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS - startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) } From f2c2a3d573af93fe8e3ca11b0260353fea3736d5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 14:39:54 +0200 Subject: [PATCH 17/90] update version to 4.4.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 12b3cd2ed..c83f5368b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 189 - versionName "4.4.1" + versionCode 190 + versionName "4.4.2" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From e78b7491fb364a79c98f588db7b15cb4ad5251cc Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 14:40:02 +0200 Subject: [PATCH 18/90] updating changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be0e8f94c..c8eb9d8ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,16 @@ Changelog ========== +Version 4.4.2 *(2018-08-01)* +---------------------------- + + * Removed the homepage from About section + Version 4.4.1 *(2018-07-30)* ---------------------------- * Hide both Play and Pause video buttons after 2 secs - * Improve Immersive mode fullscreen behaviour + * Improved Immersive mode fullscreen behaviour * Some other stability improvements Version 4.4.0 *(2018-07-26)* From 597ccb354bd8fa955f52696e87004cbf0e108e9e Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 20:48:30 +0200 Subject: [PATCH 19/90] update commons to 4.5.14 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index c83f5368b..f1178058e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.13' + implementation 'com.simplemobiletools:commons:4.5.14' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' From 73cd8c0b40ecb2ae421b0b01f929b70f9745b284 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 20:50:07 +0200 Subject: [PATCH 20/90] update kotlin to 1.2.60 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 82672aab8..52140041e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.2.51' + ext.kotlin_version = '1.2.60' repositories { jcenter() From 7d56ddb8de279bf07a9f6f031f31b801eeaf9c5c Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 20:50:17 +0200 Subject: [PATCH 21/90] update version to 4.4.3 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f1178058e..3f4b8b38a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 190 - versionName "4.4.2" + versionCode 191 + versionName "4.4.3" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 77e60d8c92f677dde17ac98603e150db75a5f1e6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Aug 2018 20:50:23 +0200 Subject: [PATCH 22/90] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8eb9d8ea..f79b669c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 4.4.3 *(2018-08-01)* +---------------------------- + + * Removed the More Donating Options from the Purchase Thank You dialog + Version 4.4.2 *(2018-08-01)* ---------------------------- From 0219848d5a68b703b438326a31601a05a08f2145 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Aug 2018 08:35:16 +0200 Subject: [PATCH 23/90] adding a null check --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index e9e6290e5..6bf2dc1d6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -844,7 +844,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - bottom_rename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0 && !getCurrentMedium()!!.getIsInRecycleBin()) + bottom_rename.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_RENAME != 0 && getCurrentMedium()?.getIsInRecycleBin() == false) bottom_rename.setOnClickListener { renameFile() } From a3a38e362117d52dc270319df8af3d20720cfc97 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Aug 2018 08:35:33 +0200 Subject: [PATCH 24/90] update version to 4.4.4 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f4b8b38a..44bccf449 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 191 - versionName "4.4.3" + versionCode 192 + versionName "4.4.4" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 2bac88ebc436a82d29149ba74060f0c787ac8337 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 2 Aug 2018 08:36:07 +0200 Subject: [PATCH 25/90] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f79b669c9..c9fafddc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 4.4.4 *(2018-08-02)* +---------------------------- + + * Adding a crashfix + Version 4.4.3 *(2018-08-01)* ---------------------------- From 4bae35955d9434d1eb69d91d76bf1fee9ee9a925 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Aug 2018 12:05:28 +0200 Subject: [PATCH 26/90] launch the zoomable imageview load at fullscreen views earlier --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 44bccf449..1d4858d80 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.14' + implementation 'com.simplemobiletools:commons:4.5.20' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 4faa99247..b317132a9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -48,7 +48,7 @@ import java.io.FileOutputStream class PhotoFragment : ViewPagerFragment() { private val DEFAULT_DOUBLE_TAP_ZOOM = 2f - private val ZOOMABLE_VIEW_LOAD_DELAY = 1500L + private val ZOOMABLE_VIEW_LOAD_DELAY = 1000L private var isFragmentVisible = false private var isFullscreen = false From 1da39e63ebb82c36882e1bc6993e33e449c78eaf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Aug 2018 11:29:25 +0200 Subject: [PATCH 27/90] update photoview to 2.1.4 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1d4858d80..22833f6b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.12' - implementation 'com.github.chrisbanes:PhotoView:2.1.3' + implementation 'com.github.chrisbanes:PhotoView:2.1.4' implementation 'com.android.support.constraint:constraint-layout:1.1.2' implementation 'com.google.android.exoplayer:exoplayer-core:2.8.2' implementation 'com.google.vr:sdk-panowidget:1.150.0' From 4ea5e34b0f72e6207689320d6c165484837e475c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Aug 2018 11:58:30 +0200 Subject: [PATCH 28/90] update commons to 4.6.0 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 22833f6b4..90458c7c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.5.20' + implementation 'com.simplemobiletools:commons:4.6.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' From 23dd5baaa4a4fe70ffe51352e8140e626ca05923 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Aug 2018 23:59:49 +0200 Subject: [PATCH 29/90] use Picasso as a decoder for fullscreen SubsamplingScaleImageView images --- app/build.gradle | 1 + app/proguard-rules.pro | 6 ++ .../gallery/activities/ViewPagerActivity.kt | 1 - .../gallery/extensions/Activity.kt | 2 +- .../gallery/fragments/PhotoFragment.kt | 74 +++++-------------- .../gallery/helpers/PicassoDecoder.kt | 21 ++++++ .../gallery/helpers/PicassoRegionDecoder.kt | 33 +++++++++ 7 files changed, 80 insertions(+), 58 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoDecoder.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt diff --git a/app/build.gradle b/app/build.gradle index 90458c7c2..a36061bbf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,6 +58,7 @@ dependencies { implementation 'com.google.vr:sdk-panowidget:1.150.0' implementation 'org.apache.sanselan:sanselan:0.97-incubator' implementation 'info.androidhive:imagefilters:1.0.7' + implementation 'com.squareup.picasso:picasso:2.71828' kapt "android.arch.persistence.room:compiler:1.1.1" implementation "android.arch.persistence.room:runtime:1.1.1" diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 9bd07e413..efaa38cf9 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,3 +1,9 @@ -keep class com.simplemobiletools.** { *; } -dontwarn com.simplemobiletools.** -dontwarn org.apache.** + +# Picasso +-dontwarn javax.annotation.** +-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase +-dontwarn org.codehaus.mojo.animal_sniffer.* +-dontwarn okhttp3.internal.platform.ConscryptPlatform diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 6bf2dc1d6..149fd53eb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -77,7 +77,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View companion object { var screenWidth = 0 var screenHeight = 0 - var wasDecodedByGlide = false } override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index d996874c7..d004ee1ea 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -61,7 +61,7 @@ fun Activity.launchCamera() { fun SimpleActivity.launchAbout() { val licenses = LICENSE_GLIDE or LICENSE_CROPPER or LICENSE_MULTISELECT or LICENSE_RTL or LICENSE_SUBSAMPLING or LICENSE_PATTERN or - LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS + LICENSE_REPRINT or LICENSE_GIF_DRAWABLE or LICENSE_PHOTOVIEW or LICENSE_PICASSO or LICENSE_EXOPLAYER or LICENSE_PANORAMA_VIEW or LICENSE_SANSELAN or LICENSE_FILTERS val faqItems = arrayListOf( FAQItem(R.string.faq_5_title_commons, R.string.faq_5_text_commons), diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index b317132a9..651520dc2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -9,20 +9,14 @@ import android.graphics.Matrix import android.graphics.drawable.ColorDrawable import android.media.ExifInterface.* import android.net.Uri -import android.os.AsyncTask import android.os.Bundle import android.os.Handler import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.bumptech.glide.Glide -import com.bumptech.glide.load.DataSource -import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy -import com.bumptech.glide.load.engine.GlideException -import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions -import com.bumptech.glide.request.target.Target import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* @@ -33,11 +27,10 @@ import com.simplemobiletools.gallery.activities.PanoramaActivity import com.simplemobiletools.gallery.activities.PhotoActivity import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.* -import com.simplemobiletools.gallery.helpers.GlideRotateTransformation -import com.simplemobiletools.gallery.helpers.MEDIUM -import com.simplemobiletools.gallery.helpers.PATH -import com.simplemobiletools.gallery.helpers.ROTATE_BY_ASPECT_RATIO +import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium +import com.squareup.picasso.Callback +import com.squareup.picasso.Picasso import it.sephiroth.android.library.exif2.ExifInterface import kotlinx.android.synthetic.main.pager_photo_item.view.* import org.apache.sanselan.common.byteSources.ByteSourceInputStream @@ -48,12 +41,11 @@ import java.io.FileOutputStream class PhotoFragment : ViewPagerFragment() { private val DEFAULT_DOUBLE_TAP_ZOOM = 2f - private val ZOOMABLE_VIEW_LOAD_DELAY = 1000L + private val ZOOMABLE_VIEW_LOAD_DELAY = 500L private var isFragmentVisible = false private var isFullscreen = false private var wasInit = false - private var useHalfResolution = false private var isPanorama = false private var imageOrientation = -1 private var gifDrawable: GifDrawable? = null @@ -245,48 +237,19 @@ class PhotoFragment : ViewPagerFragment() { private fun loadBitmap(degrees: Int = 0) { if (degrees == 0) { - var targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth - var targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight - if (useHalfResolution) { - targetWidth /= 2 - targetHeight /= 2 - } - - if (imageOrientation == ORIENTATION_ROTATE_90) { - targetWidth = targetHeight - targetHeight = Target.SIZE_ORIGINAL - } - - val options = RequestOptions() - .signature(medium.path.getFileSignature()) - .format(DecodeFormat.PREFER_ARGB_8888) - .diskCacheStrategy(DiskCacheStrategy.RESOURCE) - .override(targetWidth, targetHeight) - - Glide.with(this) - .asBitmap() - .load(getPathToLoad(medium)) - .apply(options) - .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - if (!useHalfResolution && e?.rootCauses?.firstOrNull() is OutOfMemoryError) { - useHalfResolution = true - Handler().post { - if (activity?.isActivityDestroyed() == false) { - loadBitmap(degrees) - } - } - } - return false - } - - override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { + Picasso.get() + .load(File(medium.path)) + .centerInside() + .fit() + .into(view.photo_view, object : Callback { + override fun onSuccess() { if (isFragmentVisible) { scheduleZoomableView() } - return false } - }).into(view.photo_view) + + override fun onError(e: Exception) {} + }) } else { val options = RequestOptions() .diskCacheStrategy(DiskCacheStrategy.NONE) @@ -311,23 +274,24 @@ class PhotoFragment : ViewPagerFragment() { private fun scheduleZoomableView() { loadZoomableViewHandler.removeCallbacksAndMessages(null) loadZoomableViewHandler.postDelayed({ - if (isFragmentVisible && !context!!.config.replaceZoomableImages && medium.isImage() && view.subsampling_view.isGone()) { + if (isFragmentVisible && medium.isImage() && view.subsampling_view.isGone()) { addZoomableView() } }, ZOOMABLE_VIEW_LOAD_DELAY) } private fun addZoomableView() { - ViewPagerActivity.wasDecodedByGlide = false + val rotation = degreesForRotation(imageOrientation) view.subsampling_view.apply { + setBitmapDecoderFactory { PicassoDecoder(medium.path, Picasso.get(), rotation) } + setRegionDecoderFactory { PicassoRegionDecoder() } maxScale = 10f beVisible() isQuickScaleEnabled = context.config.oneFingerZoom setResetScaleOnSizeChange(context.config.screenRotation != ROTATE_BY_ASPECT_RATIO) setImage(ImageSource.uri(getPathToLoad(medium))) - orientation = if (imageOrientation == -1) SubsamplingScaleImageView.ORIENTATION_USE_EXIF else degreesForRotation(imageOrientation) + orientation = rotation setEagerLoadingEnabled(false) - setExecutor(AsyncTask.SERIAL_EXECUTOR) setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener { override fun onImageLoaded() { } @@ -400,8 +364,6 @@ class PhotoFragment : ViewPagerFragment() { return if (context == null || bitmapAspectRatio == screenAspectRatio) { DEFAULT_DOUBLE_TAP_ZOOM - } else if (ViewPagerActivity.wasDecodedByGlide) { - 1f } else if (context!!.portrait && bitmapAspectRatio <= screenAspectRatio) { ViewPagerActivity.screenHeight / height.toFloat() } else if (context!!.portrait && bitmapAspectRatio > screenAspectRatio) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoDecoder.kt new file mode 100644 index 000000000..16dd85760 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoDecoder.kt @@ -0,0 +1,21 @@ +package com.simplemobiletools.gallery.helpers + +import android.content.Context +import android.graphics.Bitmap +import android.net.Uri +import com.davemorrissey.labs.subscaleview.decoder.ImageDecoder +import com.squareup.picasso.MemoryPolicy +import com.squareup.picasso.Picasso + +class PicassoDecoder(val tag: String, val picasso: Picasso, val degrees: Int) : ImageDecoder { + + override fun decode(context: Context, uri: Uri): Bitmap { + return picasso + .load(uri) + .tag(tag) + .config(Bitmap.Config.ARGB_8888) + .memoryPolicy(MemoryPolicy.NO_CACHE) + .rotate(-degrees.toFloat()) + .get() + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt new file mode 100644 index 000000000..077508770 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt @@ -0,0 +1,33 @@ +package com.simplemobiletools.gallery.helpers + +import android.content.Context +import android.graphics.* +import android.net.Uri +import com.davemorrissey.labs.subscaleview.decoder.ImageRegionDecoder + +class PicassoRegionDecoder : ImageRegionDecoder { + private var decoder: BitmapRegionDecoder? = null + private val decoderLock = Any() + + override fun init(context: Context, uri: Uri): Point { + val inputStream = context.contentResolver.openInputStream(uri) + this.decoder = BitmapRegionDecoder.newInstance(inputStream, false) + return Point(this.decoder!!.width, this.decoder!!.height) + } + + override fun decodeRegion(rect: Rect, sampleSize: Int): Bitmap { + synchronized(this.decoderLock) { + val options = BitmapFactory.Options() + options.inSampleSize = sampleSize + options.inPreferredConfig = Bitmap.Config.ARGB_8888 + val bitmap = this.decoder!!.decodeRegion(rect, options) + return bitmap ?: throw RuntimeException("Region decoder returned null bitmap - image format may not be supported") + } + } + + override fun isReady() = this.decoder != null && !this.decoder!!.isRecycled + + override fun recycle() { + this.decoder!!.recycle() + } +} From 31f3396450611cbc48714877c46a96a1cf7c9eea Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 11:56:20 +0200 Subject: [PATCH 30/90] preload a smaller resolution fullscreen image first --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 3 ++- app/src/main/res/layout/pager_photo_item.xml | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 651520dc2..5d6d1dfbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -240,9 +240,10 @@ class PhotoFragment : ViewPagerFragment() { Picasso.get() .load(File(medium.path)) .centerInside() - .fit() + .resize(ViewPagerActivity.screenWidth / 2, ViewPagerActivity.screenHeight / 2) .into(view.photo_view, object : Callback { override fun onSuccess() { + view.photo_view.isZoomable = false if (isFragmentVisible) { scheduleZoomableView() } diff --git a/app/src/main/res/layout/pager_photo_item.xml b/app/src/main/res/layout/pager_photo_item.xml index 8d35ed318..96cb2b6c3 100644 --- a/app/src/main/res/layout/pager_photo_item.xml +++ b/app/src/main/res/layout/pager_photo_item.xml @@ -9,8 +9,7 @@ + android:layout_height="match_parent"/> Date: Tue, 7 Aug 2018 12:26:56 +0200 Subject: [PATCH 31/90] add handling for rotating fullscreen images --- .../gallery/fragments/PhotoFragment.kt | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 5d6d1dfbf..b4f291323 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -15,8 +15,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.bumptech.glide.Glide -import com.bumptech.glide.load.engine.DiskCacheStrategy -import com.bumptech.glide.request.RequestOptions import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* @@ -236,33 +234,32 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadBitmap(degrees: Int = 0) { + var targetWidth = ViewPagerActivity.screenWidth + var targetHeight = ViewPagerActivity.screenHeight if (degrees == 0) { - Picasso.get() - .load(File(medium.path)) - .centerInside() - .resize(ViewPagerActivity.screenWidth / 2, ViewPagerActivity.screenHeight / 2) - .into(view.photo_view, object : Callback { - override fun onSuccess() { - view.photo_view.isZoomable = false - if (isFragmentVisible) { - scheduleZoomableView() - } - } - - override fun onError(e: Exception) {} - }) - } else { - val options = RequestOptions() - .diskCacheStrategy(DiskCacheStrategy.NONE) - .transform(GlideRotateTransformation(degrees)) - - Glide.with(this) - .asBitmap() - .load(getPathToLoad(medium)) - .thumbnail(0.2f) - .apply(options) - .into(view.photo_view) + targetWidth /= 2 + targetHeight /= 2 } + + val picasso = Picasso.get() + .load(File(medium.path)) + .centerInside() + .resize(targetWidth, targetHeight) + + if (degrees != 0) { + picasso.rotate(degrees.toFloat()) + } + + picasso.into(view.photo_view, object : Callback { + override fun onSuccess() { + view.photo_view.isZoomable = degrees != 0 + if (isFragmentVisible && degrees == 0) { + scheduleZoomableView() + } + } + + override fun onError(e: Exception) {} + }) } private fun openPanorama() { @@ -379,6 +376,7 @@ class PhotoFragment : ViewPagerFragment() { } fun rotateImageViewBy(degrees: Int) { + loadZoomableViewHandler.removeCallbacksAndMessages(null) view.subsampling_view.beGone() loadBitmap(degrees) } From 8868b73d282280c1c9128908b37c80593cfe73ff Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 12:38:37 +0200 Subject: [PATCH 32/90] do not use half resolution at loading initial bitmap --- .../simplemobiletools/gallery/fragments/PhotoFragment.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index b4f291323..e26acd52a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -234,17 +234,10 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadBitmap(degrees: Int = 0) { - var targetWidth = ViewPagerActivity.screenWidth - var targetHeight = ViewPagerActivity.screenHeight - if (degrees == 0) { - targetWidth /= 2 - targetHeight /= 2 - } - val picasso = Picasso.get() .load(File(medium.path)) .centerInside() - .resize(targetWidth, targetHeight) + .resize(ViewPagerActivity.screenWidth, ViewPagerActivity.screenHeight) if (degrees != 0) { picasso.rotate(degrees.toFloat()) From 2d3cc070ae1374f4ff25ddd89850a5ee9885f9b9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 12:42:13 +0200 Subject: [PATCH 33/90] remove the Replace Deep Zoomable images... option --- .../gallery/activities/SettingsActivity.kt | 9 -------- .../gallery/activities/ViewPagerActivity.kt | 14 ----------- .../gallery/extensions/Activity.kt | 1 - .../gallery/helpers/Config.kt | 4 ---- .../gallery/helpers/Constants.kt | 1 - app/src/main/res/layout/activity_settings.xml | 23 ------------------- 6 files changed, 52 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 13a79370e..4382254e6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -68,7 +68,6 @@ class SettingsActivity : SimpleActivity() { setupEnablePullToRefresh() setupOneFingerZoom() setupAllowInstantChange() - setupReplaceZoomableImages() setupShowExtendedDetails() setupHideExtendedDetails() setupManageExtendedDetails() @@ -351,14 +350,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupReplaceZoomableImages() { - settings_replace_zoomable_images.isChecked = config.replaceZoomableImages - settings_replace_zoomable_images_holder.setOnClickListener { - settings_replace_zoomable_images.toggle() - config.replaceZoomableImages = settings_replace_zoomable_images.isChecked - } - } - private fun setupShowExtendedDetails() { settings_show_extended_details.isChecked = config.showExtendedDetails settings_show_extended_details_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 149fd53eb..c59f342be 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -70,7 +70,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private var mAreSlideShowMediaVisible = false private var mIsOrientationLocked = false - private var mStoredReplaceZoomableImages = false private var mMediaFiles = ArrayList() private var mFavoritePaths = ArrayList() @@ -93,7 +92,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - storeStateVariables() initFavorites() } @@ -113,11 +111,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View setTranslucentNavigation() } - if (mStoredReplaceZoomableImages != config.replaceZoomableImages) { - mPrevHashcode = 0 - refreshViewPager() - } - initBottomActions() supportActionBar?.setBackgroundDrawable(resources.getDrawable(R.drawable.actionbar_gradient_background)) @@ -138,7 +131,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View override fun onPause() { super.onPause() stopSlideshow() - storeStateVariables() } override fun onDestroy() { @@ -357,12 +349,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return true } - private fun storeStateVariables() { - config.apply { - mStoredReplaceZoomableImages = replaceZoomableImages - } - } - private fun updatePagerItems(media: MutableList) { val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, media) if (!isActivityDestroyed()) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index d004ee1ea..0aee81bfe 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -73,7 +73,6 @@ fun SimpleActivity.launchAbout() { FAQItem(R.string.faq_6_title, R.string.faq_6_text), FAQItem(R.string.faq_7_title, R.string.faq_7_text), FAQItem(R.string.faq_8_title, R.string.faq_8_text), - FAQItem(R.string.faq_9_title, R.string.faq_9_text), FAQItem(R.string.faq_10_title, R.string.faq_10_text), FAQItem(R.string.faq_11_title, R.string.faq_11_text), FAQItem(R.string.faq_12_title, R.string.faq_12_text), diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index ff80bbe58..7b2c2ec0c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -189,10 +189,6 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(ALLOW_INSTANT_CHANGE, false) set(allowInstantChange) = prefs.edit().putBoolean(ALLOW_INSTANT_CHANGE, allowInstantChange).apply() - var replaceZoomableImages: Boolean - get() = prefs.getBoolean(REPLACE_ZOOMABLE_IMAGES, false) - set(replaceZoomableImages) = prefs.edit().putBoolean(REPLACE_ZOOMABLE_IMAGES, replaceZoomableImages).apply() - private fun getDirectoryColumnsField(): String { val isPortrait = context.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT return if (isPortrait) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 0a74ddbd3..afc60897d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -45,7 +45,6 @@ const val EXTENDED_DETAILS = "extended_details" const val HIDE_EXTENDED_DETAILS = "hide_extended_details" const val ONE_FINGER_ZOOM = "one_finger_zoom" const val ALLOW_INSTANT_CHANGE = "allow_instant_change" -const val REPLACE_ZOOMABLE_IMAGES = "replace_zoomable_images" const val DO_EXTRA_CHECK = "do_extra_check" const val WAS_NEW_APP_SHOWN = "was_new_app_shown_clock" const val LAST_FILEPICKER_PATH = "last_filepicker_path" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 822fc4989..91b986b1d 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -625,29 +625,6 @@ - - - - - - Date: Tue, 7 Aug 2018 12:47:41 +0200 Subject: [PATCH 34/90] adding some switch padding at the Setting items --- app/src/main/res/layout/activity_settings.xml | 88 +++++++++++++------ 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 91b986b1d..f837b0d95 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,6 +1,7 @@ @@ -74,7 +75,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/use_english_language"/> + android:text="@string/use_english_language" + app:switchPadding="@dimen/medium_margin"/> @@ -97,7 +99,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/avoid_whats_new"/> + android:text="@string/avoid_whats_new" + app:switchPadding="@dimen/medium_margin"/> @@ -204,7 +207,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_hidden_items"/> + android:text="@string/show_hidden_items" + app:switchPadding="@dimen/medium_margin"/> @@ -227,7 +231,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/do_extra_check"/> + android:text="@string/do_extra_check" + app:switchPadding="@dimen/medium_margin"/> @@ -268,7 +273,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/autoplay_videos"/> + android:text="@string/autoplay_videos" + app:switchPadding="@dimen/medium_margin"/> @@ -291,7 +297,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/loop_videos"/> + android:text="@string/loop_videos" + app:switchPadding="@dimen/medium_margin"/> @@ -314,7 +321,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/allow_video_gestures"/> + android:text="@string/allow_video_gestures" + app:switchPadding="@dimen/medium_margin"/> @@ -355,7 +363,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/animate_gifs"/> + android:text="@string/animate_gifs" + app:switchPadding="@dimen/medium_margin"/> @@ -378,7 +387,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/crop_thumbnails"/> + android:text="@string/crop_thumbnails" + app:switchPadding="@dimen/medium_margin"/> @@ -401,7 +411,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_media_count"/> + android:text="@string/show_media_count" + app:switchPadding="@dimen/medium_margin"/> @@ -442,7 +453,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_info_bubble"/> + android:text="@string/show_info_bubble" + app:switchPadding="@dimen/medium_margin"/> @@ -465,7 +477,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/scroll_thumbnails_horizontally"/> + android:text="@string/scroll_thumbnails_horizontally" + app:switchPadding="@dimen/medium_margin"/> @@ -488,7 +501,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/enable_pull_to_refresh"/> + android:text="@string/enable_pull_to_refresh" + app:switchPadding="@dimen/medium_margin"/> @@ -529,7 +543,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/max_brightness"/> + android:text="@string/max_brightness" + app:switchPadding="@dimen/medium_margin"/> @@ -552,7 +567,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/black_background_at_fullscreen"/> + android:text="@string/black_background_at_fullscreen" + app:switchPadding="@dimen/medium_margin"/> @@ -575,7 +591,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/hide_system_ui_at_fullscreen"/> + android:text="@string/hide_system_ui_at_fullscreen" + app:switchPadding="@dimen/medium_margin"/> @@ -598,7 +615,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/one_finger_zoom"/> + android:text="@string/one_finger_zoom" + app:switchPadding="@dimen/medium_margin"/> @@ -621,7 +639,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/allow_instant_change"/> + android:text="@string/allow_instant_change" + app:switchPadding="@dimen/medium_margin"/> @@ -644,7 +663,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/allow_photo_gestures"/> + android:text="@string/allow_photo_gestures" + app:switchPadding="@dimen/medium_margin"/> @@ -720,7 +740,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_extended_details"/> + android:text="@string/show_extended_details" + app:switchPadding="@dimen/medium_margin"/> + android:text="@string/hide_extended_details" + app:switchPadding="@dimen/medium_margin"/> + android:text="@string/password_protect_hidden_items" + app:switchPadding="@dimen/medium_margin"/> @@ -827,7 +850,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/password_protect_whole_app"/> + android:text="@string/password_protect_whole_app" + app:switchPadding="@dimen/medium_margin"/> @@ -868,7 +892,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/delete_empty_folders"/> + android:text="@string/delete_empty_folders" + app:switchPadding="@dimen/medium_margin"/> @@ -891,7 +916,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/keep_last_modified"/> + android:text="@string/keep_last_modified" + app:switchPadding="@dimen/medium_margin"/> @@ -914,7 +940,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/skip_delete_confirmation"/> + android:text="@string/skip_delete_confirmation" + app:switchPadding="@dimen/medium_margin"/> @@ -955,7 +982,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_at_bottom"/> + android:text="@string/show_at_bottom" + app:switchPadding="@dimen/medium_margin"/> @@ -1018,7 +1046,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/move_items_into_recycle_bin"/> + android:text="@string/move_items_into_recycle_bin" + app:switchPadding="@dimen/medium_margin"/> @@ -1041,7 +1070,8 @@ android:clickable="false" android:paddingLeft="@dimen/medium_margin" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_recycle_bin"/> + android:text="@string/show_recycle_bin" + app:switchPadding="@dimen/medium_margin"/> From 83def1d28830b7d396de1cc522c1d699639d7915 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 13:34:01 +0200 Subject: [PATCH 35/90] catch exceptions thrown at storing media in a db --- .../simplemobiletools/gallery/activities/MediaActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 28cea3331..3fb257835 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -824,7 +824,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { mLatestMediaDateId = getLatestMediaByDateId() if (!isFromCache) { val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium } - mMediumDao.insertAll(mediaToInsert) + try { + mMediumDao.insertAll(mediaToInsert) + } catch (e: Exception) { + } } } From 2eaa24e4fb48990cb854f602a67e5d3470779e44 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 13:46:02 +0200 Subject: [PATCH 36/90] update version to 4.5.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a36061bbf..859e9af36 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 192 - versionName "4.4.4" + versionCode 193 + versionName "4.5.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 9e33ef9c8084cd2ae1f878fd0f82be696a05c7e4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 13:46:08 +0200 Subject: [PATCH 37/90] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9fafddc3..91a2a703a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 4.5.0 *(2018-08-07)* +---------------------------- + + * Use real Move instead of the old copy/delete if both source and destination are on the internal storage + * Remake the fullscreen view, always use deep zoomable images with good quality + * Couple stability improvements + Version 4.4.4 *(2018-08-02)* ---------------------------- From cae6792fd68d2e98ccfc48b7ec4c72a85f86f7db Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Tue, 7 Aug 2018 22:40:52 +0800 Subject: [PATCH 38/90] Update Translation --- app/src/main/res/values-zh-rTW/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 21415b300..b3f6fcb33 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -28,9 +28,9 @@ 強制直向 強制橫向 使用預設方向 - Fix Date Taken value - Fixing… - Dates fixed successfully + 修復拍照日期數值 + 修復中… + 日期修復成功 篩選媒體檔案 @@ -87,7 +87,7 @@ 水平翻轉 垂直翻轉 用其他程式編輯 - Free + 自由 簡易桌布 @@ -157,7 +157,7 @@ 狀態欄隱藏時,同時隱藏詳細資訊 進行額外檢查,避免顯示無效的檔案 在螢幕底部顯示一些操作按鈕 - Show the Recycle Bin at the folders screen + 在資料夾畫面顯示回收桶 縮圖 @@ -166,9 +166,9 @@ 底部操作 - 管理可見的底部操作 - 加入/移除我的最愛 - 檔案顯示/隱藏 + 管理要顯示的底部操作 + 我的最愛 + 檔案顯示 我如何將簡易相簿設為預設相簿? @@ -195,8 +195,8 @@ 是的,你能夠在編輯器內拉動圖片角落來裁剪圖片。要進入編輯器,你可以長按圖片縮圖然後選擇[編輯],或是在全螢幕檢視下選擇[編輯]。 我可以歸類媒體檔案的縮圖嗎? 當然,只要在縮圖瀏覽中使用[歸類]選單項目就可以了。你能依多種條件歸類檔案,包含拍照日期。如果你使用了[資料夾內容全部顯示]功能,你還能以資料夾來歸類。 - Sorting by Date Taken doesn\'t seem to work properly, how can I fix it? - It is most likely caused by the files being copied from somewhere. You can fix it by selecting the file thumbnails and selecting \"Fix Date Taken value\". + 依拍照日期排序似乎沒正確運作,我該如何修復? + 那很可能是由於檔案從某處複製過來所造成的。你可以選擇檔案縮圖,然後選擇\"修復拍照日期數值\"來進行修復。 From 686cee83ed3ec58d52b78bea90500945e2b5e002 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 20:14:57 +0200 Subject: [PATCH 39/90] remeasure the screen if the width and height are set to 0 at fullscreen view --- app/build.gradle | 2 +- .../gallery/activities/ViewPagerActivity.kt | 4 +++- .../gallery/fragments/PhotoFragment.kt | 23 ++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 859e9af36..0a4c5c4d5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.6.0' + implementation 'com.simplemobiletools:commons:4.6.3' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index c59f342be..75690a206 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.gallery.activities import android.animation.Animator import android.animation.ValueAnimator +import android.annotation.SuppressLint import android.annotation.TargetApi import android.app.Activity import android.content.Intent @@ -965,9 +966,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View initBottomActionsLayout() } + @SuppressLint("NewApi") private fun measureScreen() { val metrics = DisplayMetrics() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + if (isJellyBean1Plus()) { windowManager.defaultDisplay.getRealMetrics(metrics) screenWidth = metrics.widthPixels screenHeight = metrics.heightPixels diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index e26acd52a..8804784fc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -1,5 +1,6 @@ package com.simplemobiletools.gallery.fragments +import android.annotation.SuppressLint import android.content.Intent import android.content.res.Configuration import android.graphics.Bitmap @@ -11,6 +12,7 @@ import android.media.ExifInterface.* import android.net.Uri import android.os.Bundle import android.os.Handler +import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -19,6 +21,7 @@ import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.OTG_PATH +import com.simplemobiletools.commons.helpers.isJellyBean1Plus import com.simplemobiletools.commons.helpers.isLollipopPlus import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.activities.PanoramaActivity @@ -39,7 +42,7 @@ import java.io.FileOutputStream class PhotoFragment : ViewPagerFragment() { private val DEFAULT_DOUBLE_TAP_ZOOM = 2f - private val ZOOMABLE_VIEW_LOAD_DELAY = 500L + private val ZOOMABLE_VIEW_LOAD_DELAY = 300L private var isFragmentVisible = false private var isFullscreen = false @@ -78,6 +81,10 @@ class PhotoFragment : ViewPagerFragment() { } } + if (ViewPagerActivity.screenWidth == 0 || ViewPagerActivity.screenHeight == 0) { + measureScreen() + } + storeStateVariables() if (!isFragmentVisible && activity is PhotoActivity) { isFragmentVisible = true @@ -167,6 +174,20 @@ class PhotoFragment : ViewPagerFragment() { } } + @SuppressLint("NewApi") + private fun measureScreen() { + val metrics = DisplayMetrics() + if (isJellyBean1Plus()) { + activity!!.windowManager.defaultDisplay.getRealMetrics(metrics) + ViewPagerActivity.screenWidth = metrics.widthPixels + ViewPagerActivity.screenHeight = metrics.heightPixels + } else { + activity!!.windowManager.defaultDisplay.getMetrics(metrics) + ViewPagerActivity.screenWidth = metrics.widthPixels + ViewPagerActivity.screenHeight = metrics.heightPixels + } + } + private fun gifFragmentVisibilityChanged(isVisible: Boolean) { if (isVisible) { gifDrawable?.start() From 1f2258844bdf19690f81b1386659831d9edd53b4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 20:23:59 +0200 Subject: [PATCH 40/90] update version to 4.5.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0a4c5c4d5..1236a4e48 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 193 - versionName "4.5.0" + versionCode 194 + versionName "4.5.1" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From b78243997d5ed792641a1da89c060411dd1c6544 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 7 Aug 2018 20:24:05 +0200 Subject: [PATCH 41/90] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a2a703a..37fef7bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 4.5.1 *(2018-08-07)* +---------------------------- + + * Adding a crashfix + Version 4.5.0 *(2018-08-07)* ---------------------------- From f40543ae3bfbda361b5c0201bcc1828a8436fffc Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 12:54:59 +0200 Subject: [PATCH 42/90] shorten some code at PicassoRegionDecoder --- .../gallery/helpers/PicassoRegionDecoder.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt index 077508770..778b380b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/PicassoRegionDecoder.kt @@ -11,23 +11,23 @@ class PicassoRegionDecoder : ImageRegionDecoder { override fun init(context: Context, uri: Uri): Point { val inputStream = context.contentResolver.openInputStream(uri) - this.decoder = BitmapRegionDecoder.newInstance(inputStream, false) - return Point(this.decoder!!.width, this.decoder!!.height) + decoder = BitmapRegionDecoder.newInstance(inputStream, false) + return Point(decoder!!.width, decoder!!.height) } override fun decodeRegion(rect: Rect, sampleSize: Int): Bitmap { - synchronized(this.decoderLock) { + synchronized(decoderLock) { val options = BitmapFactory.Options() options.inSampleSize = sampleSize options.inPreferredConfig = Bitmap.Config.ARGB_8888 - val bitmap = this.decoder!!.decodeRegion(rect, options) + val bitmap = decoder!!.decodeRegion(rect, options) return bitmap ?: throw RuntimeException("Region decoder returned null bitmap - image format may not be supported") } } - override fun isReady() = this.decoder != null && !this.decoder!!.isRecycled + override fun isReady() = decoder != null && !decoder!!.isRecycled override fun recycle() { - this.decoder!!.recycle() + decoder!!.recycle() } } From c9a084c4e4acfcd2bfd1f9a6e02b0563470319c9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 16:05:06 +0200 Subject: [PATCH 43/90] allow using the PhotoView zoom if loading Subsampling fails --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 8804784fc..3a05b50ae 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -322,6 +322,7 @@ class PhotoFragment : ViewPagerFragment() { } override fun onImageLoadError(e: Exception) { + view.photo_view.isZoomable = true background = ColorDrawable(Color.TRANSPARENT) beGone() } From b6b7f344c35914537410294ed67b6cb9f0b46ae8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 16:12:04 +0200 Subject: [PATCH 44/90] adding a new string for toggling the allowance of deep image zooming --- app/src/main/res/values-ar/strings.xml | 2 +- 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 | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-fi/strings.xml | 2 +- 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-it/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-ko-rKR/strings.xml | 2 +- app/src/main/res/values-lt/strings.xml | 2 +- app/src/main/res/values-nb/strings.xml | 2 +- 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 | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 5e3562c0b..ea20cdd53 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -157,7 +157,7 @@ إدارة المجلدات المستبعدة السماح بتكبير الوسائط بأصبع واحد في وضع ملء الشاشة السماح بتغيير الوسائط على الفور من خلال النقر على جوانب الشاشة - استبدل الصور التي يمكن تكبيرها بعمق باستخدام صور ذات جودة أفضل + Allow deep zooming images إخفاء التفاصيل الموسعة عند إخفاء شريط الحالة قم بإجراء فحص إضافي لتجنب إظهار الملفات التالفة Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 88597b80a..93106ddd4 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -153,7 +153,7 @@ Gestioneu els detalls ampliats Permet fer zoom amb un sol dit a pantalla complerta Permet canviar els mitjans de manera instantània fent clic als costats de la pantalla - Substituïr imatges ampliades per les de millor quialitat + Allow deep zooming images Amaga els detalls estesos quan la barra d\'estat està amagada Fer una verificació addicional per evitar que es mostrin fitxers no vàlids Mostra alguns botons d\'acció a la part inferior de la pantalla diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index f6884c948..8910f4512 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -153,7 +153,7 @@ Manage extended details Allow one finger zoom at fullscreen media Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones + Allow deep zooming images Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 7caf6d01a..0fd2f1018 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -153,7 +153,7 @@ Manage extended details Tillad zoom med en finger når medier er i fuldskærm Tillad skift af medie ved klik på skærmens sider - Erstat stærkt zoombare billeder med nogle i bedre kvalitet + Allow deep zooming images Skjul udvidede oplysninger når statuslinjen er skjult Tjek en ekstra gang for at undgå visning af ugyldige filer Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c6185aca2..a16e2b8ba 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -153,7 +153,7 @@ Eigenschaften auswählen Ein-Finger-Zoom im Vollbild zulassen Beim Tippen auf eine Bildschirmseite sofort zwischen Medien wechseln - Stark zoombare Bilder durch Bilder mit hoher Qualität ersetzen + Allow deep zooming images Erweiterte Details nicht anzeigen, wenn die Systemleiste versteckt ist Zusätzliche Überprüfung, um ungültige Dateien nicht anzuzeigen Einige Aktionstasten am unteren Bildschirmrand anzeigen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 35b67555f..b96da6fb9 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -154,7 +154,7 @@ Διαχείριση εκτεταμένων λεπτομερειών Να επιτρέπεται μεγένθυση με ένα δάχτυλο σε πλήρη οθόνη Να επιτρέπεται η άμεση αλλαγή των μέσων με το άγγιγμα στις άκρες της οθόνης - Αντικατάσταση των φωτογραφιών που απαιτούν ζούμ με άλλες καλύτερης ποιότητας + Allow deep zooming images Απόκρυψη λεπτομερειών όταν η μπάρα κατάστασης είναι κρυμμένη Επιπλέον έλεγχος για την αποφυγή εμφάνισης λανθασμένων αρχείων Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 0fff9f75a..adfe5c4bc 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -153,7 +153,7 @@ Administrar detalles ampliados Permitir zoom con un dedo en pantalla completa Permitir el cambio instantáneo de medios haciendo clic en los lados de la pantalla - Reemplace las imágenes con mucho zoom por otras de mejor calidad + Allow deep zooming images Ocultar detalles ampliados cuando la barra de estado está oculta Hacer una comprobación adicional para evitar mostrar archivos inválidos Mostrar algunos botones de acción en la parte inferior de la pantalla diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index de53e5492..9278f6332 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -153,7 +153,7 @@ Hallitse yksityiskohtaisia tietoja Salli lähentäminen yhdellä sormella täyden ruudun tilassa Salli median selaaminen ruudun reunoja koskettamalla - Korvaa syvälle lähennettävät kuvat parempilaatuisella + Allow deep zooming images Piilota yksityiskohtaiset tiedot kun tilapalkki on piilotettu Tee ylimääräinen tarkistus rikkinäisten tiedostojen varalta Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index dc5f31733..a3e385cca 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -153,7 +153,7 @@ Gérer les détails supplémentaires Autoriser le zoom avec un doigt sur un média en plein écran Autoriser le changement instantané de média en cliquant sur les côtés de l\'écran - Remplacer les images zoomables profondes par des images de meilleure qualité + Allow deep zooming images Masquer les détails supplémentaires lorsque la barre d\'état est masquée Faire une vérification supplémentaire pour éviter de montrer des fichiers invalides Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 70490384b..cd213e151 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -153,7 +153,7 @@ Xestionar información polo miúdo Permitir zoom con un dedo a pantalla completa Permitir o cambio instantáneo de medios pulsando nos lados da pantalla - Substituír imaxes con un gran zoom por por outras con mellor calidade + Allow deep zooming images Agochar detalles extendidos cando a barra de estado está oculta Facer unha comprobación extra para evitar mostrar ficheiros non válidos Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 15180ae8e..f15290f68 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -153,7 +153,7 @@ Upravljaj proširenim pojedinostima Omogući zumiranje jednim prstom na mediju cijelog zaslona Dopusti trenutačno mijenjanje medija dodirom na stranice zaslona - Zamijenite slike s dubokim zumom za one s boljom kvalitetom + Allow deep zooming images Sakrij proširene pojedinosti kada je traka statusa skrivena Napravite dodatnu provjeru da biste izbjegli prikazivanje nevažećih datoteka Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 994b4544e..b82021ffb 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -153,7 +153,7 @@ Manage extended details Allow one finger zoom at fullscreen media Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones + Allow deep zooming images Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 15dfb6bc3..c885f19bf 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -153,7 +153,7 @@ Gestisci le informazioni estese Abilita zoom con un dito su media a schermo intero Cambia media istantaneamente toccando sui lati dello schermo - Sostituisci le immagini ingrandibili a fondo con altre di migliore qualità + Allow deep zooming images Nascondi i dettagli estesi quando la barra di stato è nascosta Fai un controllo ulteriore per evitare di mostrare file non validi Mostra alcuni pulsanti azione in fondo allo schermo diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f29556e96..a344ffda1 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -153,7 +153,7 @@ 詳細表示を管理する メディアを指ひとつでズーム可能にする 画面の端を押してメディアをスライドする - ズームが可能な画像を高画質な物にする + Allow deep zooming images ステータスバーが非表示の時は詳細を隠す 無効なファイルを見せない調整を行う 画面下部にアクションボタンを表示する diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index b1f627ab9..3a8658cc6 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -153,7 +153,7 @@ 확장된 세부정보 관리 전체화면 모드에서 한 손가락으로 확대 및 축소 측면 클릭으로 미디어 즉시변경 - 확대 축소 가능한 이미지를 더 좋은 품질로 교체 + Allow deep zooming images 상태 표시 줄이 숨겨져있을 때 확장 된 세부 정보 숨김 잘못된 파일 표시를 방지하기 위해 추가 검사 수행 Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 4252465cd..a79ddee3a 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -153,7 +153,7 @@ Tvarkykite išsamią informaciją Leisti vienu pirštu pritraukti viso ekrano rėžime Leiskite akimirksniu keisti mediją spustelėdami ekrano šonuose - Pakeisti giliai priartinamus atvaizdus su geresnės kokybės atvaizdais + Allow deep zooming images Slėpti išsamią informaciją, kai būsenos juosta yra paslėpta Atlikti papildomą patikrinimą, kad nebūtų rodomos sugadintos bylos Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 412809ce1..0a081b6ab 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -153,7 +153,7 @@ Velg detaljer Tillat en-finger-zoom i mediavisningen Tillat å skifte media øyeblikkelig ved å trykke på kanten av skjermen - Erstatt dyp-zoombare bilder med bilder av bedre kvalitet + Allow deep zooming images Skjul utvidede detaljer når statuslinjen er skjult Gjør en ekstra sjekk for å unngå visning av ugyldige filer Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index e620f3970..0a20d2971 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -153,7 +153,7 @@ Uitgebreide informatie Met één vinger zoomen in volledig scherm Direct naar vorige/volgende door op de zijkanten van het scherm te tikken - In hoge kwaliteit weergeven (ten koste van ver inzoomen) + Allow deep zooming images Uitgebreide informatie niet tonen als de statusbalk is verborgen Ongeldige bestanden verbergen Enkele actieknoppen onderaan het scherm tonen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index d446b28db..4c251fd43 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -153,7 +153,7 @@ Zarządzaj dodatkowymi szczegółami    Zezwalaj na powiększanie jednym palcem w widoku pełnoekranowym    Zezwalaj na natychmiastową zmianę multimediów po kliknięciu boków ekranu -    Zamieniaj powiększalne obrazy na te o lepszej jakości +    Allow deep zooming images Ukrywaj dodatkowe szczegóły, gdy pasek stanu jest ukryty    Dodatkowe sprawdzenie w celu uniknięcia pokazywania niewłaściwych plików Pokazuj niektóre przyciski akcji na dole ekranu diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 44028df83..13f925d3c 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -153,7 +153,7 @@ Gerenciar detalhes extendidos Permitir zoom com um dedo quando em exibição de tela cheia Permitir alternância instantânia de mídia clicando nas laterais da tela - Substituir imagens aptas a grande quantitade de zoom por imagens de melhor qualidade + Allow deep zooming images Ocultar detalhes extendidos quando a barra de status estiver oculta Realizar verificação extra para evitar mostrar arquivos inválidos Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 23226010d..c5ba730f2 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -153,7 +153,7 @@ Gerir detalhes exibidos Permitir ampliação com um dedo se em ecrã completo Permitir troca imediata de ficheiro ao tocar nas margens do ecrã - Replace deep zoomable images with better quality ones + Allow deep zooming images Ocultar detalhes extra se a barra de estado estiver oculta Efetuar uma dupla verificação para evitar mostrar os ficheiros inválidos Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index f2967a2d7..63348ee7f 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -153,7 +153,7 @@ Выбрать подробности файла Масштабирование одним пальцем при просмотре изображения Мгновенное переключение медиафайлов нажатием по краю экрана - Заменять масштабируемые изображения высококачественными + Allow deep zooming images Не показывать подробности при скрытой строке состояния Делать дополнительную проверку, чтобы избежать показа неподдерживаемых файлов Показывать кнопки действий в нижней части экрана diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 5bb5d7536..d6d826cf1 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -153,7 +153,7 @@ Spravovať rozšírené vlastnosti Povoliť približovanie jedným prstom v celoobrazovkovom režime Povoliť instantné prepínanie médií kliknutím na okraj obrazovky - Nahradiť hlboko priblížiteľné obrázky s obrázkami s lepšou kvalitou + Povoliť hlboké približovanie obrázkov Skryť rozšírené vlastnosti ak je skrytá stavová lišta Predísť zobrazovaniu neplatných súborov dodatočnou kontrolou Zobraziť niektoré akčné tlačidlá na spodku obrazovky diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index fc4b4e294..4063b4926 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -153,7 +153,7 @@ Hantera utökad information Tillåt zoomning med ett finger när media visas i helskärmsläge Tillåt snabbyte av media genom tryckning på skärmens kanter - Ersätt djupt zoombara bilder med bilder av bättre kvalitet + Allow deep zooming images Dölj utökad information när statusfältet är dolt Gör en extra kontroll för att hindra ogiltiga filer från att visas Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 9bf18310a..eb0991ce0 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -153,7 +153,7 @@ Manage extended details Allow one finger zoom at fullscreen media Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones + Allow deep zooming images Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files Show some action buttons at the bottom of the screen diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 32b143cba..bab7274ea 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -153,7 +153,7 @@ 要显示的详细信息项目 单指缩放 通过单击屏幕边缘来切换媒体 - 用质量更好的图像替换可深度缩放的图像 + Allow deep zooming images 当状态栏隐藏时隐藏扩展详情 额外检查以避免显示无效的文件 在屏幕底部显示一些操作按钮 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index b3f6fcb33..ef2706f14 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -153,7 +153,7 @@ 管理詳細資訊 全螢幕時允許單指縮放 允許點擊螢幕邊緣來快速切換媒體檔案 - 可深度縮放的圖片用品質更佳的來取代 + Allow deep zooming images 狀態欄隱藏時,同時隱藏詳細資訊 進行額外檢查,避免顯示無效的檔案 在螢幕底部顯示一些操作按鈕 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 79e076e58..a466b061d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -153,7 +153,7 @@ Manage extended details Allow one finger zoom at fullscreen media Allow instantly changing media by clicking on screen sides - Replace deep zoomable images with better quality ones + Allow deep zooming images Hide extended details when status bar is hidden Do an extra check to avoid showing invalid files Show some action buttons at the bottom of the screen From 458686865bf2d0ce512e3217599a84325c15486f Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 16:37:38 +0200 Subject: [PATCH 45/90] adding a toggle for allowing deep zoomable images --- .../gallery/activities/SettingsActivity.kt | 11 +++++++++ .../gallery/helpers/Config.kt | 4 ++++ .../gallery/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_settings.xml | 24 +++++++++++++++++++ build.gradle | 2 +- 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4382254e6..4e17609c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -66,6 +66,7 @@ class SettingsActivity : SimpleActivity() { setupKeepLastModified() setupShowInfoBubble() setupEnablePullToRefresh() + setupAllowZoomingImages() setupOneFingerZoom() setupAllowInstantChange() setupShowExtendedDetails() @@ -334,6 +335,16 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAllowZoomingImages() { + settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages) + settings_allow_zooming_images.isChecked = config.allowZoomingImages + settings_allow_zooming_images_holder.setOnClickListener { + settings_allow_zooming_images.toggle() + config.allowZoomingImages = settings_allow_zooming_images.isChecked + settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages) + } + } + private fun setupOneFingerZoom() { settings_one_finger_zoom.isChecked = config.oneFingerZoom settings_one_finger_zoom_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 7b2c2ec0c..ea722dd2b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -376,4 +376,8 @@ class Config(context: Context) : BaseConfig(context) { var showRecycleBinAtFolders: Boolean get() = prefs.getBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, true) set(showRecycleBinAtFolders) = prefs.edit().putBoolean(SHOW_RECYCLE_BIN_AT_FOLDERS, showRecycleBinAtFolders).apply() + + var allowZoomingImages: Boolean + get() = prefs.getBoolean(ALLOW_ZOOMING_IMAGES, true) + set(allowZoomingImages) = prefs.edit().putBoolean(ALLOW_ZOOMING_IMAGES, allowZoomingImages).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index afc60897d..035396202 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -58,6 +58,7 @@ const val USE_RECYCLE_BIN = "use_recycle_bin" const val GROUP_BY = "group_by" const val EVER_SHOWN_FOLDERS = "ever_shown_folders" const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders" +const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index f837b0d95..b543aaa68 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -596,6 +596,30 @@ + + + + + + Date: Wed, 8 Aug 2018 16:59:27 +0200 Subject: [PATCH 46/90] setup deep zoomable images only when appropriate --- .../gallery/fragments/PhotoFragment.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 3a05b50ae..64026a742 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -255,10 +255,18 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadBitmap(degrees: Int = 0) { + var targetWidth = ViewPagerActivity.screenWidth + var targetHeight = ViewPagerActivity.screenHeight + + if (context?.config?.allowZoomingImages == true) { + targetWidth = (targetWidth * 0.8).toInt() + targetHeight = (targetHeight * 0.8).toInt() + } + val picasso = Picasso.get() .load(File(medium.path)) .centerInside() - .resize(ViewPagerActivity.screenWidth, ViewPagerActivity.screenHeight) + .resize(targetWidth, targetHeight) if (degrees != 0) { picasso.rotate(degrees.toFloat()) @@ -266,7 +274,7 @@ class PhotoFragment : ViewPagerFragment() { picasso.into(view.photo_view, object : Callback { override fun onSuccess() { - view.photo_view.isZoomable = degrees != 0 + view.photo_view.isZoomable = degrees != 0 || context?.config?.allowZoomingImages == false if (isFragmentVisible && degrees == 0) { scheduleZoomableView() } @@ -286,7 +294,7 @@ class PhotoFragment : ViewPagerFragment() { private fun scheduleZoomableView() { loadZoomableViewHandler.removeCallbacksAndMessages(null) loadZoomableViewHandler.postDelayed({ - if (isFragmentVisible && medium.isImage() && view.subsampling_view.isGone()) { + if (isFragmentVisible && context?.config?.allowZoomingImages == true && medium.isImage() && view.subsampling_view.isGone()) { addZoomableView() } }, ZOOMABLE_VIEW_LOAD_DELAY) From da70c220d247fcd35f2470bb60e2ea6a52db1b69 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 22:05:43 +0200 Subject: [PATCH 47/90] fix #896, ignore fullscreen toggling at fading play/pause --- .../gallery/fragments/VideoFragment.kt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index dd8bee650..2c6927ea9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -623,17 +623,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } } } - - mView!!.video_play_outline.animate().alpha(if (isFullscreen && mIsPlaying) 0f else PLAY_PAUSE_VISIBLE_ALPHA).start() - if (isFullscreen) { - mHidePauseHandler.removeCallbacksAndMessages(null) - } else { - mHidePauseHandler.postDelayed({ - if (mExoPlayer?.currentPosition ?: 0 > 0) { - mView!!.video_play_outline.animate().alpha(0f).start() - } - }, HIDE_PAUSE_DELAY) - } } private fun getExtendedDetailsY(height: Int): Float { From d647bbb583d9dd4ff4bf5a595b6c3764d202d190 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 22:28:03 +0200 Subject: [PATCH 48/90] disable subsampling view at swiping away from it --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 64026a742..cff43e650 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -200,6 +200,8 @@ class PhotoFragment : ViewPagerFragment() { if (isVisible) { scheduleZoomableView() } else { + view.subsampling_view.recycle() + view.subsampling_view.beGone() loadZoomableViewHandler.removeCallbacksAndMessages(null) } } @@ -303,6 +305,7 @@ class PhotoFragment : ViewPagerFragment() { private fun addZoomableView() { val rotation = degreesForRotation(imageOrientation) view.subsampling_view.apply { + background = ColorDrawable(Color.TRANSPARENT) setBitmapDecoderFactory { PicassoDecoder(medium.path, Picasso.get(), rotation) } setRegionDecoderFactory { PicassoRegionDecoder() } maxScale = 10f From 5505594c29b6d8fb40af3ad2d948d8e2316016a2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 22:53:09 +0200 Subject: [PATCH 49/90] properly load content:// uris at PhotoFragment --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index cff43e650..122ed6e6a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -265,8 +265,9 @@ class PhotoFragment : ViewPagerFragment() { targetHeight = (targetHeight * 0.8).toInt() } + val pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" val picasso = Picasso.get() - .load(File(medium.path)) + .load(pathToLoad) .centerInside() .resize(targetWidth, targetHeight) From 408e592b26dcab41c21919305e2f73be63024b12 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 23:03:55 +0200 Subject: [PATCH 50/90] update commons to 4.6.4 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1236a4e48..9476fe081 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.6.3' + implementation 'com.simplemobiletools:commons:4.6.4' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' From b0dce3cb64e68540c353a5222f4d5dc9315a7058 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 23:06:08 +0200 Subject: [PATCH 51/90] update version to 4.5.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9476fe081..0ed8150fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 194 - versionName "4.5.1" + versionCode 195 + versionName "4.5.2" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 41dc0327222a1050f0165a518d44ea602765f9ef Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 8 Aug 2018 23:06:13 +0200 Subject: [PATCH 52/90] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37fef7bfa..e24c8057a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 4.5.2 *(2018-08-08)* +---------------------------- + + * Adding a toggle for disabling deep zoomable images + * Fix displaying third party images + * Couple smaller UX fixes + Version 4.5.1 *(2018-08-07)* ---------------------------- From dac83be81f222a67f928c37f729e08b5341c7f3f Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 9 Aug 2018 02:01:37 +0200 Subject: [PATCH 53/90] Dutch So, how does this compare to "Replace deep zoomable images with better quality ones"? The option is reversed and now enabling this option is "at the cost of image quality"? --- 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 0a20d2971..9ec325ac2 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -153,7 +153,7 @@ Uitgebreide informatie Met één vinger zoomen in volledig scherm Direct naar vorige/volgende door op de zijkanten van het scherm te tikken - Allow deep zooming images + Verder inzoomen mogelijk maken Uitgebreide informatie niet tonen als de statusbalk is verborgen Ongeldige bestanden verbergen Enkele actieknoppen onderaan het scherm tonen From 916602367912bba5451ae0fd00308cb0bee84977 Mon Sep 17 00:00:00 2001 From: FTno <16176811+FTno@users.noreply.github.com> Date: Fri, 10 Aug 2018 16:00:17 +0200 Subject: [PATCH 54/90] Update strings.xml Norwegian translation update --- app/src/main/res/values-nb/strings.xml | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 0a081b6ab..5e5514897 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -24,20 +24,20 @@ Lysstyrke Lås skjermorientering Lås opp skjermorientering - Change orientation - Force portrait - Force landscape - Use default orientation - Fix Date Taken value - Fixing… - Dates fixed successfully + Endre orientering + Framtving portrett + Framtving landskap + Bruk standardorientering + Korriger Dato tatt-verdi + Korrigerer… + Datoer er korrigerte Filtrer media Bilder Videoer GIF-bilder - RAW images + RAW-format-bilder Ingen media-filer er funnet med de valgte filtrene. Endre filtere @@ -87,7 +87,7 @@ Speilvend horisontalt Speilvend vertikalt Rediger med - Free + Fri Bakgrunnsbilde @@ -122,13 +122,13 @@ Group direct subfolders - Group by - Do not group files - Folder - Last modified - Date taken - File type - Extension + Grupper etter + Ikke grupper filer + Mappe + Sist endret + Dato tatt + Filtype + Endelse Avspill videoer automatisk @@ -153,22 +153,22 @@ Velg detaljer Tillat en-finger-zoom i mediavisningen Tillat å skifte media øyeblikkelig ved å trykke på kanten av skjermen - Allow deep zooming images + Tillat dyp bildezooming Skjul utvidede detaljer når statuslinjen er skjult Gjør en ekstra sjekk for å unngå visning av ugyldige filer - Show some action buttons at the bottom of the screen - Show the Recycle Bin at the folders screen + Vis noen handlingsknapper nederst på skjermen + Vis papirkurven på mappeskjermen Minibilder Mediavisning Utvidede detaljer - Bottom actions + Handlinger nederst - Manage visible bottom actions - Toggle favorite - Toggle file visibility + Behandle nedre handlingsknapper + Favoritt av/på + Filsynlighet av/på How can I make Simple Gallery the default device gallery? From f45f9c788dfd3bea4e4c8e1f82f253e9728e4406 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Sat, 11 Aug 2018 03:21:16 +0200 Subject: [PATCH 55/90] PL translation update [2018.08.11] --- app/src/main/res/values-pl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 4c251fd43..81049ce30 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -153,7 +153,7 @@ Zarządzaj dodatkowymi szczegółami    Zezwalaj na powiększanie jednym palcem w widoku pełnoekranowym    Zezwalaj na natychmiastową zmianę multimediów po kliknięciu boków ekranu -    Allow deep zooming images + Zezwalaj na duże powiększanie obrazów Ukrywaj dodatkowe szczegóły, gdy pasek stanu jest ukryty    Dodatkowe sprawdzenie w celu uniknięcia pokazywania niewłaściwych plików Pokazuj niektóre przyciski akcji na dole ekranu From 2236b5103b40d4a008d69ff76e4e9cd63ea197ee Mon Sep 17 00:00:00 2001 From: spkprs Date: Sun, 12 Aug 2018 03:23:32 +0300 Subject: [PATCH 56/90] Update strings.xml --- app/src/main/res/values-el/strings.xml | 110 ++++++++++++------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index b96da6fb9..bdef2cb20 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -4,45 +4,45 @@ Gallery Επεξεργασία Άνοιγμα κάμερας - (κρυμμένο) - (εξαιρεθέν) + (κρυφά) + (εξαιρούνται) Καρφίτσωμα φακέλου Ξεκαρφίτσωμα φακέλου Καρφίτσωμα στην κορυφή - Εμφάνιση περιεχομένου όλων των φακέλων + Προβολή όλων στο φάκελο Όλοι οι φάκελοι - Αλλαγή στην εμφάνιση των φακέλων + Αλλαγή σε προβολή φακέλων Άλλος φάκελος Εμφάνιση στο χάρτη Άγνωστη τοποθεσία Αύξηση αριθμού στηλών Μείωση αριθμού στηλών - Αλλαγή εικόνας εξώφυλλου + Αλλαγή εξώφυλλου φακέλου Επιλογή φωτογραφίας - Χρήση προκαθορισμένου + Χρήση προεπιλεγμένης Ένταση Φωτεινότητα Κλείδωμα προσανατολισμού Ξεκλείδωμα προσανατολισμού - Change orientation - Force portrait - Force landscape - Use default orientation - Fix Date Taken value - Fixing… - Dates fixed successfully + Αλλαγή προσανατολισμού + Εξαναγκασμός σε πορτρέτο + Εξαναγκασμός σε τοπίο + Χρήση προεπιλογής + Διόρθωση ημερ. λήψης + Διορθώνεται… + Ημερ. διορθώθηκε με επιτυχία Φιλτράρισμα πολυμέσων Εικόνες Βίντεο GIFs - RAW images + RAW Εικόνες Δεν βρέθηκε κανένα αρχείο πολυμέσων με τα επιλεγμένα φίλτρα. Αλλαγή φίλτρων - Αυτή η λειτουργικότητα κρύβει τον φάκελο προσθέτοντας ένα \'.nomedia\' αρχείο μέσα του, θα κρύψει και όλους τους υποφακέλους επίσης. Μπορείτε να τους δείτε με την επιλογή του \'Εμφάνιση κρυφών δεδομένων\' στις Ρυθμίσεις. Συνέχεια? + Αυτή η λειτουργία κρύβει τον φάκελο προσθέτοντας ένα \".nomedia\" αρχείο μέσα του, θα κρύψει και όλους τους υποφακέλους επίσης. Μπορείτε να τους δείτε με την επιλογή του \'Εμφάνιση κρυφών δεδομένων\' στις Ρυθμίσεις. Συνέχεια? Εξαίρεση Εξαίρεση φακέλων Διαχείριση εξαιρεμένων φακέλων @@ -72,30 +72,30 @@ Επεξεργαστής Αποθήκευση - Γύρισμα - Μονοπάτι - Λάθος μονοπάτι εικόνας + Περιστροφή + Διαδρομή + Μη έγκυρη διαδρομή εικόνας Η επεξεργασία εικόνας απέτυχε Επεξεργασία εικόνας με: - Δεν βρέθηκε επεργαστής για τις εικόνες + Δεν βρέθηκε επεργαστής εικόνων Άγνωστη τοποθεσία αρχείου Δεν ήταν δυνατή η αντικατάσταση του αρχείου πηγής - Στροφή αριστερά - Στροφή δεξιά - Στροφή κατά 180º + Περιστροφή αριστερά + Περιστροφή δεξιά + Περιστροφή κατά 180º Αναποδογύρισμα Οριζόντιο αναποδογύρισμα Κατακόρυφο αναποδογύρισμα Επεξεργασία με - Free + Ελεύθερο Simple Wallpaper Εφαρμογή ως ταπετσαρία Η εφαρμογή ως ταπετσαρία απέτυχε Εφαρμογή ως ταπετσαρία με: - Εφαρμογή ταπετσαρίας… - Εφαρμογή ταπετσαρίας επιτυχώς + Η ταπετσαρία εφαρμόζεται... + Η ταπετσαρία εφαρμόστηκε Αναλογία σε κατακόρυφη προβολή Αναλογία σε οριζόντια προβολή Αρχική οθόνη @@ -103,8 +103,8 @@ Αρχική οθόνη και κλειδώματος - Προβολή εικόνων - Χρόνος επανάληψης (δευτερόλεπτα): + Παρουσίαση διαφανιών + Χρόνος επανάληψης (δευτ.) : Συμπερίληψη φωτογραφιών Συμπερίληψη βίντεο Συμπερίληψη GIFs6 @@ -122,22 +122,22 @@ Ομαδοποίηση υποφακέλων - Group by - Do not group files - Folder - Last modified - Date taken - File type - Extension + Ομαδοποίηση κατά + Χωρίς + Φάκελο + Τελευταία τροποποίηση + Ημερομηνία λήψης + Τύπο αρχείου + Επέκταση Αυτόματη αναπαραγωγή βίντεο - Αλλαγή ορατότητας ονόματος αρχείων + Αλλαγή προβολής ονόματος αρχείων Επανάληψη βίντεο Εμφάνιση κινούμενων GIFs στα εικονίδια - Μέγιστη φωτεινότητα κατά την θέαση πλήρους οθόνης + Μέγιστη φωτεινότητα κατά την προβολή πλήρους οθόνης Κόψιμο εικονιδίων σε τετράγωνα - Γύρισμα των πολυμέσων πλήρους οθόνης με + Περιστροφή σε πλήρη οθόνη απο Ρυθμίσεις συστήματος Περιστροφή συσκευής Αναλογία εικόνας @@ -148,28 +148,28 @@ Να επιτρέπεται ο έλεγχος φωτεινότητας με κατακόρυφες κινήσεις Να επιτρέπεται ο έλεγχος έντασης του βίντεο και φωτεινότητας με κατακόρυφες κινήσεις (gestures) - Εμφάνιση του πλήθους των πολυμέσων σε φάκελο, στην κύρια οθόνη + Εμφάνιση του αριθμού πολυμέσων στον φάκελο, στην κύρια οθόνη Αντικατάσταση της "Κοινής χρήσης" με "Περιστροφή" στο μενού πλήρους οθόνης Εμφάνιση λεπτομερειών στα πολυμέσα σε κατάσταση πλήρους οθόνης Διαχείριση εκτεταμένων λεπτομερειών Να επιτρέπεται μεγένθυση με ένα δάχτυλο σε πλήρη οθόνη Να επιτρέπεται η άμεση αλλαγή των μέσων με το άγγιγμα στις άκρες της οθόνης - Allow deep zooming images + Επιτρέπει βαθύ ζουμ στις εικόνες Απόκρυψη λεπτομερειών όταν η μπάρα κατάστασης είναι κρυμμένη Επιπλέον έλεγχος για την αποφυγή εμφάνισης λανθασμένων αρχείων - Show some action buttons at the bottom of the screen - Show the Recycle Bin at the folders screen + Εμφάνιση μερικών κουμπιών λειτουργιών στο κάτω μέρος της οθόνης + Εμφάνιση του κάδου ανακύκλωσης στην οθόνη φακέλων Εικονίδια Πολυμέσα πλήρους οθόνης Περισσότερες λεπτομέρειες - Bottom actions + Λειτουργίες στο κάτω μέρος - Manage visible bottom actions - Toggle favorite - Toggle file visibility + Διαχείρηση εμφάνισης λειτουργιών + Εναλλαγή αγαπημένων + Εναλλαγή προβολής αρχείου Πώς μπορώ να κάνω το Simple Gallery προκαθορισμένη εφαρμογή συλλογής πολυμέσων; @@ -192,24 +192,24 @@ Αυτό θα κάνει ορατούς μόνο τους επιλεγμένους φακέλους, καθώς η εξαίρεση και η συμπερίληψη λειτουργούν αναδρομικά και αν ενας φάκελος ανήκει και στα δύο, θα εμφανιστεί. Οι εικόνες πλήρους οθόνης έχουν κάποια περίεργα σημάδια. Μπορώ κάπως να βελτιώσω την ποιότητα; Ναι. Υπάρχει ένας διακόπτης στις Ρυθμίσεις με το κείμενο \"Αντικατάσταση των φωτογραφιών που απαιτούν ζούμ με άλλες καλύτερης ποιότητας\". Μπορείτε να χρησιμοποιήσετε αυτό. Θα βελτιώσει την ποιότητα των φωτογραφιών, αλλά θα θολώσουν στο μεγάλο ζουμ. - Can I somehow group media file thumbnails? - Sure, just use the \"Group by\" menu item while at the thumbnails view. You can group files by multiple criteria, including Date Taken. If you use the \"Show all folders content\" function you can group them by folders too. - Sorting by Date Taken doesn\'t seem to work properly, how can I fix it? - It is most likely caused by the files being copied from somewhere. You can fix it by selecting the file thumbnails and selecting \"Fix Date Taken value\". + Μπορώ να ομαδοποιήσω κάπως τις μικρογραφίες των αρχείων πολυμέσων? + Σίγουρα, απλά με την χρήση \"Ομαδοποίηση κατά\" Επέκταση ή Τύπο αρχείου. Μπορείτε την ομαδοποίηση με πολλά κριτήρια, συμπεριλαμβανομένης της ημερομηνίας λήψης. Εάν χρησιμοποιείτε τη λειτουργία \"Εμφάνιση όλων των περιεχομένων στο φάκελο\" μπορείτε να ομαδοποιήσετε και τους φακέλους επίσης. + Η ταξινόμηση κατά ημερομηνία δεν φαίνεται να λειτουργεί σωστά, πώς μπορώ να τη διορθώσω? + Αυτό πιθανότατα προκαλείται από την αντιγραφή των αρχείων από κάπου. Μπορείτε να το διορθώσετε επιλέγοντας τις μικρογραφίες αρχείων και επιλέγοντας \"Επιδιόρθωση ημερ. λήψης\". - Μία γκάλερι για την προβολή φωτογραφιών και βίντεο χωρίς διαφημίσεις. + Μία Gallery για την προβολή φωτογραφιών και βίντεο χωρίς διαφημίσεις. - Μία απλή εφαρμογή για την εμφάνιση φωτογραφιών και βίντεο. Τα αντικείμενα μπορούνα να ταξινομηθούν με βάση την ημερ/νία, το μέγεθος και το όνομα με αύξουσα ή φθήνουσα σειρά, οι φωτογραφίες μπορούν να μεγεθυνθούν. Τα αρχεία πολυμέσων εμφανίζονται σε πολλαπλές στήλες ανάλογα με τον μέγεθος της οθόνης και μπορείτε να αλλάξετε το πλήθος των στηλών με τα 2 δάχτυλα (pintch). Μπορούν να μετονομαστούν, να μοιραστούν, να διαγραφούν, να αντιγραφούν και να μετακινηθούν. Οι εικόνες επίσης μπορούν να κοπούν, να περιστραφούν, να αντιστραφούν ή να οριστούν ως ταπετσαρίες κατευθείαν από την εφαρμογή. + Μία απλή εφαρμογή για την προβολή φωτογραφιών και βίντεο. Τα αντικείμενα μπορούνα να ταξινομηθούν με βάση την ημερ/νία, το μέγεθος και το όνομα με αύξουσα ή φθήνουσα σειρά, οι φωτογραφίες μπορούν να μεγεθυνθούν. Τα αρχεία πολυμέσων εμφανίζονται σε πολλαπλές στήλες ανάλογα με τον μέγεθος της οθόνης και μπορείτε να αλλάξετε τον αριθμό των στηλών με τα 2 δάχτυλα (pintch). Μπορούν να μετονομαστούν, να μοιραστούν, να διαγραφούν, να αντιγραφούν και να μετακινηθούν. Οι εικόνες επίσης μπορούν να κοπούν, να περιστραφούν, να αντιστραφούν ή να οριστούν ως ταπετσαρίες κατευθείαν από την εφαρμογή. - Η γκάλερι επίσης μπορεί να χρησιμοποιηθεί από άλλες εφαρμογές για προεμφάνιση φωτογραφιών / βίντεο, να μπουν ως επισυνάψεις σε εφαρμογές email κλπ. Είναι τέλεια για καθημερινή χρήση. + Η Gallery επίσης μπορεί να χρησιμοποιηθεί από άλλες εφαρμογές για προεμφάνιση φωτογραφιών / βίντεο, να μπουν ως επισυνάψεις σε εφαρμογές email κλπ. Είναι τέλεια για καθημερινή χρήση. - Το δικαίωμα δαχτυλικού αποτυπώματος χρειάζεται για το κλείδωμα των κρυφών αντικειμένων ή ολόκληρης της εφαρμογής. + Η εξουσιοδότηση δαχτυλικού αποτυπώματος χρειάζεται για το κλείδωμα των κρυφών αντικειμένων ή ολόκληρης της εφαρμογής. - Δεν περιέχει διαφημίσεις ή περιττά δικαιώματα. Έιναι όλη ανοιχτού κώδικα και δίνει την δυνατότητα επιλογής των χρωμάτων της εφαρμογής. + Δεν περιέχει διαφημίσεις ή περιττά δικαιώματα. Έιναι όλη ανοιχτού κώδικα και παρέχει προσαρμόσιμα χρώματα για την εφαρμογή. - Αυτή η εφαργμογή είναι κομμάτι μιας σειρά εφαρμογών. Μπορείτε να βρείτε τις υπόλοιπες στο https://www.simplemobiletools.com + Αυτή η εφαργμογή είναι μέρος μιας σειράς εφαρμογών. Μπορείτε να βρείτε τις υπόλοιπες στο https://www.simplemobiletools.com Filtra i media @@ -87,7 +87,8 @@ Capovolgi orizzontalmente Capovolgi verticalmente Modifica con - Free + Libero Sfondo semplice @@ -153,11 +154,11 @@ Gestisci le informazioni estese Abilita zoom con un dito su media a schermo intero Cambia media istantaneamente toccando sui lati dello schermo - Allow deep zooming images + Permetti zoom immagini profondo Nascondi i dettagli estesi quando la barra di stato è nascosta Fai un controllo ulteriore per evitare di mostrare file non validi Mostra alcuni pulsanti azione in fondo allo schermo - Show the Recycle Bin at the folders screen + Mostra il cestino nella schermata delle cartelle Miniature @@ -195,8 +196,10 @@ Sì, puoi ritagliare le immagini nell\'editor, trascinando gli angoli dell\'immagine. Puoi usare l\'editor sia premendo a lungo la miniatura di un\'immagine e selezionando Modifica, o selezionando Modifica mentre la vedi a schermo intero. Posso raggruppare in qualche modo le miniature dei file? Certo, usa il menu \"Raggruppa per\" mentre visualizzi le miniature. Puoi raggruppare i file con diversi criteri, incluso la data di creazione. Se utilizzi la funzione \"Mostra tutti i contenuti\" puoi anche raggrupparli per cartelle. - Sorting by Date Taken doesn\'t seem to work properly, how can I fix it? - It is most likely caused by the files being copied from somewhere. You can fix it by selecting the file thumbnails and selecting \"Fix Date Taken value\". + L\'ordinamento per data acquisizione sembra non funzionare bene, come posso +risolvere? + Probabilmente è causato dai file copiati da altre parti. Puoi risolvere selezionando +le miniature dei file e scegliendo \"Correggi valore Data acquisizione\". From a9df89e4726471e7ceb2a45926a4196cb5dd73f4 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sun, 12 Aug 2018 15:49:43 +0200 Subject: [PATCH 58/90] removing some new lines --- app/src/main/res/values-it/strings.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a85a9cf12..1022de23a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -196,10 +196,8 @@ Sì, puoi ritagliare le immagini nell\'editor, trascinando gli angoli dell\'immagine. Puoi usare l\'editor sia premendo a lungo la miniatura di un\'immagine e selezionando Modifica, o selezionando Modifica mentre la vedi a schermo intero. Posso raggruppare in qualche modo le miniature dei file? Certo, usa il menu \"Raggruppa per\" mentre visualizzi le miniature. Puoi raggruppare i file con diversi criteri, incluso la data di creazione. Se utilizzi la funzione \"Mostra tutti i contenuti\" puoi anche raggrupparli per cartelle. - L\'ordinamento per data acquisizione sembra non funzionare bene, come posso -risolvere? - Probabilmente è causato dai file copiati da altre parti. Puoi risolvere selezionando -le miniature dei file e scegliendo \"Correggi valore Data acquisizione\". + L\'ordinamento per data acquisizione sembra non funzionare bene, come posso risolvere? + Probabilmente è causato dai file copiati da altre parti. Puoi risolvere selezionando le miniature dei file e scegliendo \"Correggi valore Data acquisizione\". From cd3481de3d583525bc59df9c2df17e9e0503774f Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sun, 12 Aug 2018 15:50:07 +0200 Subject: [PATCH 59/90] removing one more new line --- app/src/main/res/values-it/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1022de23a..167e293de 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -87,8 +87,7 @@ Capovolgi orizzontalmente Capovolgi verticalmente Modifica con - Libero + Libero Sfondo semplice From 6a30cbb14c5df23eb91b166d919658090758ba4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Sun, 12 Aug 2018 19:56:49 +0100 Subject: [PATCH 60/90] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c5ba730f2..264c84891 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -24,20 +24,20 @@ Brilho Bloquear orientação Desbloquear orientação - Change orientation - Force portrait - Force landscape - Use default orientation - Fix Date Taken value - Fixing… - Dates fixed successfully + Alterar orientação + Impor modo vertical + Impor modo horizontal + Usar predefinição + Corrigir data de obtenção + A corrigir… + Dados corrigidos com sucesso Filtrar multimédia Imagens Vídeos GIF - RAW images + Imagens RAW Não foram encontrados ficheiros que cumpram os requisitos. Alterar filtros @@ -87,7 +87,7 @@ Horizontalmente Verticalmente Editar com - Free + Livre Simple Wallpaper @@ -119,16 +119,16 @@ Tipo de exibição Grelha Lista - Group direct subfolders + Agrupar sub-pastas - Group by - Do not group files - Folder - Last modified - Date taken - File type - Extension + Agrupar por + Não agrupar ficheiros + Pasta + Última modificação + Data de obtenção + Tipo de ficheiro + Extensão Reproduzir vídeos automaticamente @@ -156,19 +156,19 @@ Allow deep zooming images Ocultar detalhes extra se a barra de estado estiver oculta Efetuar uma dupla verificação para evitar mostrar os ficheiros inválidos - Show some action buttons at the bottom of the screen - Show the Recycle Bin at the folders screen + Mostrar alguns botões de ação na base do ecrã + Mostrar reciclagem no ecrã de pastas Miniaturas Multimédia em ecrã completo Detalhes extra - Bottom actions + Ações em baixo - Manage visible bottom actions - Toggle favorite - Toggle file visibility + Gerir botões de ação + Alternar favoritos + Alternar visibilidade dos ficheiros How can I make Simple Gallery the default device gallery? From 51472efb8914a93fd9f3485bfecef6f13463554c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 21:31:52 +0200 Subject: [PATCH 61/90] update commons to 4.6.7 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0ed8150fd..81b1e9966 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.6.4' + implementation 'com.simplemobiletools:commons:4.6.7' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' From 9aaee4e6488f0cdf7ecea34129305623b880e4dd Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 21:37:06 +0200 Subject: [PATCH 62/90] fix #904, properly show images with hashtag in their path --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 122ed6e6a..8da153963 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -265,7 +265,8 @@ class PhotoFragment : ViewPagerFragment() { targetHeight = (targetHeight * 0.8).toInt() } - val pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" + var pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" + pathToLoad = pathToLoad.replace("#", "%23") val picasso = Picasso.get() .load(pathToLoad) .centerInside() From c708f183e2bd4dafc401bfc995c98d1063806cbf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 21:41:13 +0200 Subject: [PATCH 63/90] encode percent sign at file paths too --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 8da153963..60f6e9471 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -266,7 +266,7 @@ class PhotoFragment : ViewPagerFragment() { } var pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" - pathToLoad = pathToLoad.replace("#", "%23") + pathToLoad = pathToLoad.replace("%", "%25").replace("#", "%23") val picasso = Picasso.get() .load(pathToLoad) .centerInside() From 99f4a65dc11c77d7131f424a28d021ab1467b266 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 21:43:24 +0200 Subject: [PATCH 64/90] wrap whole picasso loading in a try/catch block --- .../gallery/fragments/PhotoFragment.kt | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 60f6e9471..1337c765f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -267,25 +267,29 @@ class PhotoFragment : ViewPagerFragment() { var pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" pathToLoad = pathToLoad.replace("%", "%25").replace("#", "%23") - val picasso = Picasso.get() - .load(pathToLoad) - .centerInside() - .resize(targetWidth, targetHeight) - if (degrees != 0) { - picasso.rotate(degrees.toFloat()) - } + try { + val picasso = Picasso.get() + .load(pathToLoad) + .centerInside() + .resize(targetWidth, targetHeight) - picasso.into(view.photo_view, object : Callback { - override fun onSuccess() { - view.photo_view.isZoomable = degrees != 0 || context?.config?.allowZoomingImages == false - if (isFragmentVisible && degrees == 0) { - scheduleZoomableView() - } + if (degrees != 0) { + picasso.rotate(degrees.toFloat()) } - override fun onError(e: Exception) {} - }) + picasso.into(view.photo_view, object : Callback { + override fun onSuccess() { + view.photo_view.isZoomable = degrees != 0 || context?.config?.allowZoomingImages == false + if (isFragmentVisible && degrees == 0) { + scheduleZoomableView() + } + } + + override fun onError(e: Exception) {} + }) + } catch (ignored: Exception) { + } } private fun openPanorama() { From fe69f400ab5dedc3331211344f27e1ce0359cee5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 22:19:45 +0200 Subject: [PATCH 65/90] remove the glide photoview clearing --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 1337c765f..a39c630f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -16,7 +16,6 @@ import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import com.bumptech.glide.Glide import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* @@ -437,7 +436,6 @@ class PhotoFragment : ViewPagerFragment() { override fun onDestroyView() { super.onDestroyView() if (activity?.isActivityDestroyed() == false) { - Glide.with(context!!).clear(view.photo_view) view.subsampling_view.recycle() } loadZoomableViewHandler.removeCallbacksAndMessages(null) From f01410bb1e9dae1ffe2edae324f7bbb52c3c16e0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Aug 2018 23:40:17 +0200 Subject: [PATCH 66/90] fix #911, try using Glide for image loading, if Picasso fails --- .../gallery/fragments/PhotoFragment.kt | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index a39c630f5..e87f90478 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -16,6 +16,13 @@ import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import com.bumptech.glide.Glide +import com.bumptech.glide.load.DataSource +import com.bumptech.glide.load.DecodeFormat +import com.bumptech.glide.load.engine.DiskCacheStrategy +import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.request.RequestListener +import com.bumptech.glide.request.RequestOptions import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.simplemobiletools.commons.extensions.* @@ -285,12 +292,45 @@ class PhotoFragment : ViewPagerFragment() { } } - override fun onError(e: Exception) {} + override fun onError(e: Exception) { + tryLoadingWithGlide() + } }) } catch (ignored: Exception) { } } + private fun tryLoadingWithGlide() { + var targetWidth = if (ViewPagerActivity.screenWidth == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth + var targetHeight = if (ViewPagerActivity.screenHeight == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight + + if (imageOrientation == ORIENTATION_ROTATE_90) { + targetWidth = targetHeight + targetHeight = com.bumptech.glide.request.target.Target.SIZE_ORIGINAL + } + + val options = RequestOptions() + .signature(medium.path.getFileSignature()) + .format(DecodeFormat.PREFER_ARGB_8888) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE) + .override(targetWidth, targetHeight) + + Glide.with(this) + .asBitmap() + .load(getPathToLoad(medium)) + .apply(options) + .listener(object : RequestListener { + override fun onLoadFailed(e: GlideException?, model: Any?, target: com.bumptech.glide.request.target.Target?, isFirstResource: Boolean): Boolean = false + + override fun onResourceReady(resource: Bitmap?, model: Any?, target: com.bumptech.glide.request.target.Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { + if (isFragmentVisible) { + scheduleZoomableView() + } + return false + } + }).into(view.photo_view) + } + private fun openPanorama() { Intent(context, PanoramaActivity::class.java).apply { putExtra(PATH, medium.path) From 0ced7023f15a45249e2cc66c820e31517631b2f4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 14 Aug 2018 09:10:21 +0200 Subject: [PATCH 67/90] fix #913, at fixing the Date Taken value update it at Favorite items too --- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 +++ .../com/simplemobiletools/gallery/interfaces/MediumDao.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 096cebbec..c8c9f1dfb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -292,6 +292,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList() + val mediumDao = activity.galleryDB.MediumDao() val paths = getSelectedPaths() for (path in paths) { val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue @@ -312,6 +313,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList Date: Tue, 14 Aug 2018 10:12:51 +0200 Subject: [PATCH 68/90] fix #901, make sure "Temporarily show hidden" persists through device rotation --- .../gallery/activities/MainActivity.kt | 17 ++++++++++------- .../gallery/activities/MediaActivity.kt | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 33cb4bf9c..7e24ff8bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -85,8 +85,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { mMediumDao = galleryDB.MediumDao() mDirectoryDao = galleryDB.DirectoryDao() - config.temporarilyShowHidden = false - config.tempSkipDeleteConfirmation = false + if (savedInstanceState == null) { + config.temporarilyShowHidden = false + config.tempSkipDeleteConfirmation = false + removeTempFolder() + } + mIsPickImageIntent = isPickImageIntent(intent) mIsPickVideoIntent = isPickVideoIntent(intent) mIsGetImageContentIntent = isGetImageContentIntent(intent) @@ -97,7 +101,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent || mIsSetWallpaperIntent - removeTempFolder() directories_refresh_layout.setOnRefreshListener { getDirectories() } storeStateVariables() checkWhatsNewDialog() @@ -216,11 +219,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { override fun onDestroy() { super.onDestroy() - config.temporarilyShowHidden = false - config.tempSkipDeleteConfirmation = false - mTempShowHiddenHandler.removeCallbacksAndMessages(null) - removeTempFolder() if (!isChangingConfigurations) { + config.temporarilyShowHidden = false + config.tempSkipDeleteConfirmation = false + mTempShowHiddenHandler.removeCallbacksAndMessages(null) + removeTempFolder() GalleryDatabase.destroyInstance() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 3fb257835..da35cc221 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -188,7 +188,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { override fun onDestroy() { super.onDestroy() - if (config.showAll) { + if (config.showAll && !isChangingConfigurations) { config.temporarilyShowHidden = false config.tempSkipDeleteConfirmation = false } From 44f171bbf511b283be52c07db7de295e10f70bf9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 14 Aug 2018 12:27:39 +0200 Subject: [PATCH 69/90] fix #900, handle one finger zooming toggle at PhotoView too --- app/build.gradle | 4 +++- .../simplemobiletools/gallery/activities/SettingsActivity.kt | 1 - .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 81b1e9966..5c264e4d1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,6 @@ dependencies { implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.12' - implementation 'com.github.chrisbanes:PhotoView:2.1.4' implementation 'com.android.support.constraint:constraint-layout:1.1.2' implementation 'com.google.android.exoplayer:exoplayer-core:2.8.2' implementation 'com.google.vr:sdk-panowidget:1.150.0' @@ -67,6 +66,9 @@ dependencies { //implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0' implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.0-fork' + // implementation 'com.github.chrisbanes:PhotoView:2.1.4' + implementation 'com.github.tibbi:PhotoView:2.1.4-fork' + debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4e17609c7..596b79ffc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -336,7 +336,6 @@ class SettingsActivity : SimpleActivity() { } private fun setupAllowZoomingImages() { - settings_one_finger_zoom_holder.beVisibleIf(config.allowZoomingImages) settings_allow_zooming_images.isChecked = config.allowZoomingImages settings_allow_zooming_images_holder.setOnClickListener { settings_allow_zooming_images.toggle() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index e87f90478..1ab3c2ef6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -155,6 +155,7 @@ class PhotoFragment : ViewPagerFragment() { photo_brightness_controller.beVisibleIf(allowPhotoGestures) instant_prev_item.beVisibleIf(allowInstantChange) instant_next_item.beVisibleIf(allowInstantChange) + photo_view.setAllowFingerDragZoom(activity!!.config.oneFingerZoom) } storeStateVariables() From 5d1b233e4e9f3aa2c9e37fefd69d57b457746efe Mon Sep 17 00:00:00 2001 From: spkprs Date: Tue, 14 Aug 2018 22:33:14 +0300 Subject: [PATCH 70/90] correction --- 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 bdef2cb20..127f2e692 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -209,7 +209,7 @@ Δεν περιέχει διαφημίσεις ή περιττά δικαιώματα. Έιναι όλη ανοιχτού κώδικα και παρέχει προσαρμόσιμα χρώματα για την εφαρμογή. - Αυτή η εφαργμογή είναι μέρος μιας σειράς εφαρμογών. Μπορείτε να βρείτε τις υπόλοιπες στο https://www.simplemobiletools.com + Αυτή η εφαρμογή είναι μέρος μιας σειράς εφαρμογών. Μπορείτε να βρείτε τις υπόλοιπες στο https://www.simplemobiletools.com From d2f5fdfd03d0e26a4aaeda43943886f2eeacd73a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 20:20:59 +0200 Subject: [PATCH 72/90] fix #67, show SVG files --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 4 +-- .../gallery/activities/MediaActivity.kt | 2 +- .../gallery/activities/PhotoVideoActivity.kt | 3 +- .../gallery/activities/ViewPagerActivity.kt | 2 +- .../gallery/adapters/DirectoryAdapter.kt | 7 +++-- .../gallery/dialogs/FilterMediaDialog.kt | 8 ++--- .../gallery/extensions/ArrayList.kt | 9 +++--- .../gallery/extensions/Context.kt | 6 ++-- .../gallery/helpers/Config.kt | 2 +- .../gallery/helpers/Constants.kt | 1 + .../gallery/helpers/MediaFetcher.kt | 29 +++++++++++++++---- .../gallery/models/Medium.kt | 2 ++ .../gallery/receivers/RefreshMediaReceiver.kt | 8 ++--- .../main/res/layout/dialog_filter_media.xml | 8 +++++ app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-ca/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-gl/strings.xml | 1 + app/src/main/res/values-hr/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko-rKR/strings.xml | 1 + app/src/main/res/values-lt/strings.xml | 1 + app/src/main/res/values-nb/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 43 files changed, 91 insertions(+), 30 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5c264e4d1..99bd79aab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.6.7' + implementation 'com.simplemobiletools:commons:4.6.13' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 7e24ff8bd..825a396fa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -423,7 +423,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val pathsToDelete = ArrayList() fileDirItems.filter { it.isDirectory }.forEach { val files = File(it.path).listFiles() - files?.filter { it.absolutePath.isImageVideoGif() }?.mapTo(pathsToDelete) { it.absolutePath } + files?.filter { it.absolutePath.isMediaFile() }?.mapTo(pathsToDelete) { it.absolutePath } } movePathsInRecycleBin(pathsToDelete, mMediumDao) { @@ -909,7 +909,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { invalidDirs.add(it) } else if (it.path != config.tempFolderPath) { val children = if (it.path.startsWith(OTG_PATH)) getOTGFolderChildrenNames(it.path) else File(it.path).list()?.asList() - val hasMediaFile = children?.any { it.isImageVideoGif() } ?: false + val hasMediaFile = children?.any { it.isMediaFile() } ?: false if (!hasMediaFile) { invalidDirs.add(it) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index da35cc221..3662aae3e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -832,7 +832,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } override fun tryDeleteFiles(fileDirItems: ArrayList) { - val filtered = fileDirItems.filter { it.path.isImageVideoGif() } as ArrayList + val filtered = fileDirItems.filter { it.path.isMediaFile() } as ArrayList val deletingItems = resources.getQuantityString(R.plurals.deleting_items, filtered.size, filtered.size) toast(deletingItems) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt index a3657295d..602130cac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/PhotoVideoActivity.kt @@ -91,7 +91,8 @@ open class PhotoVideoActivity : SimpleActivity(), ViewPagerFragment.FragmentList filename.isImageFast() -> TYPE_IMAGES filename.isVideoFast() -> TYPE_VIDEOS filename.isGif() -> TYPE_GIFS - else -> TYPE_RAWS + filename.isRawFast() -> TYPE_RAWS + else -> TYPE_SVGS } mMedium = Medium(null, filename, mUri.toString(), mUri!!.path.getParentPath(), 0, 0, file.length(), type, false, 0L) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 75690a206..843554e6d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -913,7 +913,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun deleteConfirmed() { val path = getCurrentMedia().getOrNull(mPos)?.path ?: return - if (getIsPathDirectory(path) || !path.isImageVideoGif()) { + if (getIsPathDirectory(path) || !path.isMediaFile()) { return } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index d10ee9244..b419b121c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -350,7 +350,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList { val paths = ArrayList() activity.getOTGFolderChildren(path)?.forEach { - if (!it.isDirectory && it.name.isImageVideoGif() && (showHidden || !it.name.startsWith('.'))) { + if (!it.isDirectory && it.name.isMediaFile() && (showHidden || !it.name.startsWith('.'))) { val relativePath = it.uri.path.substringAfterLast("${activity.config.OTGPartition}:") paths.add("$OTG_PATH$relativePath") } @@ -524,7 +524,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList TYPE_IMAGES directory.tmb.isVideoFast() -> TYPE_VIDEOS directory.tmb.isGif() -> TYPE_GIFS - else -> TYPE_RAWS + directory.tmb.isRawFast() -> TYPE_RAWS + else -> TYPE_SVGS } activity.loadImage(thumbnailType, directory.tmb, dir_thumbnail, scrollHorizontally, animateGifs, cropThumbnails) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt index 4c1925b04..18b404505 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt @@ -5,10 +5,7 @@ import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.config -import com.simplemobiletools.gallery.helpers.TYPE_GIFS -import com.simplemobiletools.gallery.helpers.TYPE_IMAGES -import com.simplemobiletools.gallery.helpers.TYPE_RAWS -import com.simplemobiletools.gallery.helpers.TYPE_VIDEOS +import com.simplemobiletools.gallery.helpers.* import kotlinx.android.synthetic.main.dialog_filter_media.view.* class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { @@ -21,6 +18,7 @@ class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: filter_media_videos.isChecked = filterMedia and TYPE_VIDEOS != 0 filter_media_gifs.isChecked = filterMedia and TYPE_GIFS != 0 filter_media_raws.isChecked = filterMedia and TYPE_RAWS != 0 + filter_media_svgs.isChecked = filterMedia and TYPE_SVGS != 0 } AlertDialog.Builder(activity) @@ -41,6 +39,8 @@ class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: result += TYPE_GIFS if (view.filter_media_raws.isChecked) result += TYPE_RAWS + if (view.filter_media_svgs.isChecked) + result += TYPE_SVGS activity.config.filterMedia = result callback(result) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt index 5d221bffa..6a25113e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt @@ -1,9 +1,6 @@ package com.simplemobiletools.gallery.extensions -import com.simplemobiletools.gallery.helpers.TYPE_GIFS -import com.simplemobiletools.gallery.helpers.TYPE_IMAGES -import com.simplemobiletools.gallery.helpers.TYPE_RAWS -import com.simplemobiletools.gallery.helpers.TYPE_VIDEOS +import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium fun ArrayList.getDirMediaTypes(): Int { @@ -24,5 +21,9 @@ fun ArrayList.getDirMediaTypes(): Int { types += TYPE_RAWS } + if (any { it.isSvg() }) { + types += TYPE_SVGS + } + return types } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 5a768e1be..aefeb8dfc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -305,7 +305,8 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: (filterMedia and TYPE_IMAGES != 0 && it.types and TYPE_IMAGES != 0) || (filterMedia and TYPE_VIDEOS != 0 && it.types and TYPE_VIDEOS != 0) || (filterMedia and TYPE_GIFS != 0 && it.types and TYPE_GIFS != 0) || - (filterMedia and TYPE_RAWS != 0 && it.types and TYPE_RAWS != 0) + (filterMedia and TYPE_RAWS != 0 && it.types and TYPE_RAWS != 0) || + (filterMedia and TYPE_SVGS != 0 && it.types and TYPE_SVGS != 0) } }) as ArrayList @@ -360,7 +361,8 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag (filterMedia and TYPE_IMAGES != 0 && it.type == TYPE_IMAGES) || (filterMedia and TYPE_VIDEOS != 0 && it.type == TYPE_VIDEOS) || (filterMedia and TYPE_GIFS != 0 && it.type == TYPE_GIFS) || - (filterMedia and TYPE_RAWS != 0 && it.type == TYPE_RAWS) + (filterMedia and TYPE_RAWS != 0 && it.type == TYPE_RAWS) || + (filterMedia and TYPE_SVGS != 0 && it.type == TYPE_SVGS) } }) as ArrayList diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index ea722dd2b..ffee3cab3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -174,7 +174,7 @@ class Config(context: Context) : BaseConfig(context) { set(darkBackground) = prefs.edit().putBoolean(DARK_BACKGROUND, darkBackground).apply() var filterMedia: Int - get() = prefs.getInt(FILTER_MEDIA, TYPE_IMAGES or TYPE_VIDEOS or TYPE_GIFS or TYPE_RAWS) + get() = prefs.getInt(FILTER_MEDIA, TYPE_IMAGES or TYPE_VIDEOS or TYPE_GIFS or TYPE_RAWS or TYPE_SVGS) set(filterMedia) = prefs.edit().putInt(FILTER_MEDIA, filterMedia).apply() var dirColumnCnt: Int diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 035396202..c7a3eb776 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -120,6 +120,7 @@ const val TYPE_IMAGES = 1 const val TYPE_VIDEOS = 2 const val TYPE_GIFS = 4 const val TYPE_RAWS = 8 +const val TYPE_SVGS = 16 const val LOCAITON_INTERNAL = 1 const val LOCATION_SD = 2 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index c63840b80..41b5f899d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -78,6 +78,10 @@ class MediaFetcher(val context: Context) { } } + if (filterMedia and TYPE_SVGS != 0) { + query.append("${MediaStore.Images.Media.DATA} LIKE ? OR ") + } + var selectionQuery = query.toString().trim().removeSuffix("OR") selectionQuery += ") AND " return selectionQuery @@ -107,6 +111,10 @@ class MediaFetcher(val context: Context) { } } + if (filterMedia and TYPE_SVGS != 0) { + args.add("%.svg") + } + return args } @@ -188,8 +196,9 @@ class MediaFetcher(val context: Context) { val isVideo = if (isImage) false else filename.isVideoFast() val isGif = if (isImage || isVideo) false else filename.isGif() val isRaw = if (isImage || isVideo || isGif) false else filename.isRawFast() + val isSvg = if (isImage || isVideo || isGif || isRaw) false else filename.isSvg() - if (!isImage && !isVideo && !isGif && !isRaw) + if (!isImage && !isVideo && !isGif && !isRaw && !isSvg) continue if (isVideo && (isPickImage || filterMedia and TYPE_VIDEOS == 0)) @@ -204,6 +213,9 @@ class MediaFetcher(val context: Context) { if (isRaw && filterMedia and TYPE_RAWS == 0) continue + if (isSvg && filterMedia and TYPE_SVGS == 0) + continue + if (!showHidden && filename.startsWith('.')) continue @@ -228,7 +240,8 @@ class MediaFetcher(val context: Context) { isImage -> TYPE_IMAGES isVideo -> TYPE_VIDEOS isGif -> TYPE_GIFS - else -> TYPE_RAWS + isRaw -> TYPE_RAWS + else -> TYPE_SVGS } val isFavorite = favoritePaths.contains(path) @@ -255,8 +268,9 @@ class MediaFetcher(val context: Context) { val isVideo = if (isImage) false else filename.isVideoFast() val isGif = if (isImage || isVideo) false else filename.isGif() val isRaw = if (isImage || isVideo || isGif) false else filename.isRawFast() + val isSvg = if (isImage || isVideo || isGif || isRaw) false else filename.isSvg() - if (!isImage && !isVideo && !isGif || !isRaw) + if (!isImage && !isVideo && !isGif && !isRaw && !isSvg) continue if (isVideo && (isPickImage || filterMedia and TYPE_VIDEOS == 0)) @@ -271,6 +285,9 @@ class MediaFetcher(val context: Context) { if (isRaw && filterMedia and TYPE_RAWS == 0) continue + if (isSvg && filterMedia and TYPE_SVGS == 0) + continue + if (!showHidden && filename.startsWith('.')) continue @@ -285,7 +302,8 @@ class MediaFetcher(val context: Context) { isImage -> TYPE_IMAGES isVideo -> TYPE_VIDEOS isGif -> TYPE_GIFS - else -> TYPE_RAWS + isRaw -> TYPE_RAWS + else -> TYPE_SVGS } val path = Uri.decode(file.uri.toString().replaceFirst("${context.config.OTGTreeUri}/document/${context.config.OTGPartition}%3A", OTG_PATH)) @@ -417,7 +435,8 @@ class MediaFetcher(val context: Context) { TYPE_IMAGES -> R.string.images TYPE_VIDEOS -> R.string.videos TYPE_GIFS -> R.string.gifs - else -> R.string.raw_images + TYPE_RAWS -> R.string.raw_images + else -> R.string.svgs } return context.getString(stringId) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 09cd72e85..4728a21a5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -40,6 +40,8 @@ data class Medium( fun isRaw() = type == TYPE_RAWS + fun isSvg() = type == TYPE_SVGS + fun isHidden() = name.startsWith('.') fun getBubbleText(sorting: Int) = when { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt index 25dc4aa5f..010aa8c27 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/receivers/RefreshMediaReceiver.kt @@ -6,10 +6,7 @@ import android.content.Intent import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.REFRESH_PATH import com.simplemobiletools.gallery.extensions.galleryDB -import com.simplemobiletools.gallery.helpers.TYPE_GIFS -import com.simplemobiletools.gallery.helpers.TYPE_IMAGES -import com.simplemobiletools.gallery.helpers.TYPE_RAWS -import com.simplemobiletools.gallery.helpers.TYPE_VIDEOS +import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium import java.io.File @@ -28,6 +25,7 @@ class RefreshMediaReceiver : BroadcastReceiver() { path.isImageFast() -> TYPE_IMAGES path.isVideoFast() -> TYPE_VIDEOS path.isGif() -> TYPE_GIFS - else -> TYPE_RAWS + path.isRawFast() -> TYPE_RAWS + else -> TYPE_SVGS } } diff --git a/app/src/main/res/layout/dialog_filter_media.xml b/app/src/main/res/layout/dialog_filter_media.xml index 1554adec9..f2ccc2559 100644 --- a/app/src/main/res/layout/dialog_filter_media.xml +++ b/app/src/main/res/layout/dialog_filter_media.xml @@ -41,4 +41,12 @@ android:paddingTop="@dimen/activity_margin" android:text="@string/raw_images"/> + + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index ea20cdd53..1d32d794b 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -38,6 +38,7 @@ الفديوهات الصور المتحركة RAW images + SVGs لم يتم العثور على ملفات وسائط مع الفلاتر المحددة تغيير الفلاتر diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 93106ddd4..e6fe577da 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -38,6 +38,7 @@ Vídeos GIFs Imatges RAW + SVGs No s\'han tronat arxius amb els filtres seleccionats. Canviar filtres diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 8910f4512..2649e53fb 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -38,6 +38,7 @@ Videos GIFs RAW images + SVGs No media files have been found with the selected filters. Change filters diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 0fd2f1018..aaa7023d8 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -38,6 +38,7 @@ Videoer GIF\'er RAW images + SVGs Der blev ikke fundet nogen filer med det valgte filter. Skift filter diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index cb2d275dd..135d1ca3c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -38,6 +38,7 @@ Videos GIFs RAW images + SVGs Keine Medien für die ausgewählten Filter gefunden Filter ändern diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 127f2e692..5c8ad788e 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -38,6 +38,7 @@ Βίντεο GIFs RAW Εικόνες + SVGs Δεν βρέθηκε κανένα αρχείο πολυμέσων με τα επιλεγμένα φίλτρα. Αλλαγή φίλτρων diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index adfe5c4bc..9a99a41f7 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -38,6 +38,7 @@ Vídeos GIFs Imagenes RAW + SVGs No se han encontrado ficheros con los filtros seleccionados. Cambiar filtros diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 9278f6332..323755c16 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -38,6 +38,7 @@ Videot GIFit RAW images + SVGs Mediaa ei löytynyt valituilla suotimilla. Muuta suotimia diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a3e385cca..0e96c9eee 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -38,6 +38,7 @@ Vidéos GIF RAW images + SVGs Aucun fichier média trouvé avec les filtres sélectionnés. Changer les filtres diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index cd213e151..127191765 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -38,6 +38,7 @@ Vídeos GIFs RAW images + SVGs Non se atoparon medios dos indicados polo filtro. Cambiar filtro diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index f15290f68..037c281da 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -38,6 +38,7 @@ Video GIF-ovi RAW images + SVGs Nije pronađena nijedna datoteka s odabranim filtrom. Promijeni filter diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index b82021ffb..6be796647 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -38,6 +38,7 @@ Videos GIFs RAW images + SVGs No media files have been found with the selected filters. Change filters diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 167e293de..843238031 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -38,6 +38,7 @@ Video GIF Immagini RAW + SVGs Nessun file trovato per il filtro selezionato. Cambia filtro diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index a344ffda1..035a2df7f 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -38,6 +38,7 @@ ビデオ GIF RAW + SVGs 条件に該当するメディアがありません。 絞り込み条件を変更 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 3a8658cc6..2287242a1 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -38,6 +38,7 @@ 비디오 GIFs RAW images + SVGs 설정된 필터와 일치하는 컨텐츠가 존재하지 않습니다. 필터 변경 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index a79ddee3a..d5c4ebb04 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -38,6 +38,7 @@ Vaizdo įrašai GIF\'ai RAW images + SVGs Su pasirinktais filtrais nerasta medijos bylų. Pakeisti filtrus diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 5e5514897..c83c2b99d 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -38,6 +38,7 @@ Videoer GIF-bilder RAW-format-bilder + SVGs Ingen media-filer er funnet med de valgte filtrene. Endre filtere diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 9ec325ac2..212a07e5f 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -38,6 +38,7 @@ Video\'s GIF-bestanden RAW-afbeeldingen + SVGs Er zijn geen bestanden gevonden met de huidige filters. Filters aanpassen diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 81049ce30..dbc0a7494 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -38,6 +38,7 @@ Filmy GIFy Obrazy RAW + SVGs Nie znalazłem multimediów z wybranymi filtrami. Zmień filtry diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 13f925d3c..5f9804afa 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -38,6 +38,7 @@ Vídeos GIFs RAW images + SVGs Nenhum arquivo de mídia encontrado a partir dos filtros selecionados. Mudar filtros diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 264c84891..dc672792d 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -38,6 +38,7 @@ Vídeos GIF Imagens RAW + SVGs Não foram encontrados ficheiros que cumpram os requisitos. Alterar filtros diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 63348ee7f..0871f6612 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -38,6 +38,7 @@ Видео GIF Изображения RAW + SVGs При заданных фильтрах медиафайлы не найдены Изменить фильтры diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index d6d826cf1..abec90613 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -38,6 +38,7 @@ Videá GIFká RAW obrázky + SVGčká So zvolenými filtrami sa nenašli žiadne média súbory. Zmeniť filtre diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 4063b4926..a0dc8f579 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -38,6 +38,7 @@ Videor GIF-bilder RAW images + SVGs Inga mediefiler hittades med valda filter. Ändra filter diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index eb0991ce0..9db6e91dc 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -38,6 +38,7 @@ Videos GIFs RAW images + SVGs No media files have been found with the selected filters. Change filters diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index bab7274ea..710d0ef86 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -38,6 +38,7 @@ 视频 GIFs RAW 图片 + SVGs 所选的过滤器没有找到媒体文件。 更改过滤器 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ef2706f14..e930cba69 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -38,6 +38,7 @@ 影片 GIF RAW圖檔 + SVGs 選擇的篩選條件未發現媒體檔案。 更改篩選條件 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a466b061d..e22f466a0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,6 +38,7 @@ Videos GIFs RAW images + SVGs No media files have been found with the selected filters. Change filters From 75d9e039818585ee481d59d77267c14ff651d665 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 20:24:39 +0200 Subject: [PATCH 73/90] enable SVG showing for people who upgrade the app --- .../simplemobiletools/gallery/activities/MainActivity.kt | 7 +++++++ .../kotlin/com/simplemobiletools/gallery/helpers/Config.kt | 4 ++++ .../com/simplemobiletools/gallery/helpers/Constants.kt | 1 + 3 files changed, 12 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 825a396fa..6ed9d73dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -133,6 +133,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { config.saveFolderGrouping(SHOW_ALL, GROUP_BY_DATE_TAKEN or GROUP_DESCENDING) } + if (!config.wasSVGShowingHandled) { + config.wasSVGShowingHandled = true + if (config.filterMedia and TYPE_SVGS == 0) { + config.filterMedia += TYPE_SVGS + } + } + checkRecycleBinItems() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index ffee3cab3..9916efcee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -346,6 +346,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(WAS_RECYCLE_BIN_PINNED, false) set(wasRecycleBinPinned) = prefs.edit().putBoolean(WAS_RECYCLE_BIN_PINNED, wasRecycleBinPinned).apply() + var wasSVGShowingHandled: Boolean + get() = prefs.getBoolean(WAS_SVG_SHOWING_HANDLED, false) + set(wasSVGShowingHandled) = prefs.edit().putBoolean(WAS_SVG_SHOWING_HANDLED, wasSVGShowingHandled).apply() + var groupBy: Int get() = prefs.getInt(GROUP_BY, GROUP_BY_NONE) set(groupBy) = prefs.edit().putInt(GROUP_BY, groupBy).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index c7a3eb776..3fecd735f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -59,6 +59,7 @@ const val GROUP_BY = "group_by" const val EVER_SHOWN_FOLDERS = "ever_shown_folders" const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders" const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images" +const val WAS_SVG_SHOWING_HANDLED = "was_svg_showing_handled" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval" From 8e9bbbe451f77e61be7b76a49219d36cf37988a9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 20:58:11 +0200 Subject: [PATCH 74/90] handle showing fullscreen svg files --- app/build.gradle | 2 ++ .../gallery/activities/ViewPagerActivity.kt | 10 +++---- .../gallery/extensions/ArrayList.kt | 4 +-- .../gallery/fragments/PhotoFragment.kt | 20 ++++++++++---- .../gallery/models/Medium.kt | 4 +-- .../gallery/svg/SvgDecoder.kt | 26 +++++++++++++++++++ .../gallery/svg/SvgDrawableTranscoder.kt | 17 ++++++++++++ .../gallery/svg/SvgModule.kt | 21 +++++++++++++++ .../gallery/svg/SvgSoftwareLayerSetter.kt | 25 ++++++++++++++++++ 9 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDecoder.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDrawableTranscoder.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgModule.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgSoftwareLayerSetter.kt diff --git a/app/build.gradle b/app/build.gradle index 99bd79aab..52526e8b5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,6 +58,8 @@ dependencies { implementation 'org.apache.sanselan:sanselan:0.97-incubator' implementation 'info.androidhive:imagefilters:1.0.7' implementation 'com.squareup.picasso:picasso:2.71828' + implementation 'com.caverock:androidsvg-aar:1.3' + kapt 'com.github.bumptech.glide:compiler:4.8.0' kapt "android.arch.persistence.room:compiler:1.1.1" implementation "android.arch.persistence.room:runtime:1.1.1" diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 843554e6d..644db9dde 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -290,7 +290,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View findItem(R.id.menu_properties).isVisible = visibleBottomActions and BOTTOM_ACTION_PROPERTIES == 0 findItem(R.id.menu_delete).isVisible = visibleBottomActions and BOTTOM_ACTION_DELETE == 0 findItem(R.id.menu_share).isVisible = visibleBottomActions and BOTTOM_ACTION_SHARE == 0 - findItem(R.id.menu_edit).isVisible = visibleBottomActions and BOTTOM_ACTION_EDIT == 0 + findItem(R.id.menu_edit).isVisible = visibleBottomActions and BOTTOM_ACTION_EDIT == 0 && !currentMedium.isSVG() findItem(R.id.menu_rename).isVisible = visibleBottomActions and BOTTOM_ACTION_RENAME == 0 && !currentMedium.getIsInRecycleBin() findItem(R.id.menu_rotate).isVisible = currentMedium.isImage() && visibleBottomActions and BOTTOM_ACTION_ROTATE == 0 findItem(R.id.menu_set_as).isVisible = visibleBottomActions and BOTTOM_ACTION_SET_AS == 0 @@ -459,7 +459,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun scheduleSwipe() { mSlideshowHandler.removeCallbacksAndMessages(null) if (mIsSlideshowActive) { - if (getCurrentMedium()!!.isImage() || getCurrentMedium()!!.isGif()) { + if (getCurrentMedium()!!.isImage() || getCurrentMedium()!!.isGIF()) { mSlideshowHandler.postDelayed({ if (mIsSlideshowActive && !isActivityDestroyed()) { swipeToNextMedium() @@ -482,11 +482,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } if (!config.slideshowIncludeVideos) { - mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGif() } as MutableList + mSlideshowMedia = mSlideshowMedia.filter { it.isImage() || it.isGIF() } as MutableList } if (!config.slideshowIncludeGIFs) { - mSlideshowMedia = mSlideshowMedia.filter { !it.isGif() } as MutableList + mSlideshowMedia = mSlideshowMedia.filter { !it.isGIF() } as MutableList } if (config.slideshowRandomOrder) { @@ -776,7 +776,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View toggleFavorite() } - bottom_edit.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_EDIT != 0) + bottom_edit.beVisibleIf(visibleBottomActions and BOTTOM_ACTION_EDIT != 0 && getCurrentMedium()?.isSVG() == false) bottom_edit.setOnClickListener { openEditor(getCurrentPath()) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt index 6a25113e7..b72d4cf52 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt @@ -13,7 +13,7 @@ fun ArrayList.getDirMediaTypes(): Int { types += TYPE_VIDEOS } - if (any { it.isGif() }) { + if (any { it.isGIF() }) { types += TYPE_GIFS } @@ -21,7 +21,7 @@ fun ArrayList.getDirMediaTypes(): Int { types += TYPE_RAWS } - if (any { it.isSvg() }) { + if (any { it.isSVG() }) { types += TYPE_SVGS } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 1ab3c2ef6..59635ce31 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -8,6 +8,7 @@ import android.graphics.BitmapFactory import android.graphics.Color import android.graphics.Matrix import android.graphics.drawable.ColorDrawable +import android.graphics.drawable.PictureDrawable import android.media.ExifInterface.* import android.net.Uri import android.os.Bundle @@ -36,6 +37,7 @@ import com.simplemobiletools.gallery.activities.ViewPagerActivity import com.simplemobiletools.gallery.extensions.* import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Medium +import com.simplemobiletools.gallery.svg.SvgSoftwareLayerSetter import com.squareup.picasso.Callback import com.squareup.picasso.Picasso import it.sephiroth.android.library.exif2.ExifInterface @@ -165,7 +167,7 @@ class PhotoFragment : ViewPagerFragment() { super.setMenuVisibility(menuVisible) isFragmentVisible = menuVisible if (wasInit) { - if (medium.isGif()) { + if (medium.isGIF()) { gifFragmentVisibilityChanged(menuVisible) } else { photoFragmentVisibilityChanged(menuVisible) @@ -233,10 +235,10 @@ class PhotoFragment : ViewPagerFragment() { private fun loadImage() { imageOrientation = getImageOrientation() - if (medium.isGif()) { - loadGif() - } else { - loadBitmap() + when { + medium.isGIF() -> loadGif() + medium.isSVG() -> loadSVG() + else -> loadBitmap() } } @@ -263,6 +265,14 @@ class PhotoFragment : ViewPagerFragment() { } } + private fun loadSVG() { + Glide.with(this) + .`as`(PictureDrawable::class.java) + .listener(SvgSoftwareLayerSetter()) + .load(medium.path) + .into(view.photo_view) + } + private fun loadBitmap(degrees: Int = 0) { var targetWidth = ViewPagerActivity.screenWidth var targetHeight = ViewPagerActivity.screenHeight diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 4728a21a5..14d804178 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -32,7 +32,7 @@ data class Medium( private const val serialVersionUID = -6553149366975655L } - fun isGif() = type == TYPE_GIFS + fun isGIF() = type == TYPE_GIFS fun isImage() = type == TYPE_IMAGES @@ -40,7 +40,7 @@ data class Medium( fun isRaw() = type == TYPE_RAWS - fun isSvg() = type == TYPE_SVGS + fun isSVG() = type == TYPE_SVGS fun isHidden() = name.startsWith('.') diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDecoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDecoder.kt new file mode 100644 index 000000000..3765db0e3 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDecoder.kt @@ -0,0 +1,26 @@ +package com.simplemobiletools.gallery.svg + +import com.bumptech.glide.load.Options +import com.bumptech.glide.load.ResourceDecoder +import com.bumptech.glide.load.engine.Resource +import com.bumptech.glide.load.resource.SimpleResource +import com.caverock.androidsvg.SVG +import com.caverock.androidsvg.SVGParseException + +import java.io.IOException +import java.io.InputStream + +class SvgDecoder : ResourceDecoder { + + override fun handles(source: InputStream, options: Options) = true + + @Throws(IOException::class) + override fun decode(source: InputStream, width: Int, height: Int, options: Options): Resource? { + try { + val svg = SVG.getFromInputStream(source) + return SimpleResource(svg) + } catch (ex: SVGParseException) { + throw IOException("Cannot load SVG from stream", ex) + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDrawableTranscoder.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDrawableTranscoder.kt new file mode 100644 index 000000000..96dbe3492 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgDrawableTranscoder.kt @@ -0,0 +1,17 @@ +package com.simplemobiletools.gallery.svg + +import android.graphics.drawable.PictureDrawable +import com.bumptech.glide.load.Options +import com.bumptech.glide.load.engine.Resource +import com.bumptech.glide.load.resource.SimpleResource +import com.bumptech.glide.load.resource.transcode.ResourceTranscoder +import com.caverock.androidsvg.SVG + +class SvgDrawableTranscoder : ResourceTranscoder { + override fun transcode(toTranscode: Resource, options: Options): Resource? { + val svg = toTranscode.get() + val picture = svg.renderToPicture() + val drawable = PictureDrawable(picture) + return SimpleResource(drawable) + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgModule.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgModule.kt new file mode 100644 index 000000000..a6e4f3efb --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgModule.kt @@ -0,0 +1,21 @@ +package com.simplemobiletools.gallery.svg + +import android.content.Context +import android.graphics.drawable.PictureDrawable + +import com.bumptech.glide.Glide +import com.bumptech.glide.Registry +import com.bumptech.glide.annotation.GlideModule +import com.bumptech.glide.module.AppGlideModule +import com.caverock.androidsvg.SVG + +import java.io.InputStream + +@GlideModule +class SvgModule : AppGlideModule() { + override fun registerComponents(context: Context, glide: Glide, registry: Registry) { + registry.register(SVG::class.java, PictureDrawable::class.java, SvgDrawableTranscoder()).append(InputStream::class.java, SVG::class.java, SvgDecoder()) + } + + override fun isManifestParsingEnabled() = false +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgSoftwareLayerSetter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgSoftwareLayerSetter.kt new file mode 100644 index 000000000..043d26e27 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/svg/SvgSoftwareLayerSetter.kt @@ -0,0 +1,25 @@ +package com.simplemobiletools.gallery.svg + +import android.graphics.drawable.PictureDrawable +import android.widget.ImageView + +import com.bumptech.glide.load.DataSource +import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.request.RequestListener +import com.bumptech.glide.request.target.ImageViewTarget +import com.bumptech.glide.request.target.Target + +class SvgSoftwareLayerSetter : RequestListener { + + override fun onLoadFailed(e: GlideException?, model: Any, target: Target, isFirstResource: Boolean): Boolean { + val view = (target as ImageViewTarget<*>).view + view.setLayerType(ImageView.LAYER_TYPE_NONE, null) + return false + } + + override fun onResourceReady(resource: PictureDrawable, model: Any, target: Target, dataSource: DataSource, isFirstResource: Boolean): Boolean { + val view = (target as ImageViewTarget<*>).view + view.setLayerType(ImageView.LAYER_TYPE_SOFTWARE, null) + return false + } +} From 7ef35207d26f533c491afa238d32c2988108e529 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 21:28:10 +0200 Subject: [PATCH 75/90] fix displaying SVG thumbnails --- .../gallery/extensions/Context.kt | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index aefeb8dfc..ea861a884 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -6,6 +6,7 @@ import android.content.res.Configuration import android.database.Cursor import android.database.sqlite.SQLiteException import android.graphics.Point +import android.graphics.drawable.PictureDrawable import android.media.AudioManager import android.os.Build import android.provider.MediaStore @@ -28,6 +29,7 @@ import com.simplemobiletools.gallery.interfaces.MediumDao import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.ThumbnailItem +import com.simplemobiletools.gallery.svg.SvgSoftwareLayerSetter import com.simplemobiletools.gallery.views.MySquareImageView import pl.droidsonroids.gif.GifDrawable import java.io.File @@ -232,6 +234,8 @@ fun Context.loadImage(type: Int, path: String, target: MySquareImageView, horizo } catch (e: OutOfMemoryError) { loadJpg(path, target, cropThumbnails) } + } else if (type == TYPE_SVGS) { + loadSVG(path, target, cropThumbnails) } } @@ -277,7 +281,22 @@ fun Context.loadJpg(path: String, target: MySquareImageView, cropThumbnails: Boo .load(path) if (cropThumbnails) options.centerCrop() else options.fitCenter() - builder.apply(options).transition(DrawableTransitionOptions.withCrossFade()).into(target) + builder.apply(options) + .transition(DrawableTransitionOptions.withCrossFade()) + .into(target) +} + +fun Context.loadSVG(path: String, target: MySquareImageView, cropThumbnails: Boolean) { + target.scaleType = if (cropThumbnails) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER + + val options = RequestOptions().signature(path.getFileSignature()) + Glide.with(applicationContext) + .`as`(PictureDrawable::class.java) + .listener(SvgSoftwareLayerSetter()) + .load(path) + .apply(options) + .transition(DrawableTransitionOptions.withCrossFade()) + .into(target) } fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, directoryDao: DirectoryDao = galleryDB.DirectoryDao(), callback: (ArrayList) -> Unit) { From 171059bfda0637c8a095a3353fabbcf5ac0a2d1e Mon Sep 17 00:00:00 2001 From: Martin Schneider <42523039+MartinGSch@users.noreply.github.com> Date: Mon, 20 Aug 2018 21:31:21 +0200 Subject: [PATCH 76/90] Update strings.xml A number of language improvements, removing small mistakes, adding clearer descriptions or overall language quality --- app/src/main/res/values-de/strings.xml | 107 ++++++++++++------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 135d1ca3c..14f9016fd 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -22,15 +22,15 @@ Standard Lautstärke Helligkeit - Bildschirmausrichtung sperren - Bildschirmausrichtung entsperren - Bildschirmausrichtung ändern - Hochkant erzwingen - Breitbild erzwingen - Standard Ausrichtung benutzen + Bildausrichtung sperren + Bildausrichtung entsperren + Bildausrichtung ändern + Bildausrichtung im Hochformat + Bildausrichtung im Querformat + automatische Bildausrichtung Aufnahmedatum korrigieren Korrigiere… - Datum erfolgreich korrigiert + Datum erfolgreich korrigiert. Filter @@ -39,11 +39,11 @@ GIFs RAW images SVGs - Keine Medien für die ausgewählten Filter gefunden + Keine Medien für die ausgewählten Filter gefunden. Filter ändern - Diese Funktion versteckt die ausgewählten Ordner (auch für andere Apps), indem dort im Dateisystem eine \'.nomedia\'-Datei abgelegt wird. Dadurch werden auch deren Unterordner versteckt. Solche Ordner werden nur gezeigt, wenn die Einstellung \'Versteckte Elemente anzeigen\' aktiv ist (auch andere Apps bieten üblicherweise eine solche Option). Fortfahren? + Diese Funktion versteckt die ausgewählten Ordner, indem im Dateisystem eine \'.nomedia\'-Datei abgelegt wird. Dadurch werden die ausgewählten Ordner und alle Unterverzeichnisse auch in anderen Apps nicht angezeigt. Solche Ordner werden nur gezeigt, wenn die Einstellung \'Versteckte Elemente anzeigen\' aktiv ist (auch andere Apps bieten üblicherweise eine solche Option).\\nFortfahren? Ordner ausschließen Ausgeschlossene Ordner Ausgeschlossene Ordner verwalten @@ -51,7 +51,7 @@ Möchtest du stattdessen einen höherliegenden Ordner ausschließen? \'Ordner ausschließen\' wird ausgewählte Ordner und deren Unterordner nur in dieser App ausblenden. Andere Apps werden solche Ordner weiterhin anzeigen.\\n\\nWenn du Ordner auch für andere Apps verstecken willst, verwende dafür die Funktion \'Ordner verstecken\'. Alle entfernen - Alle Ordner aus der Ausgeblendet-Liste entfernen? Die Ordner selbst werden nicht gelöscht. + Alle Ordner aus der Liste ausgeblendeter Ordner entfernen? Die Ordner selbst werden nicht gelöscht. Versteckte Ordner Versteckte Ordner verwalten Keinen mit einer \".nomedia\"-Datei versteckten Ordner gefunden. @@ -68,40 +68,40 @@ Breite Höhe Seitenverhältnis beibehalten - Bitte eine gültige Auflösung eingeben + Bitte eine gültige Auflösung eingeben. Editor Speichern Drehen Pfad - Ungültiger Dateipfad - Bildbearbeitung fehlgeschlagen - Bild bearbeiten mit - Keine Bildeditor-App gefunden - Unbekannter Dateipfad - Konnte Quelldatei nicht überschreiben + Ungültiger Dateipfad. + Bildbearbeitung fehlgeschlagen. + Bild bearbeiten mit: + Keine Bildeditor-App gefunden. + Unbekannter Dateipfad. + Konnte Quelldatei nicht überschreiben. Nach links drehen Nach rechts drehen Um 180° drehen Spiegeln Horizontal spiegeln Vertikal spiegeln - Bearbeiten mit - Frei + Bearbeiten mit: + Beliebiges Seitenverhältnis Schlichter Hintergrund Als Hintergrund festlegen - Hintergrundbild festlegen fehlgeschlagen + Hintergrundbild festlegen fehlgeschlagen. Als Hintergrund festlegen mit Hintergrund festlegen… - Hintergrundbild erfolgreich festgelegt + Hintergrundbild erfolgreich festgelegt. Hochformat Querformat - Homescreen + Startbildschirm Sperrbildschirm - Home- und Sperrbildschirm + Start- und Sperrbildschirm Diashow @@ -113,89 +113,88 @@ Übergänge animieren Rückwärts abspielen Endlos abspielen - Diashow beendet - Keine Medien für Diashow gefunden + Diashow beendet. + Keine Medien für Diashow gefunden. Darstellung ändern - Gitter + Gitternetz Liste Direkte Unterordner gruppieren - Gruppieren bei + Gruppieren nach... Dateien nicht gruppieren Ordner - Zuletzt geändert + Datum der letzten Änderung Aufnahmedatum - Dateityp - Extension + Dateityp (Bilder/Videos) + Dateierweiterung Videos automatisch abspielen Beschriftungen ein/aus - Videos in Endlosschleife spielen + Videos in Endlosschleife abspielen Kacheln von GIFs animieren Helligkeit beim Betrachten maximieren Kacheln quadratisch zuschneiden - Im Vollbild ausrichten nach + Im Vollbild ausrichten nach: Systemeinstellung Gerätedrehung Seitenverhältnis Schwarzer Hintergrund & schwarze Systemleiste im Vollbild Kacheln horizontal scrollen Systemleiste im Vollbild ausblenden - Nach Löschen, leere Ordner löschen + Leere Ordner automatisch löschen Fotohelligkeit mit vertikalen Gesten ändern Gesten für Videolautstärke/Helligkeit zulassen Medienanzahl bei Ordnern anzeigen Teilen/Drehen im Vollbild-Menü vertauschen - Eigenschaften im Vollbild anzeigen + Dateieigenschaften in Vollbild-Anzeige einblenden Eigenschaften auswählen Ein-Finger-Zoom im Vollbild zulassen Beim Tippen auf eine Bildschirmseite sofort zwischen Medien wechseln Starkes Zoomen zulassen - Erweiterte Details nicht anzeigen, wenn die Systemleiste versteckt ist + Dateieigenschaften im Vollbild nicht anzeigen, wenn die Systemleiste versteckt ist Zusätzliche Überprüfung, um ungültige Dateien nicht anzuzeigen - Einige Aktionstasten am unteren Bildschirmrand anzeigen + Ausgewählte Funktionen am unteren Bildschirmrand anzeigen Papierkorb auf dem Ordnerbildschirm anzeigen Thumbnails - Vollbild-Medien + Vollbild-Anzeige von Medien Erweiterte Details - Untere Aktionen + Funktionen am unteren Bildschirmrand - Sichtbare untere Aktionen verwalten + Funktionen auswählen Favoriten umschalten Schaltet die Sichtbarkeit von Dateien um Wie kann ich Schlichte Galerie als Standardanwendung auswählen? Zunächst musst du unter \"Apps\" in den Geräteeinstellungen die aktuelle Standardgalerie finden. Suche nach einer Bedienfläche wie \"Standardmässig öffnen\", betätige diese und wähle \"Standardeinstellungen löschen\". - Das nächste Mal, wenn du ein Bild oder ein Video öffnest, sollte ein Appwähler erscheinen und Schlichte Gallerie als Standard ausgewählt werden können. - Ich habe die App mit einem Passwort geschützt, aber ich habe es vergessen. Was kann ich tun? - Es gibt zwei Möglichkeiten: Entweder du installierst die App erneut oder du gehst unter Apps in den Geräteeinstellungen und wählst \"Daten löschen\". Alle Einstellungen werden zurückgesetzt, alle Mediendateien bleiben unberührt. + Das nächste Mal, wenn du ein Bild oder ein Video öffnest, sollte ein Auswahlfenster erscheinen und es möglich sein, Schlichte Gallerie als Standard-App auszuwählen. + Ich habe die App mit einem Passwort geschützt und es vergessen. Was kann ich tun? + Es gibt zwei Möglichkeiten: Entweder du installierst die App erneut oder du wählst in den Geräteeinstellungen \'Apps\' aus und dann \"Daten löschen\". Alle Einstellungen werden zurückgesetzt, alle Mediendateien bleiben unberührt. 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 Videos vorspulen? - Du kannst auf den Text der aktuellen oder der maximalen Dauer nahe der Suchleiste drücken, um das Video zurück- oder vorzuspulen. - Was ist der Unterschied zwischen Verstecken und Ausschliessen eines Ordners? - Ausschliessen verhindert lediglich, dass der Ordner in Schlichte Galerie angezeigt, Verstecken hingegen funktioniert systemweit und versteckt den Ordner auch vor anderen Gallerieapps. Dies funktioniert durch das Erstellen einer leeren \".nomedia\"-Datei im betroffenen Ordner, welche du mit jedem Dateimanager löschen kannst. + Wie kann ich in Videos vor- oder zurückspringen? + Du kannst auf den Text der aktuellen oder der maximalen Dauer nahe der Suchleiste drücken, um im Video vor- oder zurück zu springen. + 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? Es kann geschehen, dass manche ungewöhnliche Alben erscheinen. Diese kannst du ausschliessen durch gedrückt halten und Auswählen von Ausschliessen. Im nächsten Dialog kannst du den übergeordneten Ordner auswählen und dadurch sollten die anderen zugehörigen Alben auch nicht auftauchen. - Ein Ordner mit Bilder wird nicht angezeigt. Was kann ich tun? - Dies kann mehrere Gründe haben, aber es zu lösen ist einfach. Gehe einfach zu Einstellungen -> Einbezogene Ordner verwalten, wähle das Plus aus und navigiere zum gewünschten Ordner. - Was ist, wenn ich nur ein paar definierte Ordner sichtbar haben will? - Einen Ordner zu den einbezogenen Ordner hinzuzufügen schliesst nicht automatisch alle anderen aus. Eine Möglichkeit ist, in Einstellungen -> Ausgeschlossene Ordner verwalten den Stammordner \"/\" auszuschliessen und dann alle gewünschten Ordner in Einstellungen -> Einbezogene Ordner verwalten hinzuzufügen. - Dadurch werden nur die ausgewählten Ordner sichtbar, da Auschliessen und Einbeziehen rekursiv erfolgen und wenn ein Ordner ausgeschlossen und einbezogen wurde, wird er dennoch angezeigt. - Vollbildfotos haben seltsame Artefakte. Kann ich die Qualität verbessern? - Ja, es gibt einen Schalter in den Einstellungen gekennzeichnet mit \"Stark zoombare Bilder durch Bilder mit hoher Qualität ersetzen\". Dieser wird die Bildqualität verbessern, aber sie werden bei sehr hoher Zoomstufe unscharf. + Ein Ordner mit Bildern wird nicht angezeigt. Was kann ich tun? + Öffne die Galerie-Einstellungen, wähle dort \'Einbezogene Ordner verwalten\', dann das Plus-Zeichen oben rechts und navigiere zum gewünschten Ordner. + Wie kann ich erreichen, dass nur ein paar definierte Ordner sichtbar sind? + Einen Ordner zu den \'einbezogenen Ordnern\' hinzuzufügen, schließt nicht automatisch alle anderen aus. Eine Möglichkeit ist, in den Galerie-Einstellungen \'Ausgeschlossene Ordner verwalten\' zu wählen, den Stammordner \"/\" auszuschliessen und dann alle gewünschten Ordner in \'Einbezogene Ordner verwalten\' hinzuzufügen. + Als Vollbild angezeigte Bilder haben seltsame Artefakte. Kann ich die Qualität verbessern? + Ja, es gibt einen Schalter in den Einstellungen, gekennzeichnet mit \"Stark zoombare Bilder durch Bilder mit hoher Qualität ersetzen\". Dieser wird die Bildqualität verbessern, aber sie werden bei sehr hoher Zoomstufe unscharf. Kann ich mit dieser App Bilder zuschneiden? Ja, du kannst Bilder über das Ziehen der Bildecken im Editor zuschneiden. Du gelangst zum Editor indem du lange auf ein Vorschaubild drückst und Bearbeiten auswählst oder durch Auswählen von Bearbeiten in der Vollbildansicht. Kann ich Mediendatei-Thumbnails irgendwie gruppieren? - Verwenden Sie einfach den Menüeintrag \"Gruppieren nach\" in der Miniaturansicht. Sie können Dateien nach mehreren Kriterien gruppieren, einschließlich Aufnahmedatum. Wenn Sie die Funktion \"Alle Ordnerinhalte anzeigen\" verwenden, können Sie sie auch nach Ordnern gruppieren. + Verwende dazu den Menüeintrag \"Gruppieren nach...\" in der Miniaturansicht. Du kannst Dateien nach mehreren Kriterien gruppieren, einschließlich Aufnahmedatum. Wenn Du die Funktion \"Alle Ordnerinhalte anzeigen\" verwendest, kannst du sie auch nach Ordnern gruppieren. Die Sortierung nach Datum ist nicht korrekt, wie kann ich das korrigieren? Die wahrscheinliche Ursache ist, dass deine Bilder von woanders kopiert worden sind. In diesem Fall solltest du die Miniatur-Ansichten der Bilder durch etwas längeres Antippen markieren und dann im Menü oben rechts die Funktion \'Aufnahmedatum korrigieren\' ausführen. From d590ac2dc2ac54f3130c5cffd02ad7636b7be132 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 21:39:04 +0200 Subject: [PATCH 77/90] do not use lower resolution images at fullscreen view before adding the zoomable --- .../gallery/fragments/PhotoFragment.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 59635ce31..1b294d73e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -274,14 +274,6 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadBitmap(degrees: Int = 0) { - var targetWidth = ViewPagerActivity.screenWidth - var targetHeight = ViewPagerActivity.screenHeight - - if (context?.config?.allowZoomingImages == true) { - targetWidth = (targetWidth * 0.8).toInt() - targetHeight = (targetHeight * 0.8).toInt() - } - var pathToLoad = if (medium.path.startsWith("content://")) medium.path else "file://${medium.path}" pathToLoad = pathToLoad.replace("%", "%25").replace("#", "%23") @@ -289,7 +281,7 @@ class PhotoFragment : ViewPagerFragment() { val picasso = Picasso.get() .load(pathToLoad) .centerInside() - .resize(targetWidth, targetHeight) + .resize(ViewPagerActivity.screenWidth, ViewPagerActivity.screenHeight) if (degrees != 0) { picasso.rotate(degrees.toFloat()) From ee931a6defc54dbe7505bd6ef20c58a041b3f0cf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 21:39:38 +0200 Subject: [PATCH 78/90] fix #921, make the editor view positioning more dynamic --- app/src/main/res/layout/activity_edit.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index 1368debc3..b490a77ea 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -10,13 +10,15 @@ android:id="@+id/default_image_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginBottom="@dimen/bottom_filters_thumbnail_size"/> + android:layout_above="@+id/bottom_editor_crop_rotate_actions" + android:layout_marginBottom="@dimen/activity_margin"/> From 88d4cba636184c9a5cd53f1389e18141b2e6eecc Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 21:40:58 +0200 Subject: [PATCH 79/90] removing some dots from the german translation --- app/src/main/res/values-de/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 14f9016fd..92fc25072 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -123,7 +123,7 @@ Direkte Unterordner gruppieren - Gruppieren nach... + Gruppieren nach Dateien nicht gruppieren Ordner Datum der letzten Änderung @@ -194,7 +194,7 @@ Kann ich mit dieser App Bilder zuschneiden? Ja, du kannst Bilder über das Ziehen der Bildecken im Editor zuschneiden. Du gelangst zum Editor indem du lange auf ein Vorschaubild drückst und Bearbeiten auswählst oder durch Auswählen von Bearbeiten in der Vollbildansicht. Kann ich Mediendatei-Thumbnails irgendwie gruppieren? - Verwende dazu den Menüeintrag \"Gruppieren nach...\" in der Miniaturansicht. Du kannst Dateien nach mehreren Kriterien gruppieren, einschließlich Aufnahmedatum. Wenn Du die Funktion \"Alle Ordnerinhalte anzeigen\" verwendest, kannst du sie auch nach Ordnern gruppieren. + Verwende dazu den Menüeintrag \"Gruppieren nach\" in der Miniaturansicht. Du kannst Dateien nach mehreren Kriterien gruppieren, einschließlich Aufnahmedatum. Wenn Du die Funktion \"Alle Ordnerinhalte anzeigen\" verwendest, kannst du sie auch nach Ordnern gruppieren. Die Sortierung nach Datum ist nicht korrekt, wie kann ich das korrigieren? Die wahrscheinliche Ursache ist, dass deine Bilder von woanders kopiert worden sind. In diesem Fall solltest du die Miniatur-Ansichten der Bilder durch etwas längeres Antippen markieren und dann im Menü oben rechts die Funktion \'Aufnahmedatum korrigieren\' ausführen. From 7fc8d4a3d84c70d7826cfa98e8b8df97d1c252ac Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 22:43:07 +0200 Subject: [PATCH 80/90] fix #909, rely on date_time_original before date_time --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 52526e8b5..35dafb16a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -47,7 +47,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:4.6.13' + implementation 'com.simplemobiletools:commons:4.6.14' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index c8c9f1dfb..990a2cf9d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -295,7 +295,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList Date: Mon, 20 Aug 2018 22:56:09 +0200 Subject: [PATCH 81/90] fix #918, delete empty folders after Move too when appropriate --- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 3662aae3e..5107c3d21 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -533,7 +533,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } private fun deleteDirectoryIfEmpty() { - val fileDirItem = FileDirItem(mPath, mPath.getFilenameFromPath()) + val fileDirItem = FileDirItem(mPath, mPath.getFilenameFromPath(), true) if (config.deleteEmptyFolders && !fileDirItem.isDownloadsFolder() && fileDirItem.isDirectory && fileDirItem.getProperFileCount(applicationContext, true) == 0) { tryDeleteFileDirItem(fileDirItem, true, true) } From 9c2fb68718733b1429696b34ae927b841bb5fda4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 23:03:32 +0200 Subject: [PATCH 82/90] adding a note about keeping glide compiler at the gallery too --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 35dafb16a..d87e836b5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,7 +59,7 @@ dependencies { implementation 'info.androidhive:imagefilters:1.0.7' implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.caverock:androidsvg-aar:1.3' - kapt 'com.github.bumptech.glide:compiler:4.8.0' + kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work kapt "android.arch.persistence.room:compiler:1.1.1" implementation "android.arch.persistence.room:runtime:1.1.1" From f0c330db6c5d51982bdf232beb0f1aa157006769 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 23:29:38 +0200 Subject: [PATCH 83/90] update version to 4.6.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d87e836b5..86ae9e25d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 195 - versionName "4.5.2" + versionCode 196 + versionName "4.6.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From d4a929dbd2ed60d2f28876299fffb56e858dd73c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 23:29:43 +0200 Subject: [PATCH 84/90] updating changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e24c8057a..45bba2984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========== +Version 4.6.0 *(2018-08-20)* +---------------------------- + + * Added support for SVGs + * Improved fullscreen image quality and performance + * Properly show files with hastags and percentage signs in their paths + * Many other smaller UX improvements + Version 4.5.2 *(2018-08-08)* ---------------------------- From 27fb0404caa36ca711a3f225d4cf6f5227ca3529 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Aug 2018 10:18:57 +0200 Subject: [PATCH 85/90] adding a crashfix at loading fullscreen images --- .../simplemobiletools/gallery/fragments/PhotoFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 1b294d73e..7210bec36 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -296,7 +296,9 @@ class PhotoFragment : ViewPagerFragment() { } override fun onError(e: Exception) { - tryLoadingWithGlide() + if (context != null) { + tryLoadingWithGlide() + } } }) } catch (ignored: Exception) { @@ -318,7 +320,7 @@ class PhotoFragment : ViewPagerFragment() { .diskCacheStrategy(DiskCacheStrategy.RESOURCE) .override(targetWidth, targetHeight) - Glide.with(this) + Glide.with(context!!) .asBitmap() .load(getPathToLoad(medium)) .apply(options) From e4a9aa2dba5b91b24960bb81331078614563f9be Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Aug 2018 10:19:47 +0200 Subject: [PATCH 86/90] update version to 4.6.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 86ae9e25d..492a94415 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 196 - versionName "4.6.0" + versionCode 197 + versionName "4.6.1" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 76add40f615a23d6bd7f53bd5a516c3026e6872e Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Aug 2018 10:19:53 +0200 Subject: [PATCH 87/90] updating changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45bba2984..e82275519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========== +Version 4.6.1 *(2018-08-21)* +---------------------------- + + * Added a crashfix at loading fullscreen images + Version 4.6.0 *(2018-08-20)* ---------------------------- From 36a50d38385344e13615fd40f764a93043464221 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 22 Aug 2018 22:01:19 +0200 Subject: [PATCH 88/90] 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 212a07e5f..68b177cad 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -38,7 +38,7 @@ Video\'s GIF-bestanden RAW-afbeeldingen - SVGs + SVG-vectorafbeeldingen Er zijn geen bestanden gevonden met de huidige filters. Filters aanpassen From 94104f04819d8b811d1107902556f92359294a06 Mon Sep 17 00:00:00 2001 From: tiffanytkn <42646958+tiffanytkn@users.noreply.github.com> Date: Thu, 23 Aug 2018 10:34:16 -0500 Subject: [PATCH 89/90] Fixed typo, translated option, internal consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed Configuración to Ajustes as that is how it appears in the app. Changed a response in the FAQs to address the reader in usted form because that is how the other questions are addressed. Capitalized Galería Simple so it is a proper noun. Fixed spelling of completa. Translated to Spanish the option allow_deep_zooming_images. Changed to infinitive form the verb Mostrar in option show_recycle_bin. --- app/src/main/res/values-es/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9a99a41f7..2f5d77314 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -154,15 +154,15 @@ Administrar detalles ampliados Permitir zoom con un dedo en pantalla completa Permitir el cambio instantáneo de medios haciendo clic en los lados de la pantalla - Allow deep zooming images + Permitir zoom profundo Ocultar detalles ampliados cuando la barra de estado está oculta Hacer una comprobación adicional para evitar mostrar archivos inválidos Mostrar algunos botones de acción en la parte inferior de la pantalla - Muestra la papelera de reciclaje en la pantalla de carpetas + Mostrar la papelera de reciclaje en la pantalla de carpetas Miniaturas - Medios a pantalla compelta + Medios a pantalla completa Detalles ampliados Acciones en la parte inferior @@ -174,9 +174,9 @@ ¿Cómo puedo hacer que Simple Gallery sea la galería de dispositivos predeterminada? Primero tiene que encontrar la galería predeterminada actualmente en la sección Aplicaciones de la configuración de su dispositivo, busque un botón que diga algo como \"Abrir por defecto \", haga clic en él, luego seleccione \"Borrar valores predeterminados \". - La próxima vez que intente abrir una imagen o video, debería ver un selector de aplicaciones, donde puede seleccionar Galería simple y convertirla en la aplicación predeterminada. + La próxima vez que intente abrir una imagen o video, debería ver un selector de aplicaciones, donde puede seleccionar Galería Simple y convertirla en la aplicación predeterminada. He protegido la aplicación con una contraseña, pero la he olvidado. ¿Que puedo hacer? - Puedes resolverlo de 2 maneras. Puede reinstalar la aplicación o encontrar la aplicación en la configuración de su dispositivo y seleccionar \"Borrar datos \". Restablecerá todas sus configuraciones, no eliminará ningún archivo multimedia. + Puede resolverlo de 2 maneras. Puede reinstalar la aplicación o encontrar la aplicación en la configuración de su dispositivo y seleccionar \"Borrar datos \". Restablecerá todas sus configuraciones, no eliminará ningún archivo multimedia. ¿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? @@ -191,7 +191,7 @@ Agregar una carpeta en las carpetas incluidas no excluye automáticamente nada. Lo que puede hacer es ir a Ajustes -> Administrar carpetas excluidas, excluir la carpeta raíz \"/\", luego agregar las carpetas deseadas en Configuración -> Administrar carpetas incluidas. Esto hará que solo las carpetas seleccionadas sean visibles, ya que tanto la exclusión como la inclusión son recursivas y si una carpeta está excluida e incluida, aparecerá. Las imágenes a pantalla completa tienen artefactos extraños, ¿puedo de alguna manera mejorar la calidad? - Sí, hay una alternancia en Configuración que dice \"Reemplazar imágenes con zoom profundo con las de mejor calidad\", puedes usar eso. Mejorará la calidad de las imágenes, pero se volverán borrosas una vez que intente ampliar demasiado. + Sí, hay una alternancia en Ajustes que dice \"Reemplazar imágenes con zoom profundo con las de mejor calidad\", puede usar eso. Mejorará la calidad de las imágenes, pero se volverán borrosas una vez que intente ampliar demasiado. ¿Puedo recortar imágenes con esta aplicación? Sí, puede recortar imágenes en el editor arrastrando las esquinas de la imagen. Puede acceder al editor pulsando prolongadamente una imagen en miniatura y seleccionando Editar, o seleccionando Editar en la vista de pantalla completa. ¿Puedo de alguna manera agrupar miniaturas de archivos multimedia? From 0d335d85522e6e341053111a972e0be058a6302a Mon Sep 17 00:00:00 2001 From: spkprs Date: Fri, 24 Aug 2018 13:15:42 +0300 Subject: [PATCH 90/90] Update strings.xml Added faq 10 --- app/src/main/res/values-el/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 5c8ad788e..e73d44a09 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -193,6 +193,8 @@ Αυτό θα κάνει ορατούς μόνο τους επιλεγμένους φακέλους, καθώς η εξαίρεση και η συμπερίληψη λειτουργούν αναδρομικά και αν ενας φάκελος ανήκει και στα δύο, θα εμφανιστεί. Οι εικόνες πλήρους οθόνης έχουν κάποια περίεργα σημάδια. Μπορώ κάπως να βελτιώσω την ποιότητα; Ναι. Υπάρχει ένας διακόπτης στις Ρυθμίσεις με το κείμενο \"Αντικατάσταση των φωτογραφιών που απαιτούν ζούμ με άλλες καλύτερης ποιότητας\". Μπορείτε να χρησιμοποιήσετε αυτό. Θα βελτιώσει την ποιότητα των φωτογραφιών, αλλά θα θολώσουν στο μεγάλο ζουμ. + Μπορώ να περικόψω εικόνες με την εφαρμογή; + Ναι, μπορείτε να περικόψετε εικόνες στον επεξεργαστή, σύροντας τις γωνίες εικόνας. Μπορείτε να μεταβείτε στον επεξεργαστή είτε πατώντας παρατεταμένα μια μικρογραφία εικόνας και επιλέγοντας Επεξεργασία, είτε επιλέγοντας Επεξεργασία από την προβολή πλήρους οθόνης. Μπορώ να ομαδοποιήσω κάπως τις μικρογραφίες των αρχείων πολυμέσων? Σίγουρα, απλά με την χρήση \"Ομαδοποίηση κατά\" Επέκταση ή Τύπο αρχείου. Μπορείτε την ομαδοποίηση με πολλά κριτήρια, συμπεριλαμβανομένης της ημερομηνίας λήψης. Εάν χρησιμοποιείτε τη λειτουργία \"Εμφάνιση όλων των περιεχομένων στο φάκελο\" μπορείτε να ομαδοποιήσετε και τους φακέλους επίσης. Η ταξινόμηση κατά ημερομηνία δεν φαίνεται να λειτουργεί σωστά, πώς μπορώ να τη διορθώσω?