From 471469cc34444624ee68ed97fe8eb86c30ab7f79 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 23:28:55 +0100 Subject: [PATCH 01/19] remove the Malay strings file --- app/src/main/res/values-ms/strings.xml | 149 ------------------------- 1 file changed, 149 deletions(-) delete mode 100644 app/src/main/res/values-ms/strings.xml diff --git a/app/src/main/res/values-ms/strings.xml b/app/src/main/res/values-ms/strings.xml deleted file mode 100644 index e15f4800d..000000000 --- a/app/src/main/res/values-ms/strings.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - Simple Gallery - Gallery - Edit - Open camera - (hidden) - Pin folder - Unpin folder - Show all folders content - All folders - Switch to folder view - Other folder - Show on map - Unknown location - No application with maps has been found - No Camera app has been found - Increase column count - Reduce column count - Change cover image - Select photo - Use default - Volume - Brightness - Do not ask again in this session - Lock orientation - Unlock orientation - - - Filter media - Images - Videos - GIFs - No media files have been found with the selected filters. - Change filters - - - This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue? - Exclude - Excluded folders - Manage excluded folders - This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings. - Exclude a parent instead? - Excluding folders will make them together with their subfolders hidden just in Simple Gallery, they will still be visible in other applications.\n\nIf you want to hide them from other apps too, use the Hide function. - Remove all - Remove all folders from the list of excluded? This will not delete the folders. - - - Included folders - Manage included folders - Add folder - If you have some folders which contain media, but were not recognized by the app, you can add them manually here.\n\nAdding some items here will not exclude any other folder. - - - Resize - Resize selection and save - Width - Height - Keep aspect ratio - Please enter a valid resolution - - - Editor - Save - Rotate - Path - Invalid image path - Image editing failed - Edit image with: - No image editor found - Unknown file location - Could not overwrite the source file - Rotate left - Rotate right - Rotate by 180º - Flip - Flip horizontally - Flip vertically - Edit with - - - Simple Wallpaper - Set as Wallpaper - Setting as Wallpaper failed - Set as wallpaper with: - No app capable of it has been found - Setting wallpaper… - Wallpaper set successfully - Portrait aspect ratio - Landscape aspect ratio - - - Slideshow - Interval (seconds): - Include photos - Include videos - Include GIFs - Random order - Use fade animations - Move backwards - Loop slideshow - The slideshow ended - No media for the slideshow have been found - - - Change view type - Grid - List - - - Show hidden media - Play videos automatically - Toggle filename visibility - Loop videos - Animate GIFs at thumbnails - Max brightness when viewing media - Crop thumbnails into squares - Rotate fullscreen media by - System setting - Device rotation - Aspect ratio - Dark background at fullscreen media - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media - Delete empty folders after deleting their content - Allow controlling video volume and brightness with vertical gestures - Show folder media count on the main view - Replace Share with Rotate at fullscreen menu - Show extended details over fullscreen media - Manage extended details - - - - A gallery for viewing photos and videos without ads. - - A simple tool usable for viewing photos and videos. Items can be sorted by date, size, name both ascending or descending, photos can be zoomed in. Media files are shown in multiple columns depending on the size of the display, you can change the column count by pinch gestures. They can be renamed, shared, deleted, copied, moved. Images can also be cropped, rotated, flipped or set as Wallpaper directly from the app. - - The Gallery is also offered for third party usage for previewing images / videos, adding attachments at email clients etc. It\'s perfect for everyday usage. - - Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors. - - This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com - - - - From 76e94d2bab86964e03ca1858fb06d55ea8f30cf2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 23:30:58 +0100 Subject: [PATCH 02/19] adding some strings related to spliting home/lock wallpapers --- app/src/main/res/values-ca/strings.xml | 3 +++ app/src/main/res/values-cs/strings.xml | 3 +++ app/src/main/res/values-de/strings.xml | 3 +++ app/src/main/res/values-es/strings.xml | 3 +++ app/src/main/res/values-fi/strings.xml | 3 +++ app/src/main/res/values-fr/strings.xml | 3 +++ app/src/main/res/values-hr/strings.xml | 3 +++ app/src/main/res/values-hu/strings.xml | 3 +++ app/src/main/res/values-it/strings.xml | 3 +++ app/src/main/res/values-ja/strings.xml | 3 +++ app/src/main/res/values-nl/strings.xml | 3 +++ app/src/main/res/values-pl/strings.xml | 3 +++ app/src/main/res/values-pt-rBR/strings.xml | 3 +++ app/src/main/res/values-pt/strings.xml | 3 +++ app/src/main/res/values-ru/strings.xml | 3 +++ app/src/main/res/values-sk/strings.xml | 3 +++ app/src/main/res/values-sv/strings.xml | 3 +++ app/src/main/res/values-tr/strings.xml | 3 +++ app/src/main/res/values-zh-rCN/strings.xml | 3 +++ app/src/main/res/values-zh-rTW/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ 21 files changed, 63 insertions(+) diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index e15f4800d..618f119c5 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -88,6 +88,9 @@ Wallpaper set successfully Portrait aspect ratio Landscape aspect ratio + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 4252e7953..0c6d1748f 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -88,6 +88,9 @@ Tapeta byla úspěšně změněna Portrait aspect ratio Landscape aspect ratio + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9676c7754..f1b33f18c 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -88,6 +88,9 @@ Hintergrundbild erfolgreich festgelegt Hochformat Querformat + Home screen + Lock screen + Home and lock screen Diashow diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 5cb108458..93346c03f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -88,6 +88,9 @@ Fondo de pantalla establecido correctamente Relación de aspecto tipo retrato Relación de aspecto tipo paisaje + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 39a1625af..a49f2e548 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -88,6 +88,9 @@ Taustakuva asetettu onnistuneesti Kuvasuhde pystyssä Kuvasuhde vaakatasossa + Home screen + Lock screen + Home and lock screen Diaesitys diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 4029cf872..feeaa6c03 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -88,6 +88,9 @@ Fond d\'écran défini avec succès Ratio d\'aspect portrait Ratio d\'aspect paysage + Home screen + Lock screen + Home and lock screen Diaporama diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 7ab987bca..1fe7dc1a2 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -88,6 +88,9 @@ Uspješno postavljanje pozadine Portretni omjer slike Pejzažni omjer slike + Home screen + Lock screen + Home and lock screen Dijaprojekcija diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 8b1a9efc7..5a6ef0917 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -88,6 +88,9 @@ Wallpaper set successfully Portrait aspect ratio Landscape aspect ratio + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3498ff272..ae49dd641 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -88,6 +88,9 @@ Sfondo impostato correttamente Proporzioni ritratto Proporzioni panorama + Home screen + Lock screen + Home and lock screen Presentazione diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 8ab7eebc6..b09569ba5 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -88,6 +88,9 @@ 壁紙を正常に設定しました 縦向きの縦横比 横向きの縦横比 + Home screen + Lock screen + Home and lock screen スライドショー diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index bbd0a82dd..cef6f6e31 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -88,6 +88,9 @@ Achtergrond is ingesteld Verhouding in portretmodus Verhouding in landschapsmodus + Home screen + Lock screen + Home and lock screen Diavoorstelling diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index eb749c168..e19311773 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -88,6 +88,9 @@ Tapeta została ustawiona Proporcje ekranu w trybie pionowym Proporcje ekranu w trybie poziomym + Home screen + Lock screen + Home and lock screen Pokaz slajdów diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a4c29aca1..d63e956f6 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -88,6 +88,9 @@ Papel de parede com sucesso Retrato Paisagem + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 40ec56b98..6db9b5657 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -88,6 +88,9 @@ Fundo definido com sucesso Proporção na vertical Proporção na horizontal + Home screen + Lock screen + Home and lock screen Apresentação diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index e975f4888..5a097f2b2 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -88,6 +88,9 @@ Обои успешно установлены Портрет Ландшафт + Home screen + Lock screen + Home and lock screen Слайдшоу diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index fbc43e87d..dd75e136d 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -88,6 +88,9 @@ Tapeta bola úspešne zmenená Orientácia nastojato Orientácia naležato + Plocha + Obrazovka uzamknutia + Plocha a obrazovka uzamknutia Prezentácia diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index dbdf99823..a91d2b9d6 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -88,6 +88,9 @@ Bakgrundsbilden är ändrad Stående bildförhållande Liggande bildförhållande + Home screen + Lock screen + Home and lock screen Bildspel diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index a93d22dcf..cc051c267 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -88,6 +88,9 @@ Duvar kağıdı başarıyla ayarlandı Portrait aspect ratio Landscape aspect ratio + Home screen + Lock screen + Home and lock screen Slideshow diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 072ef4393..8b73e4c33 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -88,6 +88,9 @@ 壁纸设置成功 纵向长宽比 横向长宽比 + Home screen + Lock screen + Home and lock screen 幻灯片 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 0e6fe6ec4..f5552d15f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -88,6 +88,9 @@ 成功設為桌布 直向長寬比 橫向長寬比 + Home screen + Lock screen + Home and lock screen 投影片 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e15f4800d..618f119c5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -88,6 +88,9 @@ Wallpaper set successfully Portrait aspect ratio Landscape aspect ratio + Home screen + Lock screen + Home and lock screen Slideshow From a56bbbd54a95e2da9aad3c8aa16f07fd19d7b5c1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 23:35:36 +0100 Subject: [PATCH 03/19] simplify Leak Canary initialization --- app/build.gradle | 6 +----- app/src/main/kotlin/com/simplemobiletools/gallery/App.kt | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6c2af3e29..ecc42f977 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,14 +21,10 @@ android { } buildTypes { - debug { - buildConfigField "boolean", "USE_LEAK_CANARY", "true" - } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release - buildConfigField "boolean", "USE_LEAK_CANARY", "false" } } @@ -47,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.20' + implementation 'com.simplemobiletools:commons:3.0.21' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index 2099d83cc..665817fb5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -3,13 +3,12 @@ package com.simplemobiletools.gallery import android.support.multidex.MultiDexApplication import com.github.ajalt.reprint.core.Reprint import com.simplemobiletools.commons.extensions.checkUseEnglish -import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY import com.squareup.leakcanary.LeakCanary class App : MultiDexApplication() { override fun onCreate() { super.onCreate() - if (USE_LEAK_CANARY) { + if (BuildConfig.DEBUG) { if (LeakCanary.isInAnalyzerProcess(this)) { return } From 9b5a52f66a31c191a190ffc917ba41f061920a30 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 Dec 2017 23:48:19 +0100 Subject: [PATCH 04/19] allow selecting which wallpaper should be changed on Nougat+ --- app/build.gradle | 2 +- .../activities/SetWallpaperActivity.kt | 32 +++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ecc42f977..3678e7ab2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.21' + implementation 'com.simplemobiletools:commons:3.0.22' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt index 07a493239..559d06452 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SetWallpaperActivity.kt @@ -1,5 +1,6 @@ package com.simplemobiletools.gallery.activities +import android.annotation.SuppressLint import android.app.Activity import android.app.WallpaperManager import android.content.Intent @@ -8,8 +9,11 @@ import android.net.Uri import android.os.Bundle import android.view.Menu import android.view.MenuItem +import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.isActivityDestroyed +import com.simplemobiletools.commons.extensions.isNougatPlus import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.gallery.R import com.theartofdev.edmodo.cropper.CropImageView import kotlinx.android.synthetic.main.view_crop_image.* @@ -17,6 +21,7 @@ import kotlinx.android.synthetic.main.view_crop_image.* class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener { private val PICK_IMAGE = 1 private var isLandscapeRatio = true + private var wallpaperFlag = -1 lateinit var uri: Uri lateinit var wallpaperManager: WallpaperManager @@ -70,7 +75,7 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - R.id.save -> crop_image_view.getCroppedImageAsync() + R.id.save -> confirmWallpaper() R.id.rotate -> crop_image_view.rotateImage(90) R.id.portrait_aspect_ratio -> changeAspectRatio(false) R.id.landscape_aspect_ratio -> changeAspectRatio(true) @@ -85,6 +90,24 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete invalidateOptionsMenu() } + @SuppressLint("InlinedApi") + private fun confirmWallpaper() { + if (isNougatPlus()) { + val items = arrayListOf( + RadioItem(WallpaperManager.FLAG_SYSTEM, getString(R.string.home_screen)), + RadioItem(WallpaperManager.FLAG_LOCK, getString(R.string.lock_screen)), + RadioItem(WallpaperManager.FLAG_SYSTEM or WallpaperManager.FLAG_LOCK, getString(R.string.home_and_lock_screen))) + + RadioGroupDialog(this, items) { + wallpaperFlag = it as Int + crop_image_view.getCroppedImageAsync() + } + } else { + crop_image_view.getCroppedImageAsync() + } + } + + @SuppressLint("NewApi") override fun onCropImageComplete(view: CropImageView?, result: CropImageView.CropResult) { if (isActivityDestroyed()) return @@ -97,7 +120,12 @@ class SetWallpaperActivity : SimpleActivity(), CropImageView.OnCropImageComplete val ratio = wantedHeight / bitmap.height.toFloat() val wantedWidth = (bitmap.width * ratio).toInt() try { - wallpaperManager.setBitmap(Bitmap.createScaledBitmap(bitmap, wantedWidth, wantedHeight, true)) + val scaledBitmap = Bitmap.createScaledBitmap(bitmap, wantedWidth, wantedHeight, true) + if (isNougatPlus()) { + wallpaperManager.setBitmap(scaledBitmap, null, true, wallpaperFlag) + } else { + wallpaperManager.setBitmap(scaledBitmap) + } setResult(Activity.RESULT_OK) } catch (e: OutOfMemoryError) { toast(R.string.out_of_memory_error) From c614d311263fe50e0e9ee4b392979cf8de59c4a7 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Sat, 2 Dec 2017 13:26:30 +0300 Subject: [PATCH 05/19] Update strings.xml --- app/src/main/res/values-ru/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 5a097f2b2..134d082ac 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -88,9 +88,9 @@ Обои успешно установлены Портрет Ландшафт - Home screen - Lock screen - Home and lock screen + Домашний экран + Экран блокировки + Домашний экран и экран блокировки Слайдшоу From ef20251d66aec8e80d7b7cab483a2e3410a52f33 Mon Sep 17 00:00:00 2001 From: Phoenix1747 Date: Sun, 3 Dec 2017 13:50:23 +0100 Subject: [PATCH 06/19] Translated missing strings to DE --- 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 f1b33f18c..bff9ec074 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -88,9 +88,9 @@ Hintergrundbild erfolgreich festgelegt Hochformat Querformat - Home screen - Lock screen - Home and lock screen + Home-Screen + Sperrbildschirm + Home- und Sperrbildschirm Diashow From 0579cf48006cbfa984a9fc7e6486ccc11d26766b Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sun, 3 Dec 2017 19:00:40 +0100 Subject: [PATCH 07/19] 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 cef6f6e31..188e0c7bf 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -88,9 +88,9 @@ Achtergrond is ingesteld Verhouding in portretmodus Verhouding in landschapsmodus - Home screen - Lock screen - Home and lock screen + Startscherm + Vergrendelingsscherm + Start- en vergrendelingsscherm Diavoorstelling From 539d6ee16df2f6df7acdb4115a7dee119ca92922 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 3 Dec 2017 21:56:11 +0100 Subject: [PATCH 08/19] rename extension files to start with capital letters, no functionality change --- app/build.gradle | 2 +- .../gallery/extensions/{activity.kt => Activity.kt} | 0 .../gallery/extensions/{arrayList.kt => ArrayList.kt} | 0 .../gallery/extensions/{context.kt => Context.kt} | 0 .../simplemobiletools/gallery/extensions/{file.kt => File.kt} | 0 .../gallery/extensions/{resources.kt => Resources.kt} | 0 .../gallery/extensions/{string.kt => String.kt} | 0 7 files changed, 1 insertion(+), 1 deletion(-) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{activity.kt => Activity.kt} (100%) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{arrayList.kt => ArrayList.kt} (100%) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{context.kt => Context.kt} (100%) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{file.kt => File.kt} (100%) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{resources.kt => Resources.kt} (100%) rename app/src/main/kotlin/com/simplemobiletools/gallery/extensions/{string.kt => String.kt} (100%) diff --git a/app/build.gradle b/app/build.gradle index 3678e7ab2..588a3158e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.22' + implementation 'com.simplemobiletools:commons:3.0.23' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/arrayList.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/arrayList.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/ArrayList.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/file.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/file.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/File.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/resources.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/resources.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/String.kt similarity index 100% rename from app/src/main/kotlin/com/simplemobiletools/gallery/extensions/string.kt rename to app/src/main/kotlin/com/simplemobiletools/gallery/extensions/String.kt From 6a94ac11bcbe7ac91ae57f0462c5cc13c5ceb8bf Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 3 Dec 2017 23:52:10 +0100 Subject: [PATCH 09/19] moving some Menu related functions, no code change --- .../gallery/activities/MainActivity.kt | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 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 b8d3cfc77..68e9da258 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -93,38 +93,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsPasswordProtectionPending = config.appPasswordProtectionOn } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - if (mIsThirdPartyIntent) { - menuInflater.inflate(R.menu.menu_main_intent, menu) - } else { - menuInflater.inflate(R.menu.menu_main, menu) - menu.findItem(R.id.increase_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt < MAX_COLUMN_COUNT - menu.findItem(R.id.reduce_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt > 1 - } - menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden - menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden - return true - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - when (item.itemId) { - R.id.sort -> showSortingDialog() - R.id.filter -> showFilterMediaDialog() - R.id.open_camera -> launchCamera() - R.id.show_all -> showAllMedia() - R.id.change_view_type -> changeViewType() - R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() - R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() - R.id.create_new_folder -> createNewFolder() - R.id.increase_column_count -> increaseColumnCount() - R.id.reduce_column_count -> reduceColumnCount() - R.id.settings -> launchSettings() - R.id.about -> launchAbout() - else -> return super.onOptionsItemSelected(item) - } - return true - } - override fun onResume() { super.onResume() config.isThirdPartyIntent = false @@ -191,6 +159,38 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { removeTempFolder() } + override fun onCreateOptionsMenu(menu: Menu): Boolean { + if (mIsThirdPartyIntent) { + menuInflater.inflate(R.menu.menu_main_intent, menu) + } else { + menuInflater.inflate(R.menu.menu_main, menu) + menu.findItem(R.id.increase_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt < MAX_COLUMN_COUNT + menu.findItem(R.id.reduce_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt > 1 + } + menu.findItem(R.id.temporarily_show_hidden).isVisible = !config.shouldShowHidden + menu.findItem(R.id.stop_showing_hidden).isVisible = config.temporarilyShowHidden + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.sort -> showSortingDialog() + R.id.filter -> showFilterMediaDialog() + R.id.open_camera -> launchCamera() + R.id.show_all -> showAllMedia() + R.id.change_view_type -> changeViewType() + R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() + R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden() + R.id.create_new_folder -> createNewFolder() + R.id.increase_column_count -> increaseColumnCount() + R.id.reduce_column_count -> reduceColumnCount() + R.id.settings -> launchSettings() + R.id.about -> launchAbout() + else -> return super.onOptionsItemSelected(item) + } + return true + } + private fun getDirectoryAdapter() = directories_grid.adapter as? DirectoryAdapter private fun storeStateVariables() { From aa5fc4beb9d7e964ee438e6ed36a4e8f2e26d1ec Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 09:27:18 +0100 Subject: [PATCH 10/19] updating some Spanish strings --- 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 93346c03f..c5c899c29 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -27,7 +27,7 @@ Unlock orientation - Filter media + Filtro de medios Images Videos GIFs @@ -106,7 +106,7 @@ No media for the slideshow have been found - Change view type + Cambiar tipo de vista Grid List @@ -125,11 +125,11 @@ Utilizar siempre fondo oscuro en pantalla completa Desplazar miniaturas horizontalmente Ocultar automáticamente la interfaz de usuario del sistema en medios de pantalla completa - Delete empty folders after deleting their content - Allow controlling video volume and brightness with vertical gestures - Show folder media count on the main view + Eliminar carpetas vacias despues de borrar su contenido + Permite controlar el volumen y el brillo del video con gestos verticales + Mostrar el conteo de medios de las carpetas en la vista principal Reemplazar Compartir con Girar en el menú de pantalla completa - Show extended details over fullscreen media + Mostrar detalles extendidos sobre medios en pantalla completa Manage extended details From 454ea7a394c78cdf561f2227c1c78172e458b965 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 10:51:44 +0100 Subject: [PATCH 11/19] remove the ca strings file --- app/src/main/res/values-ca/strings.xml | 152 ------------------------- 1 file changed, 152 deletions(-) delete mode 100644 app/src/main/res/values-ca/strings.xml diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml deleted file mode 100644 index 618f119c5..000000000 --- a/app/src/main/res/values-ca/strings.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - Simple Gallery - Gallery - Edit - Open camera - (hidden) - Pin folder - Unpin folder - Show all folders content - All folders - Switch to folder view - Other folder - Show on map - Unknown location - No application with maps has been found - No Camera app has been found - Increase column count - Reduce column count - Change cover image - Select photo - Use default - Volume - Brightness - Do not ask again in this session - Lock orientation - Unlock orientation - - - Filter media - Images - Videos - GIFs - No media files have been found with the selected filters. - Change filters - - - This function hides the folder by adding a \'.nomedia\' file into it, it will hide all subfolders too. You can see them by toggling the \'Show hidden folders\' option in Settings. Continue? - Exclude - Excluded folders - Manage excluded folders - This will exclude the selection together with its subfolders from Simple Gallery only. You can manage excluded folders in Settings. - Exclude a parent instead? - Excluding folders will make them together with their subfolders hidden just in Simple Gallery, they will still be visible in other applications.\n\nIf you want to hide them from other apps too, use the Hide function. - Remove all - Remove all folders from the list of excluded? This will not delete the folders. - - - Included folders - Manage included folders - Add folder - If you have some folders which contain media, but were not recognized by the app, you can add them manually here.\n\nAdding some items here will not exclude any other folder. - - - Resize - Resize selection and save - Width - Height - Keep aspect ratio - Please enter a valid resolution - - - Editor - Save - Rotate - Path - Invalid image path - Image editing failed - Edit image with: - No image editor found - Unknown file location - Could not overwrite the source file - Rotate left - Rotate right - Rotate by 180º - Flip - Flip horizontally - Flip vertically - Edit with - - - Simple Wallpaper - Set as Wallpaper - Setting as Wallpaper failed - Set as wallpaper with: - No app capable of it has been found - Setting wallpaper… - Wallpaper set successfully - Portrait aspect ratio - Landscape aspect ratio - Home screen - Lock screen - Home and lock screen - - - Slideshow - Interval (seconds): - Include photos - Include videos - Include GIFs - Random order - Use fade animations - Move backwards - Loop slideshow - The slideshow ended - No media for the slideshow have been found - - - Change view type - Grid - List - - - Show hidden media - Play videos automatically - Toggle filename visibility - Loop videos - Animate GIFs at thumbnails - Max brightness when viewing media - Crop thumbnails into squares - Rotate fullscreen media by - System setting - Device rotation - Aspect ratio - Dark background at fullscreen media - Scroll thumbnails horizontally - Automatically hide system UI at fullscreen media - Delete empty folders after deleting their content - Allow controlling video volume and brightness with vertical gestures - Show folder media count on the main view - Replace Share with Rotate at fullscreen menu - Show extended details over fullscreen media - Manage extended details - - - - A gallery for viewing photos and videos without ads. - - A simple tool usable for viewing photos and videos. Items can be sorted by date, size, name both ascending or descending, photos can be zoomed in. Media files are shown in multiple columns depending on the size of the display, you can change the column count by pinch gestures. They can be renamed, shared, deleted, copied, moved. Images can also be cropped, rotated, flipped or set as Wallpaper directly from the app. - - The Gallery is also offered for third party usage for previewing images / videos, adding attachments at email clients etc. It\'s perfect for everyday usage. - - Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors. - - This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com - - - - From c0486dfd89118d9e5f77810dd9920c1f638ad881 Mon Sep 17 00:00:00 2001 From: fricyo <30796677+fricyo@users.noreply.github.com> Date: Tue, 5 Dec 2017 00:14:12 +0800 Subject: [PATCH 12/19] Translation update --- app/src/main/res/values-zh-rTW/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f5552d15f..f7a152dce 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -88,9 +88,9 @@ 成功設為桌布 直向長寬比 橫向長寬比 - Home screen - Lock screen - Home and lock screen + 主頁螢幕 + 鎖定螢幕 + 主頁和鎖定螢幕 投影片 From e35fd314517330e58986c24742e8fa634e91341a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 23:33:11 +0100 Subject: [PATCH 13/19] update commons to 3.1.2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 588a3158e..9d5548b83 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.23' + implementation 'com.simplemobiletools:commons:3.1.2' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' From 81a390ef5cb86a75dd454a13f094522e02097c27 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 23:33:21 +0100 Subject: [PATCH 14/19] update the svg icons --- .../res/drawable-v26/ic_launcher_foreground.xml | 10 ++++------ .../main/res/mipmap-anydpi-v21/ic_launcher.xml | 15 ++++++--------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/src/main/res/drawable-v26/ic_launcher_foreground.xml b/app/src/main/res/drawable-v26/ic_launcher_foreground.xml index 4a7af2a01..5f01b3af0 100644 --- a/app/src/main/res/drawable-v26/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable-v26/ic_launcher_foreground.xml @@ -5,11 +5,9 @@ android:viewportHeight="108" android:viewportWidth="108"> + android:fillColor="#FFFFFF" + android:pathData="M63.58,40.16m-5.73,0a5.73,5.73 0,1 1,11.47 0a5.73,5.73 0,1 1,-11.47 0"/> + android:fillColor="#FFFFFF" + android:pathData="M47.37,46.64l-17.45,25.43l45.46,0l-9.89,-16.21l-5.9,8.39z"/> diff --git a/app/src/main/res/mipmap-anydpi-v21/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v21/ic_launcher.xml index b50665400..7a579a35d 100644 --- a/app/src/main/res/mipmap-anydpi-v21/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v21/ic_launcher.xml @@ -5,15 +5,12 @@ android:viewportHeight="108" android:viewportWidth="108"> + android:fillColor="#F57C00" + android:pathData="M54.3,103.2L54.3,103.2c-27,0 -48.9,-21.9 -48.9,-48.9v0c0,-27 21.9,-48.9 48.9,-48.9h0c27,0 48.9,21.9 48.9,48.9v0C103.2,81.3 81.3,103.2 54.3,103.2z"/> + android:fillColor="#FFFFFF" + android:pathData="M65.8,37.5m-6.9,0a6.9,6.9 0,1 1,13.8 0a6.9,6.9 0,1 1,-13.8 0"/> + android:fillColor="#FFFFFF" + android:pathData="M68.1,56.4l-7.1,10.1l-14.7,-21.2l-21,30.6l54.7,0z"/> From af536df62218b342a09b5992053e7e473147f9bc Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 23:33:42 +0100 Subject: [PATCH 15/19] update version to 3.0.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9d5548b83..0ce8c6997 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.simplemobiletools.gallery" minSdkVersion 16 targetSdkVersion 27 - versionCode 145 - versionName "2.19.0" + versionCode 146 + versionName "3.0.0" multiDexEnabled true setProperty("archivesBaseName", "gallery") } From f5836ea0e9710cbb900018f2f1e6d15a91acf762 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Dec 2017 23:33:48 +0100 Subject: [PATCH 16/19] updating changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a15ade565..c63eabc11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 3.0.0 *(2017-12-04)* +---------------------------- + + * Improved primary color customization + * Allow setting home and lock screen wallpapers separately on Android 7+ + * Many smaller performance and stability improvements + Version 2.19.0 *(2017-11-23)* ---------------------------- From 83a0f0cff0d69485116102e10585cfe39835a641 Mon Sep 17 00:00:00 2001 From: Pzqqt <821026875@qq.com> Date: Tue, 5 Dec 2017 20:15:59 +0800 Subject: [PATCH 17/19] Update strings.xml --- app/src/main/res/values-zh-rCN/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8b73e4c33..f6107fd68 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -88,9 +88,9 @@ 壁纸设置成功 纵向长宽比 横向长宽比 - Home screen - Lock screen - Home and lock screen + 主屏幕壁纸 + 锁屏壁纸 + 主屏幕和锁屏壁纸 幻灯片 From 2341d0f009c80c4e7f41285de3f2362190185376 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 5 Dec 2017 23:28:04 +0100 Subject: [PATCH 18/19] update commons to 3.1.3 --- app/build.gradle | 2 +- .../simplemobiletools/gallery/activities/MainActivity.kt | 4 ++-- .../simplemobiletools/gallery/activities/MediaActivity.kt | 4 ++-- app/src/main/res/layout/activity_main.xml | 8 +------- app/src/main/res/layout/activity_media.xml | 8 +------- app/src/main/res/layout/dialog_directory_picker.xml | 8 +------- app/src/main/res/layout/dialog_medium_picker.xml | 8 +------- 7 files changed, 9 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0ce8c6997..5148e061c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.1.2' + implementation 'com.simplemobiletools:commons:3.1.3' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.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 68e9da258..44f01058e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -319,8 +319,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun checkIfColorChanged() { if (directories_grid.adapter != null && getRecyclerAdapter().primaryColor != config.primaryColor) { getRecyclerAdapter().primaryColor = config.primaryColor - directories_vertical_fastscroller.updateHandleColor() - directories_horizontal_fastscroller.updateHandleColor() + directories_vertical_fastscroller.updatePrimaryColor() + directories_horizontal_fastscroller.updatePrimaryColor() } } 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 0b5622186..25e32a347 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -165,8 +165,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun checkIfColorChanged() { if (media_grid.adapter != null && getRecyclerAdapter().primaryColor != config.primaryColor) { getRecyclerAdapter().primaryColor = config.primaryColor - media_horizontal_fastscroller.updateHandleColor() - media_vertical_fastscroller.updateHandleColor() + media_horizontal_fastscroller.updatePrimaryColor() + media_vertical_fastscroller.updatePrimaryColor() } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 073f3fd19..828d2689b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -50,13 +50,7 @@ android:paddingLeft="@dimen/normal_margin" android:paddingStart="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/activity_media.xml b/app/src/main/res/layout/activity_media.xml index 95bc05417..6741e00fe 100644 --- a/app/src/main/res/layout/activity_media.xml +++ b/app/src/main/res/layout/activity_media.xml @@ -50,13 +50,7 @@ android:paddingLeft="@dimen/normal_margin" android:paddingStart="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/dialog_directory_picker.xml b/app/src/main/res/layout/dialog_directory_picker.xml index 6265d6d8b..824e8db82 100644 --- a/app/src/main/res/layout/dialog_directory_picker.xml +++ b/app/src/main/res/layout/dialog_directory_picker.xml @@ -24,13 +24,7 @@ android:paddingLeft="@dimen/normal_margin" android:paddingStart="@dimen/normal_margin"> - + diff --git a/app/src/main/res/layout/dialog_medium_picker.xml b/app/src/main/res/layout/dialog_medium_picker.xml index 07e7f7678..01b630a1d 100644 --- a/app/src/main/res/layout/dialog_medium_picker.xml +++ b/app/src/main/res/layout/dialog_medium_picker.xml @@ -23,13 +23,7 @@ android:paddingLeft="@dimen/normal_margin" android:paddingStart="@dimen/normal_margin"> - + From da2db7991359126e85d6f202d3905e91178fcfa2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 5 Dec 2017 23:45:09 +0100 Subject: [PATCH 19/19] show an info bubble at fastscroller dragging --- app/build.gradle | 2 +- .../gallery/activities/MainActivity.kt | 4 +++- .../gallery/activities/MediaActivity.kt | 4 +++- .../gallery/fragments/ViewPagerFragment.kt | 2 +- .../com/simplemobiletools/gallery/models/Directory.kt | 9 +++++++++ .../com/simplemobiletools/gallery/models/Medium.kt | 11 ++++++++--- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5148e061c..d54939b3c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.1.3' + implementation 'com.simplemobiletools:commons:3.1.4' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.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 44f01058e..aca94dfc4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -583,7 +583,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (allowHorizontalScroll) { directories_horizontal_fastscroller.setViews(directories_grid, directories_refresh_layout) } else { - directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) + directories_vertical_fastscroller.setViews(directories_grid, directories_refresh_layout) { + directories_vertical_fastscroller.updateBubbleText(mDirs[it].getBubbleText()) + } } } 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 25e32a347..4f231fd42 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -203,7 +203,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (allowHorizontalScroll) { media_horizontal_fastscroller.setViews(media_grid, media_refresh_layout) } else { - media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) + media_vertical_fastscroller.setViews(media_grid, media_refresh_layout) { + media_vertical_fastscroller.updateBubbleText(mMedia[it].getBubbleText()) + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt index 7ccb83d45..d4ddfa698 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/ViewPagerFragment.kt @@ -45,7 +45,7 @@ abstract class ViewPagerFragment : Fragment() { } if (detailsFlag and EXT_LAST_MODIFIED != 0) { - file.lastModified().formatLastModified().let { if (it.isNotEmpty()) details.appendln(it) } + file.lastModified().formatDate().let { if (it.isNotEmpty()) details.appendln(it) } } if (detailsFlag and EXT_DATE_TAKEN != 0) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index d03b4d1be..e545ff080 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -1,5 +1,7 @@ package com.simplemobiletools.gallery.models +import com.simplemobiletools.commons.extensions.formatDate +import com.simplemobiletools.commons.extensions.formatSize import com.simplemobiletools.commons.helpers.* import java.io.Serializable @@ -37,4 +39,11 @@ data class Directory(val path: String, val tmb: String, val name: String, var me } return result } + + fun getBubbleText() = when { + sorting and SORT_BY_SIZE != 0 -> size.formatSize() + sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate() + sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate() + else -> name + } } 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 bf15cd20c..638dc3f9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -1,8 +1,6 @@ package com.simplemobiletools.gallery.models -import com.simplemobiletools.commons.extensions.getMimeTypeFromPath -import com.simplemobiletools.commons.extensions.isGif -import com.simplemobiletools.commons.extensions.isPng +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* import java.io.Serializable @@ -48,4 +46,11 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo } return result } + + fun getBubbleText() = when { + sorting and SORT_BY_SIZE != 0 -> size.formatSize() + sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate() + sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate() + else -> name + } }