From 7f03b85e1b021d9c94e083387de2ca86e9766a9c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 May 2019 21:32:27 +0200 Subject: [PATCH] use sorting numbers by numeric values by default --- app/build.gradle | 2 +- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 5 +++++ .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 2 +- app/src/main/res/values/integers.xml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d97d7bd30..950e7c673 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.12.12' + implementation 'com.simplemobiletools:commons:5.12.15' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index ed1ddee6b..cdf8b2186 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -149,6 +149,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } } + if (!config.wasSortingByNumericValueAdded) { + config.wasSortingByNumericValueAdded = true + config.sorting = config.sorting or SORT_USE_NUMERIC_VALUE + } + updateWidgets() registerFileUpdateListener() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index e93d46050..433a47d1c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -540,7 +540,7 @@ class PhotoFragment : ViewPagerFragment() { tag?.getValueAsInt(defaultOrientation) ?: defaultOrientation } else { val exif = android.media.ExifInterface(path) - exif.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, defaultOrientation) + exif.getAttributeInt(TAG_ORIENTATION, defaultOrientation) } if (orient == defaultOrientation || context!!.isPathOnOTG(mMedium.path)) { diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index 1ba77d374..cc7e8155c 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -4,5 +4,5 @@ 3 4 - 1026 + 33794