From fc8fb7cda81c0022157ddb46c36f5b88adfe3e56 Mon Sep 17 00:00:00 2001 From: gregory678 Date: Tue, 27 Feb 2018 16:54:10 +0100 Subject: [PATCH 01/16] PL translation update [2018.02.27] --- app/src/main/res/values-pl/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 1b285bf3a..eeff4b5e4 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -160,8 +160,8 @@    Wejdź do ustawień aplikacji i w sekcji z dołączonymi folderami dodaj tenże folder do listy.    Co jeśli chcę widzieć tylko.wybrane foldery?    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. - 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. +    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. From dc0ca76fb36d28ea7a08fc0b029b304a6b8e0744 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Wed, 28 Feb 2018 13:48:32 +0100 Subject: [PATCH 02/16] Updated German FAQ section --- app/src/main/res/values-de/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 2aaa5215e..78264a495 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -153,10 +153,10 @@ Du kannst lange auf das gewünschte Album drücken und im Aktionsmenü das Stecknadelsymbol auswählen; es wird nun zuoberst angepinnt. Ebenso kannst du mehrere Ordner anpinnen. Angepinnte Objekte werden nach der Standardmethode sortiert. Wie kann ich Videos vorspulen? Du kannst auf den Text der aktuellen oder der maximalen Dauer nahe der Suchleiste drücken, um das Video zurück- oder vorzuspulen. - What is the difference between hiding and excluding a folder? - Exclude prevents displaying the folder only in Simple Gallery, while Hide works system-wise and it hides the folder from other galleries too. It works by creating an empty \".nomedia\" file in the given folder, which you can then remove with any file manager too. - Why do folders with music cover art or stickers show up? - It can happen that you will see some unusual albums show up. You can easily exclude them by long pressing them and selecting Exclude. In the next dialog you can then select the parent folder, chances are it will prevent the other related albums showing up too. + Was ist der Unterschied zwischen Verstecken und Ausschliessen eines Ordners? + Ausschliessen verhindert lediglich, dass der Ordner in Schlichte Galerie angezeigt, Verstecken hingegen funktioniert systemweit und versteckt den Ordner auch vor anderen Gallerieapps. Dies funktioniert durch das Erstellen einer leeren \".nomedia\"-Datei im betroffenen Ordner, welche du mit jedem Dateimanager löschen kannst. + Wieso erscheinen Ordner mit Musik-Cover oder Stickers? + Es kann geschehen, dass manche ungewöhnliche Alben erscheinen. Diese kannst du ausschliessen durch gedrückt halten und Auswählen von Ausschliessen. Im nächsten Dialog kannst du den übergeordneten Ordner auswählen und dadurch sollten die anderen zugehörigen Alben auch nicht auftauchen. A folder with images isn\'t showing up, what can I do? That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. What if I want just a few particular folders visible? From 6cb8a7926e7e9a0a087ade36120050462775d4c1 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Thu, 1 Mar 2018 16:04:56 +0100 Subject: [PATCH 03/16] Updated last bit of German FAQ --- app/src/main/res/values-de/strings.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 78264a495..b192ccdcc 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -157,13 +157,13 @@ Ausschliessen verhindert lediglich, dass der Ordner in Schlichte Galerie angezeigt, Verstecken hingegen funktioniert systemweit und versteckt den Ordner auch vor anderen Gallerieapps. Dies funktioniert durch das Erstellen einer leeren \".nomedia\"-Datei im betroffenen Ordner, welche du mit jedem Dateimanager löschen kannst. Wieso erscheinen Ordner mit Musik-Cover oder Stickers? Es kann geschehen, dass manche ungewöhnliche Alben erscheinen. Diese kannst du ausschliessen durch gedrückt halten und Auswählen von Ausschliessen. Im nächsten Dialog kannst du den übergeordneten Ordner auswählen und dadurch sollten die anderen zugehörigen Alben auch nicht auftauchen. - A folder with images isn\'t showing up, what can I do? - That can have multiple reasons, but solving it is easy. Just go in Settings -> Manage Included Folders, select Plus and navigate to the required folder. - What if I want just a few particular folders visible? - Adding a folder at the Included Folders doesn\'t automatically exclude anything. What you can do is go in Settings -> Manage Excluded Folders, exclude the root folder \"/\", then add the desired folders at Settings -> Manage Included Folders. - 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. + Ein Ordner mit Bilder wird nicht angezeigt. Was kann ich tun? + Dies kann mehrere Gründe haben, aber es zu lösen ist einfach. Gehe einfach zu Einstellungen -> Einbezogene Ordner verwalten, wähle das Plus aus und navigiere zum gewünschten Ordner. + Was ist, wenn ich nur ein paar definierte Ordner sichtbar haben will? + Einen Ordner zu den einbezogenen Ordner hinzuzufügen schliesst nicht automatisch alle anderen aus. Eine Möglichkeit ist, in Einstellungen -> Ausgeschlossene Ordner verwalten den Stammordner \"/\" auszuschliessen und dann alle gewünschten Ordner in Einstellungen -> Einbezogene Ordner verwalten hinzuzufügen. + Dadurch werden nur die ausgewählten Ordner sichtbar, da Auschliessen und Einbeziehen rekursiv erfolgen und wenn ein Ordner ausgeschlossen und einbezogen wird, wird er 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. From ec716a365e3c33962f9d3a9e0e894b24d8fc2392 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Thu, 1 Mar 2018 16:12:52 +0100 Subject: [PATCH 04/16] Update strings.xml --- app/src/main/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b192ccdcc..d9162ada2 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -161,7 +161,7 @@ Dies kann mehrere Gründe haben, aber es zu lösen ist einfach. Gehe einfach zu Einstellungen -> Einbezogene Ordner verwalten, wähle das Plus aus und navigiere zum gewünschten Ordner. Was ist, wenn ich nur ein paar definierte Ordner sichtbar haben will? Einen Ordner zu den einbezogenen Ordner hinzuzufügen schliesst nicht automatisch alle anderen aus. Eine Möglichkeit ist, in Einstellungen -> Ausgeschlossene Ordner verwalten den Stammordner \"/\" auszuschliessen und dann alle gewünschten Ordner in Einstellungen -> Einbezogene Ordner verwalten hinzuzufügen. - Dadurch werden nur die ausgewählten Ordner sichtbar, da Auschliessen und Einbeziehen rekursiv erfolgen und wenn ein Ordner ausgeschlossen und einbezogen wird, wird er angezeigt. + Dadurch werden nur die ausgewählten Ordner sichtbar, da Auschliessen und Einbeziehen rekursiv erfolgen und wenn ein Ordner ausgeschlossen und einbezogen wird, 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. From c2cff20f031d09e43341aacb51cc3adc55215cb9 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Thu, 1 Mar 2018 19:41:08 +0100 Subject: [PATCH 05/16] Update strings.xml --- app/src/main/res/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d9162ada2..e35779506 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -161,7 +161,7 @@ Dies kann mehrere Gründe haben, aber es zu lösen ist einfach. Gehe einfach zu Einstellungen -> Einbezogene Ordner verwalten, wähle das Plus aus und navigiere zum gewünschten Ordner. Was ist, wenn ich nur ein paar definierte Ordner sichtbar haben will? Einen Ordner zu den einbezogenen Ordner hinzuzufügen schliesst nicht automatisch alle anderen aus. Eine Möglichkeit ist, in Einstellungen -> Ausgeschlossene Ordner verwalten den Stammordner \"/\" auszuschliessen und dann alle gewünschten Ordner in Einstellungen -> Einbezogene Ordner verwalten hinzuzufügen. - Dadurch werden nur die ausgewählten Ordner sichtbar, da Auschliessen und Einbeziehen rekursiv erfolgen und wenn ein Ordner ausgeschlossen und einbezogen wird, wird er dennoch angezeigt. + 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. From 39b46778874ccbfbf6e6b2eed26fba2a74a031df Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 16:53:34 +0100 Subject: [PATCH 06/16] use some helper functions for hiding/showing keyboard at dialogs --- app/build.gradle | 2 +- .../gallery/adapters/MyPagerAdapter.kt | 6 +- .../gallery/dialogs/ResizeDialog.kt | 30 +++++----- .../gallery/dialogs/SaveAsDialog.kt | 57 +++++++++---------- .../gallery/dialogs/SlideshowDialog.kt | 25 ++++---- build.gradle | 2 +- 6 files changed, 59 insertions(+), 63 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 143dea1d4..89fd8cf98 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.13.8' + implementation 'com.simplemobiletools:commons:3.14.5' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' implementation 'com.android.support:multidex:1.0.2' implementation 'com.google.code.gson:gson:2.8.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt index c6f7776ab..2068a7c55 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MyPagerAdapter.kt @@ -22,9 +22,7 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m val medium = media[position] val bundle = Bundle() bundle.putSerializable(MEDIUM, medium) - val fragment: ViewPagerFragment - - fragment = if (medium.isVideo()) { + val fragment = if (medium.isVideo()) { VideoFragment() } else { PhotoFragment() @@ -39,7 +37,7 @@ class MyPagerAdapter(val activity: ViewPagerActivity, fm: FragmentManager, val m override fun instantiateItem(container: ViewGroup, position: Int): Any { val fragment = super.instantiateItem(container, position) as ViewPagerFragment - fragments.put(position, fragment) + fragments[position] = fragment return fragment } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt index 33737957c..3489dd060 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt @@ -4,10 +4,10 @@ import android.graphics.Point import android.support.v7.app.AlertDialog import android.text.Editable import android.text.TextWatcher -import android.view.WindowManager import android.widget.EditText import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff +import com.simplemobiletools.commons.extensions.showKeyboard import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.value import com.simplemobiletools.gallery.R @@ -72,22 +72,22 @@ class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callba .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) .create().apply { - window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) - activity.setupDialogStuff(view, this, R.string.resize_and_save) { - getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { - val width = getViewValue(widthView) - val height = getViewValue(heightView) - if (width <= 0 || height <= 0) { - activity.toast(R.string.invalid_values) - return@setOnClickListener - } + activity.setupDialogStuff(view, this, R.string.resize_and_save) { + showKeyboard(view.image_width) + getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + val width = getViewValue(widthView) + val height = getViewValue(heightView) + if (width <= 0 || height <= 0) { + activity.toast(R.string.invalid_values) + return@setOnClickListener + } - val newSize = Point(getViewValue(widthView), getViewValue(heightView)) - callback(newSize) - dismiss() + val newSize = Point(getViewValue(widthView), getViewValue(heightView)) + callback(newSize) + dismiss() + } + } } - } - } } fun getViewValue(view: EditText): Int { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 201de45dd..821706d9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.WindowManager import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.FilePickerDialog @@ -45,40 +44,40 @@ class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appen .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) .create().apply { - window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) - activity.setupDialogStuff(view, this, R.string.save_as) { - getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { - val filename = view.save_as_name.value - val extension = view.save_as_extension.value + activity.setupDialogStuff(view, this, R.string.save_as) { + showKeyboard(view.save_as_name) + getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + val filename = view.save_as_name.value + val extension = view.save_as_extension.value - if (filename.isEmpty()) { - activity.toast(R.string.filename_cannot_be_empty) - return@setOnClickListener - } + if (filename.isEmpty()) { + activity.toast(R.string.filename_cannot_be_empty) + return@setOnClickListener + } - if (extension.isEmpty()) { - activity.toast(R.string.extension_cannot_be_empty) - return@setOnClickListener - } + if (extension.isEmpty()) { + activity.toast(R.string.extension_cannot_be_empty) + return@setOnClickListener + } - val newFile = File(realPath, "$filename.$extension") - if (!newFile.name.isAValidFilename()) { - activity.toast(R.string.filename_invalid_characters) - return@setOnClickListener - } + val newFile = File(realPath, "$filename.$extension") + if (!newFile.name.isAValidFilename()) { + activity.toast(R.string.filename_invalid_characters) + return@setOnClickListener + } - if (newFile.exists()) { - val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newFile.name) - ConfirmationDialog(activity, title) { - callback(newFile.absolutePath) - dismiss() + if (newFile.exists()) { + val title = String.format(activity.getString(R.string.file_already_exists_overwrite), newFile.name) + ConfirmationDialog(activity, title) { + callback(newFile.absolutePath) + dismiss() + } + } else { + callback(newFile.absolutePath) + dismiss() + } } - } else { - callback(newFile.absolutePath) - dismiss() } } - } - } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt index 2facd4654..58a4935dd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog import android.view.View -import android.view.WindowManager import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.setupDialogStuff @@ -71,20 +70,20 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) .create().apply { - window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) - activity.setupDialogStuff(view, this) { - getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { - if (!view.include_photos.isChecked && !view.include_videos.isChecked && !view.include_gifs.isChecked) { - activity.toast(R.string.no_media_for_slideshow) - return@setOnClickListener - } + activity.setupDialogStuff(view, this) { + hideKeyboard() + getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + if (!view.include_photos.isChecked && !view.include_videos.isChecked && !view.include_gifs.isChecked) { + activity.toast(R.string.no_media_for_slideshow) + return@setOnClickListener + } - storeValues() - callback() - dismiss() + storeValues() + callback() + dismiss() + } + } } - } - } } private fun setupValues() { diff --git a/build.gradle b/build.gradle index 66c86d612..f056ba19c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.2.21' + ext.kotlin_version = '1.2.30' repositories { jcenter() From 063406a4718fa0c171d85d2128623b15945cae04 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 17:14:37 +0100 Subject: [PATCH 07/16] update commons to 3.14.6 --- app/build.gradle | 4 ++-- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 6 +++--- .../gallery/adapters/ManageFoldersAdapter.kt | 2 +- .../gallery/adapters/ManageHiddenFoldersAdapter.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 89fd8cf98..810c0e601 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,9 +46,9 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.14.5' + implementation 'com.simplemobiletools:commons:3.14.6' implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0' - implementation 'com.android.support:multidex:1.0.2' + implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.code.gson:gson:2.8.2' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.8' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index a795756e5..20e7802d7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -51,7 +51,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList, view?.medium_check?.beVisibleIf(select) } - override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val layoutType = if (isListViewType) R.layout.photo_video_item_list else R.layout.photo_video_item_grid return createViewHolder(layoutType, parent) } @@ -107,10 +107,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, override fun getSelectableItemCount() = media.size - override fun onViewRecycled(holder: ViewHolder?) { + override fun onViewRecycled(holder: ViewHolder) { super.onViewRecycled(holder) if (!activity.isActivityDestroyed()) { - val itemView = holder?.itemView + val itemView = holder.itemView visibleItemPaths.remove(itemView?.photo_name?.tag) Glide.with(activity).clear(itemView?.medium_thumbnail!!) } From f4a445dba58a5fb7e2ef0fe8f647aed9bdc38797 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 17:18:45 +0100 Subject: [PATCH 08/16] properly check nomedia files at ViewPagerActivity --- .../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 605565680..5077999da 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -625,7 +625,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View var parent = file.parentFile ?: return false while (true) { - if (parent.isHidden || parent.list()?.contains(NOMEDIA) == true) { + if (parent.isHidden || parent.list()?.any { it.startsWith(NOMEDIA) } == true) { return true } From 3949db6583b57ac6666578e50b47cdeba77c7c63 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 17:21:55 +0100 Subject: [PATCH 09/16] do not stop fetching directories on pause --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ---- 1 file changed, 4 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 c4142ac5b..9128424f1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -163,10 +163,6 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsGettingDirs = false storeStateVariables() mLastMediaHandler.removeCallbacksAndMessages(null) - - if (!mDirs.isEmpty()) { - mCurrAsyncTask?.stopFetching() - } } override fun onStop() { From 8a0dd4592baa2c097d61e88f3d3afb0df6c8d73d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 17:23:38 +0100 Subject: [PATCH 10/16] fix #683, make nomedia file checking more precise --- .../kotlin/com/simplemobiletools/gallery/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 4d3ac9961..248881172 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -98,7 +98,7 @@ fun Context.getNoMediaFolders(callback: (folders: ArrayList) -> Unit) { do { val path = cursor.getStringValue(MediaStore.Files.FileColumns.DATA) ?: continue val noMediaFile = File(path) - if (noMediaFile.exists()) { + if (noMediaFile.exists() && noMediaFile.name == NOMEDIA) { folders.add("${noMediaFile.parent}/") } } while (cursor.moveToNext()) From 1e3296fce12d2ff9e95f29bfc10b38136a16d292 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 17:31:18 +0100 Subject: [PATCH 11/16] fix #674, properly handle video progressbar padding on device rotations --- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index ce03f165b..f704912b6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -185,9 +185,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee private fun initTimeHolder() { val res = resources - val left = mTimeHolder!!.paddingLeft - val top = mTimeHolder!!.paddingTop - var right = mTimeHolder!!.paddingRight + val left = 0 + val top = 0 + var right = 0 var bottom = 0 if (hasNavBar()) { From 7dc0cb660c6861a04dc6b939979f1ac380be2390 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 2 Mar 2018 19:23:26 +0100 Subject: [PATCH 12/16] show a dialog about Simple Contacts under some circumstances --- app/build.gradle | 2 +- .../simplemobiletools/gallery/activities/MainActivity.kt | 8 ++++++++ .../com/simplemobiletools/gallery/helpers/Config.kt | 4 ++++ .../com/simplemobiletools/gallery/helpers/Constants.kt | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 810c0e601..d367229c7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.14.6' + implementation 'com.simplemobiletools:commons:3.14.7' 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 9128424f1..77a9a0e4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -16,6 +16,7 @@ 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 import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_READ_STORAGE @@ -44,6 +45,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private val PICK_MEDIA = 2 private val PICK_WALLPAPER = 3 private val LAST_MEDIA_CHECK_PERIOD = 3000L + private val CONTACTS_PACKAGE = "com.simplemobiletools.contacts" lateinit var mDirs: ArrayList @@ -99,6 +101,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsPasswordProtectionPending = config.appPasswordProtectionOn setupLatestMediaId() + + // notify the users about the Contacts app + 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() { 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 c8543c2e4..8a8e8b646 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -316,4 +316,8 @@ class Config(context: Context) : BaseConfig(context) { var doExtraCheck: Boolean get() = prefs.getBoolean(DO_EXTRA_CHECK, false) set(doExtraCheck) = prefs.edit().putBoolean(DO_EXTRA_CHECK, doExtraCheck).apply() + + var wasNewAppShown: Boolean + get() = prefs.getBoolean(WAS_NEW_APP_SHOWN, false) + set(wasNewAppShown) = prefs.edit().putBoolean(WAS_NEW_APP_SHOWN, wasNewAppShown).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 bf251b41b..509a5f1d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -46,6 +46,7 @@ const val ONE_FINGER_ZOOM = "one_finger_zoom" const val ALLOW_INSTANT_CHANGE = "allow_instant_change" const val REPLACE_ZOOMABLE_IMAGES = "replace_zoomable_images" const val DO_EXTRA_CHECK = "do_extra_check" +const val WAS_NEW_APP_SHOWN = "was_new_app_shown" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval" From 443aa9449b95295691083bf81bc90e7997a0743e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 3 Mar 2018 16:45:10 +0100 Subject: [PATCH 13/16] rescan only paths which arent in mediastore yet --- app/build.gradle | 2 +- .../gallery/extensions/Context.kt | 18 ++++++++++++++++++ .../gallery/helpers/MediaFetcher.kt | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d367229c7..83e982e47 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.14.7' + implementation 'com.simplemobiletools:commons:3.14.12' 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/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 248881172..1be5ed7d8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -11,6 +11,7 @@ import android.provider.MediaStore import android.view.WindowManager 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.helpers.Config import com.simplemobiletools.gallery.helpers.NOMEDIA @@ -110,3 +111,20 @@ fun Context.getNoMediaFolders(callback: (folders: ArrayList) -> Unit) { callback(folders) }.start() } + +fun Context.isPathInMediaStore(path: String): Boolean { + if (path.startsWith(OTG_PATH)) { + return false + } + + val projection = arrayOf(MediaStore.Images.Media.DATE_MODIFIED) + val uri = MediaStore.Files.getContentUri("external") + val selection = "${MediaStore.MediaColumns.DATA} = ?" + val selectionArgs = arrayOf(path) + val cursor = contentResolver.query(uri, projection, selection, selectionArgs, null) + + cursor?.use { + return cursor.moveToFirst() + } + return false +} diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index d4016c36b..c4ae2a234 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -9,6 +9,7 @@ import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.containsNoMedia import com.simplemobiletools.gallery.extensions.doesParentHaveNoMedia +import com.simplemobiletools.gallery.extensions.isPathInMediaStore import com.simplemobiletools.gallery.models.Medium import java.io.File import java.util.LinkedHashMap @@ -64,7 +65,7 @@ class MediaFetcher(val context: Context) { files.forEach { val filePath = it.absolutePath if ((showHidden || !it.name.startsWith(".")) && !dirPaths.contains(filePath)) { - if (it.exists() && it.length() > 0 && it.isImageVideoGif()) { + if (it.exists() && it.length() > 0 && it.isImageVideoGif() && !context.isPathInMediaStore(it.absolutePath)) { newPaths.add(it.absolutePath) } } From 0e729e6a79970fb5feb08a85c1f6c5843249db5e Mon Sep 17 00:00:00 2001 From: "hanjoong.cho" Date: Sun, 4 Mar 2018 02:51:52 +0900 Subject: [PATCH 14/16] Update Korean translation --- app/src/main/res/values-ko-rKR/strings.xml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 7ffb81c98..ff98d7734 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -7,7 +7,7 @@ (숨기기) 폴더 고정 폴더 고정 해제 - Pin to the top + 상단에 고정 모든 폴더의 컨텐츠 보기 모든 폴더 폴더 보기로 변경 @@ -16,9 +16,9 @@ 위치정보 없음 섬네일크기 축소 섬네일크기 확대 - Change cover image + 커버 이미지 변경 사진 선택 - Use default + 기본값 사용 볼륨 밝기 다시 물어보지 않음 @@ -135,7 +135,7 @@ 전체화면 모드에서 한 손가락으로 확대 및 축소 측면 클릭으로 미디어 즉시변경 확대 축소 가능한 이미지를 더 좋은 품질로 교체 - Hide extended details when status bar is hidden + 상태 표시 줄이 숨겨져있을 때 확장 된 세부 정보 숨김 잘못된 파일 표시를 방지하기 위해 추가 검사 수행 @@ -169,15 +169,19 @@ 광고없이 사진과 동영상을 볼 수 있는 갤러리. - 사진과 비디오 보기위한 간편한 툴입니다. 날짜, 크기, 이름을 오름차순 또는 내림차순으로 정렬 할 수 있으며 사진을 확대 할 수 있습니다. 미디어 파일은 디스플레이의 크기에 따라 여러 열로 표시되며 핀치 제스처로 열 수를 변경할 수 있습니다. 이름 변경, 공유, 삭제, 복사, 이동이 가능합니다. 이미지는 자르기, 회전, 반전 또는 앱에서 직접 배경 화면으로 설정할 수도 있습니다. + 사진과 동영상을 간편하게 관리 할 수 있는 툴입니다. + + 날짜, 크기, 이름을 기준으로 정렬 할 수 있으며 사진을 확대 할 수 있습니다. 미디어 파일은 디스플레이의 크기에 맞춰 여러 열로 표시되며 핀치 제스처를 이용하여 변경 할 수도 있습니다. + + 이름변경, 공유, 삭제, 복사, 이동, 이미지편집, 배경화면 설정 등의 기능을 제공합니다. - 갤러리는 \'이미지/비디오 미리보기\', \'이메일 클라이언트에서 첨부파일 추가하기\' 등의 기능을 서드파티에 제공합니다. 언제나 완벽하게 사용할 수 있습니다. + 갤러리는 \'이미지/비디오 미리보기\', \'이메일 클라이언트에서 첨부파일 추가하기\' 등의 기능을 서드파티 애플리케이션에 제공합니다. 언제나 완벽하게 사용할 수 있습니다. - The fingerprint permission is needed for locking either hidden item visibility, or the whole app. + 앱을 잠그거나 숨김파일을 보기위하여 지문인식 기능을 사용하는 경우 지문사용 권한이 필요합니다. 광고가 포함되어 있거나, 불필요한 권한을 요청하지 않습니다. 이 앱의 모든 소스는 오픈소스이며, 사용자가 직접 애플리케이션의 컬러를 설정 할 수 있습니다. - 이 앱은 다양한 시리즈의 모바일앱 중 하나입니다. 나머지는 http://www.simplemobiletools.com 에서 찾아 보실 수 있습니다. + 이 앱은 다양한 시리즈의 모바일앱 중 하나입니다. 나머지는 http://www.simplemobiletools.com 에서 찾아보실 수 있습니다.