From 64b4fdece3a16eed444c49f823ac6094f11d9e0a Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 19:15:55 +0100 Subject: [PATCH 01/15] create the bitmap at saving rotated image only when necessary --- .../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 f65de839c..55705a928 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -534,7 +534,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val tmpFile = File(filesDir, ".tmp_${newPath.getFilenameFromPath()}") try { - val bitmap = BitmapFactory.decodeFile(oldPath) getFileOutputStream(tmpFile.toFileDirItem(applicationContext)) { if (it == null) { toast(R.string.unknown_error_occurred) @@ -546,6 +545,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View copyFile(getCurrentFile(), tmpFile) saveExifRotation(ExifInterface(tmpFile.absolutePath)) } else { + val bitmap = BitmapFactory.decodeFile(oldPath) saveFile(tmpFile, bitmap, it as FileOutputStream) } From e6b11a80b1136496616da843a5d60f8a43cfb29b Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 19:31:04 +0100 Subject: [PATCH 02/15] check latest media date id too at fetching new files --- app/build.gradle | 2 +- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 +++++- .../simplemobiletools/gallery/activities/MediaActivity.kt | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8d84e7283..43477f528 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.16.1' + implementation 'com.simplemobiletools:commons:3.16.2' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.code.gson:gson:2.8.2' 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 77a9a0e4a..8ebbc88da 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -61,6 +61,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private var mLoadedInitialPhotos = false private var mIsPasswordProtectionPending = false private var mLatestMediaId = 0L + private var mLatestMediaDateId = 0L private var mLastMediaHandler = Handler() private var mTempShowHiddenHandler = Handler() private var mCurrAsyncTask: GetDirectoriesAsynctask? = null @@ -653,6 +654,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { Thread { if (hasPermission(PERMISSION_READ_STORAGE)) { mLatestMediaId = getLatestMediaId() + mLatestMediaDateId = getLatestMediaByDateId() } }.start() } @@ -666,8 +668,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mLastMediaHandler.postDelayed({ Thread { val mediaId = getLatestMediaId() - if (mLatestMediaId != mediaId) { + val mediaDateId = getLatestMediaByDateId() + if (mLatestMediaId != mediaId || mLatestMediaDateId != mediaDateId) { mLatestMediaId = mediaId + mLatestMediaDateId = mediaDateId runOnUiThread { getDirectories() } 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 5b5d07f84..dc6d589d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -58,6 +58,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private var mLoadedInitialPhotos = false private var mIsSearchOpen = false private var mLatestMediaId = 0L + private var mLatestMediaDateId = 0L private var mLastMediaHandler = Handler() private var mTempShowHiddenHandler = Handler() private var mCurrAsyncTask: GetMediaAsynctask? = null @@ -359,8 +360,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mLastMediaHandler.postDelayed({ Thread { val mediaId = getLatestMediaId() - if (mLatestMediaId != mediaId) { + val mediaDateId = getLatestMediaByDateId() + if (mLatestMediaId != mediaId || mLatestMediaDateId != mediaDateId) { mLatestMediaId = mediaId + mLatestMediaDateId = mediaDateId runOnUiThread { getMedia() } @@ -632,6 +635,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun gotMedia(media: ArrayList, isFromCache: Boolean = false) { Thread { mLatestMediaId = getLatestMediaId() + mLatestMediaDateId = getLatestMediaByDateId() }.start() mIsGettingMedia = false From e62971d25acb213cde2085e098fefb6852f09e28 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 21:14:42 +0100 Subject: [PATCH 03/15] update commons to 3.16.9 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 43477f528..6d04656a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.16.2' + implementation 'com.simplemobiletools:commons:3.16.9' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.code.gson:gson:2.8.2' From 42bd31f38b40a76bdf16c4717c96d468628d61d4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 21:28:30 +0100 Subject: [PATCH 04/15] limit the cached folders size to 60 just to be sure --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 3 ++- .../com/simplemobiletools/gallery/activities/MediaActivity.kt | 1 - .../kotlin/com/simplemobiletools/gallery/helpers/Constants.kt | 2 ++ 3 files changed, 4 insertions(+), 2 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 8ebbc88da..b0b5feecc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -602,7 +602,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun storeDirectories() { if (!config.temporarilyShowHidden && config.tempFolderPath.isEmpty()) { - val directories = Gson().toJson(mDirs) + val subList = mDirs.subList(0, Math.min(SAVE_DIRS_CNT, mDirs.size)) + val directories = Gson().toJson(subList) config.directories = directories } } 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 dc6d589d8..92e2decf5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -45,7 +45,6 @@ import java.io.File import java.io.IOException class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { - private val SAVE_MEDIA_CNT = 80 private val LAST_MEDIA_CHECK_PERIOD = 3000L private var mPath = "" 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 509a5f1d5..535d6f4bf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -65,6 +65,8 @@ const val MAX_COLUMN_COUNT = 20 const val SHOW_TEMP_HIDDEN_DURATION = 600000L const val CLICK_MAX_DURATION = 150 const val DRAG_THRESHOLD = 8 +const val SAVE_DIRS_CNT = 60 +const val SAVE_MEDIA_CNT = 80 const val DIRECTORY = "directory" const val MEDIUM = "medium" From 7ebc110ac88541e4940fda8868479a8f55925734 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 21:49:58 +0100 Subject: [PATCH 05/15] rescan and cache destination path after copy --- app/build.gradle | 2 +- .../gallery/activities/MediaActivity.kt | 9 +-------- .../gallery/adapters/MediaAdapter.kt | 1 + .../gallery/extensions/Activity.kt | 2 +- .../gallery/extensions/Context.kt | 20 +++++++++++++++++++ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6d04656a0..bdd2e235e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.16.9' + implementation 'com.simplemobiletools:commons:3.16.10' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.code.gson:gson:2.8.2' 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 92e2decf5..4463be0e8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -20,7 +20,6 @@ import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.transition.Transition -import com.google.gson.Gson import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* @@ -663,13 +662,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun storeFolder() { if (!config.temporarilyShowHidden) { Thread { - try { - val subList = mMedia.subList(0, Math.min(SAVE_MEDIA_CNT, mMedia.size)) - val json = Gson().toJson(subList) - config.saveFolderMedia(mPath, json) - } catch (ignored: Exception) { - } catch (ignored: OutOfMemoryError) { - } + storeFolderItems(mPath, mMedia) }.start() } } 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 70dc22f94..b5c043d9c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -187,6 +187,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, val fileDirItems = paths.map { FileDirItem(it, it.getFilenameFromPath()) } as ArrayList activity.tryCopyMoveFilesTo(fileDirItems, isCopyOperation) { config.tempFolderPath = "" + activity.applicationContext.updateStoredFolderItems(it) if (!isCopyOperation) { listener?.refreshItems() } 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 c1c0e0dbd..c27b19fc9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -183,7 +183,7 @@ fun Activity.loadImage(type: Int, path: String, target: MySquareImageView, horiz } } -fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, isCopyOperation: Boolean, callback: () -> Unit) { +fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, isCopyOperation: Boolean, callback: (destinationPath: String) -> Unit) { if (fileDirItems.isEmpty()) { toast(R.string.unknown_error_occurred) return 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 1be5ed7d8..b19200dab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -9,13 +9,17 @@ import android.media.AudioManager import android.os.Build import android.provider.MediaStore import android.view.WindowManager +import com.google.gson.Gson import com.simplemobiletools.commons.extensions.getStringValue import com.simplemobiletools.commons.extensions.humanizePath import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.activities.SettingsActivity +import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.helpers.Config import com.simplemobiletools.gallery.helpers.NOMEDIA +import com.simplemobiletools.gallery.helpers.SAVE_MEDIA_CNT import com.simplemobiletools.gallery.models.Directory +import com.simplemobiletools.gallery.models.Medium import java.io.File val Context.portrait get() = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT @@ -128,3 +132,19 @@ fun Context.isPathInMediaStore(path: String): Boolean { } return false } + +fun Context.updateStoredFolderItems(path: String) { + GetMediaAsynctask(this, path, false, false, false) { + storeFolderItems(path, it) + }.execute() +} + +fun Context.storeFolderItems(path: String, items: ArrayList) { + try { + val subList = items.subList(0, Math.min(SAVE_MEDIA_CNT, items.size)) + val json = Gson().toJson(subList) + config.saveFolderMedia(path, json) + } catch (ignored: Exception) { + } catch (ignored: OutOfMemoryError) { + } +} From 0552c12d177cef87da5c2973eefc41c5cf3bf692 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 21:59:35 +0100 Subject: [PATCH 06/15] update stored folder items after deleting --- .../simplemobiletools/gallery/adapters/MediaAdapter.kt | 9 +++++++++ 1 file changed, 9 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 b5c043d9c..6e0c190e6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -235,6 +235,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, media.removeAll(removeMedia) listener?.deleteFiles(fileDirItems) removeSelectedItems() + updateStoredFolderItems() } } @@ -244,6 +245,14 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, return selectedMedia } + private fun updateStoredFolderItems() { + Thread { + if (media.isNotEmpty()) { + activity.applicationContext.storeFolderItems(media.first().path.getParentPath(), media as ArrayList) + } + }.start() + } + fun updateMedia(newMedia: ArrayList) { if (newMedia.hashCode() != currentMediaHash) { currentMediaHash = newMedia.hashCode() From 5c0f33f38f6a1ccda5179fdecbce6c9f003ab289 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 22:03:12 +0100 Subject: [PATCH 07/15] trim folder slashes before updating their items --- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6e0c190e6..2fa48aca4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -248,7 +248,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, private fun updateStoredFolderItems() { Thread { if (media.isNotEmpty()) { - activity.applicationContext.storeFolderItems(media.first().path.getParentPath(), media as ArrayList) + activity.applicationContext.storeFolderItems(media.first().path.getParentPath().trimEnd('/'), media as ArrayList) } }.start() } From e68392b1e454930677f2528211942510f5306f89 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 22:57:28 +0100 Subject: [PATCH 08/15] recheck folder content if we notice that it changed --- .../gallery/activities/MainActivity.kt | 16 +++++++++++++++- .../simplemobiletools/gallery/helpers/Config.kt | 6 ++++++ .../gallery/helpers/Constants.kt | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) 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 b0b5feecc..fa1c11de6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -573,7 +573,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun gotDirectories(newDirs: ArrayList, isFromCache: Boolean) { if (!isFromCache) { - setupLatestMediaId() + Thread { + checkFolderContentChange(newDirs) + }.start() } val dirs = getSortedDirectories(newDirs) @@ -600,6 +602,18 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } } + private fun checkFolderContentChange(newDirs: ArrayList) { + newDirs.forEach { + val storedShortDirValue = config.loadFolderMediaShort(it.path) + if (storedShortDirValue != it.toString()) { + config.saveFolderMediaShort(it.path, it.toString()) + if (storedShortDirValue.isNotEmpty()) { + updateStoredFolderItems(it.path) + } + } + } + } + private fun storeDirectories() { if (!config.temporarilyShowHidden && config.tempFolderPath.isEmpty()) { val subList = mDirs.subList(0, Math.min(SAVE_DIRS_CNT, mDirs.size)) 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 8a8e8b646..27aa99116 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -124,6 +124,12 @@ class Config(context: Context) : BaseConfig(context) { fun loadFolderMedia(path: String) = prefs.getString(SAVE_FOLDER_PREFIX + path, "") + fun saveFolderMediaShort(path: String, value: String) { + prefs.edit().putString(SAVE_FOLDER_SHORT_PREFIX + path, value).apply() + } + + fun loadFolderMediaShort(path: String) = prefs.getString(SAVE_FOLDER_SHORT_PREFIX + path, "") + var autoplayVideos: Boolean get() = prefs.getBoolean(AUTOPLAY_VIDEOS, false) set(autoplay) = prefs.edit().putBoolean(AUTOPLAY_VIDEOS, autoplay).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 535d6f4bf..cf49ee2f3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -26,6 +26,7 @@ const val MEDIA_HORIZONTAL_COLUMN_CNT = "media_horizontal_column_cnt" const val MEDIA_LANDSCAPE_HORIZONTAL_COLUMN_CNT = "media_landscape_horizontal_column_cnt" const val SHOW_ALL = "show_all" // display images and videos from all folders together const val SAVE_FOLDER_PREFIX = "folder2_" +const val SAVE_FOLDER_SHORT_PREFIX = "folder_short_" const val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown" const val EXCLUDED_FOLDERS = "excluded_folders" const val INCLUDED_FOLDERS = "included_folders" From fa201e65245eb7b59905d4acf76aad08f7e4293b Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 23:16:12 +0100 Subject: [PATCH 09/15] avoid 2 checkLastMediaChanged reseting each other --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 fa1c11de6..d13e162f3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -679,7 +679,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { return } - mLastMediaHandler.removeCallbacksAndMessages(null) mLastMediaHandler.postDelayed({ Thread { val mediaId = getLatestMediaId() @@ -691,6 +690,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { getDirectories() } } else { + mLastMediaHandler.removeCallbacksAndMessages(null) checkLastMediaChanged() } }.start() From a8c4b93fb5ee6e52de8d7d79a355f1abcc228bcb Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 23:36:34 +0100 Subject: [PATCH 10/15] update stored directories if a file is deleted from the thumbnails view --- .../gallery/activities/MainActivity.kt | 6 +----- .../gallery/activities/MediaActivity.kt | 2 ++ .../gallery/extensions/Context.kt | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 5 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 d13e162f3..f82c8b100 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -13,7 +13,6 @@ import android.view.Menu import android.view.MenuItem import android.view.ViewGroup import android.widget.FrameLayout -import com.google.gson.Gson import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.dialogs.NewAppDialog @@ -167,7 +166,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { override fun onPause() { super.onPause() - storeDirectories() directories_refresh_layout.isRefreshing = false mIsGettingDirs = false storeStateVariables() @@ -616,9 +614,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun storeDirectories() { if (!config.temporarilyShowHidden && config.tempFolderPath.isEmpty()) { - val subList = mDirs.subList(0, Math.min(SAVE_DIRS_CNT, mDirs.size)) - val directories = Gson().toJson(subList) - config.directories = directories + storeDirectoryItems(mDirs) } } 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 4463be0e8..9df15a242 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -675,6 +675,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } else if (mMedia.isEmpty()) { deleteDirectoryIfEmpty() finish() + } else { + updateStoredDirectories() } } } 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 b19200dab..fde901b01 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -14,9 +14,11 @@ import com.simplemobiletools.commons.extensions.getStringValue import com.simplemobiletools.commons.extensions.humanizePath import com.simplemobiletools.commons.helpers.OTG_PATH import com.simplemobiletools.gallery.activities.SettingsActivity +import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.helpers.Config import com.simplemobiletools.gallery.helpers.NOMEDIA +import com.simplemobiletools.gallery.helpers.SAVE_DIRS_CNT import com.simplemobiletools.gallery.helpers.SAVE_MEDIA_CNT import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Medium @@ -148,3 +150,17 @@ fun Context.storeFolderItems(path: String, items: ArrayList) { } catch (ignored: OutOfMemoryError) { } } + +fun Context.updateStoredDirectories() { + GetDirectoriesAsynctask(this, false, false) { + if (!config.temporarilyShowHidden) { + storeDirectoryItems(it) + } + }.execute() +} + +fun Context.storeDirectoryItems(items: ArrayList) { + val subList = items.subList(0, Math.min(SAVE_DIRS_CNT, items.size)) + val directories = Gson().toJson(subList) + config.directories = directories +} From aaec6926fdaf9370e03f0b0b3fba377a77321de7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 23:43:41 +0100 Subject: [PATCH 11/15] comment out the Simple Contacts announcement --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f82c8b100..7127391c5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -103,10 +103,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { setupLatestMediaId() // notify the users about the Contacts app - if (System.currentTimeMillis() < 1521015000000 && !config.wasNewAppShown && config.appRunCount > 100 && config.appRunCount % 50 != 0 && !isPackageInstalled(CONTACTS_PACKAGE)) { + /*if (System.currentTimeMillis() < 1521015000000 && !config.wasNewAppShown && config.appRunCount > 100 && config.appRunCount % 50 != 0 && !isPackageInstalled(CONTACTS_PACKAGE)) { config.wasNewAppShown = true NewAppDialog(this, CONTACTS_PACKAGE, "Simple Contacts") - } + }*/ } override fun onStart() { From 3311d07d9763568a5d976045852a140b42b7b9cf Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 23:43:56 +0100 Subject: [PATCH 12/15] update version to 3.6.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bdd2e235e..a4484e186 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 165 - versionName "3.5.3" + versionCode 166 + versionName "3.6.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From 726fe7c99bd2f682eb42304916490934cc2fcb44 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Mar 2018 23:44:13 +0100 Subject: [PATCH 13/15] updating changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f72ecbfe6..6964a32c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Changelog ========== +Version 3.6.0 *(2018-03-15)* +---------------------------- + + * Fix duplicate files at renaming or hiding + * Improve some third party handling + * Optimize rotated image saving to avoid Out of memory errors + * Optimize new item discoveries or folder refreshing + * Many other smaller performance and UX improvements + Version 3.5.3 *(2018-03-03)* ---------------------------- From 199a0a2407e69272ff7d0a1c1350a76ac329d171 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 16 Mar 2018 11:40:13 +0100 Subject: [PATCH 14/15] add image cropping in FAQ --- .../com/simplemobiletools/gallery/extensions/Activity.kt | 1 + 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-de/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 | 3 ++- 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-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 ++ 26 files changed, 51 insertions(+), 1 deletion(-) 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 c27b19fc9..7f9faf911 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -83,6 +83,7 @@ fun SimpleActivity.launchAbout() { 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_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 diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index cabd543ff..2358fc29a 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -168,6 +168,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index d387bb0bc..3ad86b548 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -164,6 +164,8 @@ Això farà que només les carpetes seleccionades siguin visibles, ja que tant excloure com incloure són recursius i si una carpeta està exclosa i inclosa, es mostrarà. Les imatges a pantalla completa tenen artefactes estranys, puc millorar d\'alguna manera la qualitat? Sí, hi ha un commutador a la configuració que diu \"Substituïu imatges ampliades i de gran qualitat\", podeu fer-ho. Millora la qualitat de les imatges, però es borraran una vegada que intenteu fer zoom massa. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index bf5510018..1f9220f8d 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e35779506..ccab664bb 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -164,6 +164,8 @@ 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. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index afda027dd..e01054678 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -164,6 +164,8 @@ 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. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 217ef3ab0..b259353bf 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 392f93dbf..debe6ffdf 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -163,7 +163,8 @@ Ajouter un répértoire dans les dossiers inclus n\'exclut rien automatiquement. Pour ce faire, il faut aller dans « Paramètres » puis « Gérer les dossiers exclus », exclure le répertoire racine \"/\", puis ajouter les répertoires souhaités dans « Paramètres » puis « Gérer les répertoires inclus ». Seuls les répertoires selectionnés seront visibles, du fait que les exclusions et inclusions sont récursives, et si un répertoire est à la fois exclus et inclus, il sera affiché. Les images en plein écran contiennent des artéfacts, est-ce possible d\'améliorer la qualité ? Oui, il existe dans « Paramètres » une option « Remplacer les images zoomables profondes par des images de meilleure qualité », mais les images seront alors floues si vous zoomez trop. - + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index a4b605bc9..5309d3d07 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -164,6 +164,8 @@ Esto fará visibles só aos cartafoles escollidos, como tanto excluír e incluír son recursivos e si está excluído e logo incluído, será mostrado. As imaxes a pantalla completa teñen píxeles extranos, podo mellorar a calidade da imaxe? Si, hai unha opción en Axustes que di \"Substituír imaxes con un gran zoom con imaxes de mellor calidade\", pode usar eso. mellorará a calidade das imaxes, mais farase máis borrosaxa si intenta facer moito zoom. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 5b3ff3fb8..363fc4c29 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 946385bfa..554b4c39a 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e2bf44d15..43d4d0646 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 3f21d49a0..d91edf010 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index ff98d7734..26cc42bd7 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index f0145b3b4..df4152a04 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index e5f8c1f29..31a1b233a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index eeff4b5e4..60c712081 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -162,6 +162,8 @@    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ć?    U 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. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 5c8c8958e..ac6732853 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 35979003c..4d1009967 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index c2654816f..0a0aca0ed 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -164,6 +164,8 @@ Это сделает видимыми только выбранные папки, так как исключение и включение являются рекурсивными, и если папка исключена и включена, то она будет отображаться. Полноэкранные изображения имеют странные артефакты, можно как-то улучшить качество? Да, в настройках есть переключатель \"Заменять масштабируемые изображения высококачественными\", использовуйте его. Это улучшит качество изображений, но они будут размыты, если вы попытаетесь сильно увеличить масштаб отображения. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 469dcfa1e..e7168a8b1 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -164,6 +164,8 @@ To spôsobí, že budú zobrazené iba vyžiadané priečinky, keďže aj vylúčenie, aj pridanie fungujú rekurzívne a ak je priečinok vylúčený, aj pridaný, bude viditeľný. Fotky na celú obrazovku majú zhoršenú kvalitu, viem ju nejak zlepšiť? Áno, v nastaveniach je prepínač s textom \"Nahradiť hlboko priblížiteľné obrázky s obrázkami s lepšou kvalitou\", môžete ho skúsiť. Spôsobí to vyššiu kvalitu obrázkov, po priblížení sa ale budú rozmazávať oveľa skôr. + Dá sa s touto aplikáciou orezať obrázky? + Áno, orezanie je možné v editore, potiahnutím rohov obrázkov. Do editoru sa môžete dostať buď dlhým podržaním náhľadu obrázku a zvolením menu položky Upraviť, alebo zvolením Upraviť pri celoobrazovkovom režime. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index ccc80b3b9..c551e57ca 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fd4101be4..a071cb4a5 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 7325a9610..0fbe24271 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 52355bc40..d94e93712 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -164,6 +164,8 @@ 那樣的話就只有選擇的資料夾可見。因為排除和包含都是遞迴的,如果一個資料夾被排除又被包含,則會顯示出來。 全螢幕圖片有雜質,我有辦法提高品質嗎? 可啊,[設定]內有個開關叫做「可深度縮放的圖片用品質更佳的來取代」,你能用用看。這會提高圖片的品質,不過一旦你放大太多就會模糊掉。 + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 777a359b9..456f515f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -164,6 +164,8 @@ That will make only the selected folders visible, as both excluding and including are recursive and if a folder is both excluded and included, it will show up. Fullscreen images have weird artifacts, can I somehow improve the quality? Yea, there is a toggle in Settings saying \"Replace deep zoomable images with better quality ones\", you can use that. It will improve the quality of the images, but they will get blurred once you try zooming in too much. + Can I crop images with this app? + Yes, you can crop images in the editor, by dragging the image corners. You can get to the editor either by long pressing an image thumbnail and selecting Edit, or selecting Edit from the fullscreen view. From 039d73dde8cb30d01f8122616d8f74372da4e7e2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 16 Mar 2018 15:08:08 +0100 Subject: [PATCH 15/15] fixing a crash at checking image load fail reason --- .../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 4554ee3eb..85c4212ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -255,7 +255,7 @@ class PhotoFragment : ViewPagerFragment() { .apply(options) .listener(object : RequestListener { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - if (!useHalfResolution && e?.rootCauses?.first() is OutOfMemoryError) { + if (!useHalfResolution && e?.rootCauses?.firstOrNull() is OutOfMemoryError) { useHalfResolution = true Handler().post { loadBitmap(degrees)