show an explanation dialog at first attempt to exclude a folder

This commit is contained in:
tibbi 2017-02-26 19:15:51 +01:00
parent 0a649df9c3
commit f354818b66
17 changed files with 40 additions and 17 deletions

View file

@ -15,6 +15,7 @@ import com.bumptech.glide.request.animation.GlideAnimation
import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.target.SimpleTarget
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.adapters.MediaAdapter import com.simplemobiletools.gallery.adapters.MediaAdapter
@ -119,7 +120,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
R.id.folder_view -> switchToFolderView() R.id.folder_view -> switchToFolderView()
R.id.hide_folder -> hideFolder() R.id.hide_folder -> hideFolder()
R.id.unhide_folder -> unhideFolder() R.id.unhide_folder -> unhideFolder()
R.id.exclude_folder -> excludeFolder() R.id.exclude_folder -> tryExcludeFolder()
R.id.increase_column_count -> increaseColumnCount() R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount() R.id.reduce_column_count -> reduceColumnCount()
R.id.settings -> launchSettings() R.id.settings -> launchSettings()
@ -166,6 +167,17 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
} }
private fun tryExcludeFolder() {
if (config.wasExcludeFolderTooltipShown) {
excludeFolder()
} else {
ConfirmationDialog(this, getString(R.string.exclude_folder_description)) {
config.wasExcludeFolderTooltipShown = true
excludeFolder()
}
}
}
private fun excludeFolder() { private fun excludeFolder() {
} }

View file

@ -78,7 +78,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
R.id.cab_unpin -> pinFolders(false) R.id.cab_unpin -> pinFolders(false)
R.id.cab_hide -> toggleFoldersVisibility(true) R.id.cab_hide -> toggleFoldersVisibility(true)
R.id.cab_unhide -> toggleFoldersVisibility(false) R.id.cab_unhide -> toggleFoldersVisibility(false)
R.id.exclude_folder -> excludeFolder() R.id.cab_exclude -> tryExcludeFolder()
R.id.cab_copy_move -> displayCopyDialog() R.id.cab_copy_move -> displayCopyDialog()
R.id.cab_select_all -> selectAll() R.id.cab_select_all -> selectAll()
R.id.cab_delete -> askConfirmDelete() R.id.cab_delete -> askConfirmDelete()
@ -185,6 +185,17 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
} }
} }
private fun tryExcludeFolder() {
if (config.wasExcludeFolderTooltipShown) {
excludeFolder()
} else {
ConfirmationDialog(activity, activity.getString(R.string.exclude_folder_description)) {
config.wasExcludeFolderTooltipShown = true
excludeFolder()
}
}
}
private fun excludeFolder() { private fun excludeFolder() {
} }

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Größe ändern</string> <string name="resize">Größe ändern</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Redimensionner</string> <string name="resize">Redimensionner</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Redimensionar</string> <string name="resize">Redimensionar</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Изменить размер</string> <string name="resize">Изменить размер</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">Táto funkcia skryje priečinok pridaním súboru \'.nomedia\'. Stále ho môžete vidieť zvolením možnosti \'Zobraziť skryté priečinky\' v nastaveniach. Pokračovať?</string> <string name="hide_folder_description">Táto funkcia skryje priečinok pridaním súboru \'.nomedia\'. Stále ho môžete vidieť zvolením možnosti \'Zobraziť skryté priečinky\' v nastaveniach. Pokračovať?</string>
<string name="exclude">Vylúčiť</string> <string name="exclude">Vylúčiť</string>
<string name="excluded_folders">Vylúčené priečinky</string> <string name="excluded_folders">Vylúčené priečinky</string>
<string name="exclude_folder_description">Táto funkcia ukryje priečinok iba pred Jednoduchou galériou. Spravovať vylúčené priečinky je možné v nastaveniach. Pokračovať?</string> <string name="exclude_folder_description">Táto funkcia ukryje výber iba pred Jednoduchou galériou. Spravovať vylúčené priečinky je možné v nastaveniach. Pokračovať?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Zmeniť veľkosť</string> <string name="resize">Zmeniť veľkosť</string>

View file

@ -26,7 +26,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Ändra storlek</string> <string name="resize">Ändra storlek</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Yeniden boyutlandır</string> <string name="resize">Yeniden boyutlandır</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">缩放</string> <string name="resize">缩放</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">縮放</string> <string name="resize">縮放</string>

View file

@ -28,7 +28,7 @@
<string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string> <string name="hide_folder_description">This function hides the folder by adding a \'.nomedia\' file into it. You can still see it by toggling \'Show hidden folders\' option in Settings. Continue?</string>
<string name="exclude">Exclude</string> <string name="exclude">Exclude</string>
<string name="excluded_folders">Excluded folders</string> <string name="excluded_folders">Excluded folders</string>
<string name="exclude_folder_description">This function will make this folder hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string> <string name="exclude_folder_description">This function will make the selection hidden only for Simple Gallery. You can manage hidden folders in Settings. Continue?</string>
<!-- Resizing --> <!-- Resizing -->
<string name="resize">Resize</string> <string name="resize">Resize</string>