diff --git a/app/src/main/java/com/simplemobiletools/gallery/Config.java b/app/src/main/java/com/simplemobiletools/gallery/Config.java index c40f726ad..a6c1c998b 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Config.java +++ b/app/src/main/java/com/simplemobiletools/gallery/Config.java @@ -110,4 +110,12 @@ public class Config { public void setAutoplayVideos(boolean autoplay) { mPrefs.edit().putBoolean(Constants.AUTOPLAY_VIDEOS, autoplay).apply(); } + + public String getTreeUri() { + return mPrefs.getString(Constants.TREE_URI, ""); + } + + public void setTreeUri(String uri) { + mPrefs.edit().putString(Constants.TREE_URI, uri).apply(); + } } diff --git a/app/src/main/java/com/simplemobiletools/gallery/Constants.java b/app/src/main/java/com/simplemobiletools/gallery/Constants.java index 429de434f..7b892bffe 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Constants.java +++ b/app/src/main/java/com/simplemobiletools/gallery/Constants.java @@ -18,6 +18,7 @@ public class Constants { public static final String HIDDEN_FOLDERS = "hidden_folders"; public static final String SHOW_HIDDEN_FOLDERS = "show_hidden_folders"; public static final String AUTOPLAY_VIDEOS = "autoplay_videos"; + public static final String TREE_URI = "tree_uri"; // sorting public static final int SORT_BY_NAME = 1; diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/WritePermissionDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/WritePermissionDialog.kt new file mode 100644 index 000000000..0000ce4ca --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/WritePermissionDialog.kt @@ -0,0 +1,31 @@ +package com.simplemobiletools.gallery.dialogs + +import android.content.Context +import android.support.v7.app.AlertDialog +import android.view.LayoutInflater +import com.simplemobiletools.gallery.R + +class WritePermissionDialog(val context: Context, val listener: OnWritePermissionListener) { + var dialog: AlertDialog? = null + + init { + val view = LayoutInflater.from(context).inflate(R.layout.dialog_write_permission, null) + + dialog = AlertDialog.Builder(context) + .setTitle(context.resources.getString(R.string.confirm_storage_access_title)) + .setView(view) + .setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() }) + .create() + + dialog?.show() + } + + private fun dialogConfirmed() { + dialog?.dismiss() + listener.onConfirmed() + } + + interface OnWritePermissionListener { + fun onConfirmed() + } +} diff --git a/app/src/main/res/layout/dialog_write_permission.xml b/app/src/main/res/layout/dialog_write_permission.xml new file mode 100644 index 000000000..5cb3ae03d --- /dev/null +++ b/app/src/main/res/layout/dialog_write_permission.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/app/src/main/res/mipmap-hdpi/write_storage.png b/app/src/main/res/mipmap-hdpi/write_storage.png new file mode 100644 index 000000000..01110d81e Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/write_storage.png differ diff --git a/app/src/main/res/mipmap-mdpi/write_storage.png b/app/src/main/res/mipmap-mdpi/write_storage.png new file mode 100644 index 000000000..dbdfe8f1d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/write_storage.png differ diff --git a/app/src/main/res/mipmap-xhdpi/write_storage.png b/app/src/main/res/mipmap-xhdpi/write_storage.png new file mode 100644 index 000000000..758e02a02 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/write_storage.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/write_storage.png b/app/src/main/res/mipmap-xxhdpi/write_storage.png new file mode 100644 index 000000000..9a7c465c9 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/write_storage.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/write_storage.png b/app/src/main/res/mipmap-xxxhdpi/write_storage.png new file mode 100644 index 000000000..e61915498 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/write_storage.png differ diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index a5af8ec51..4f5cd25c7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -35,6 +35,8 @@ Ordner verstecken Ordner sichtbar machen (versteckt) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 Ordner gelöscht diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 5d19056c7..9bf20d45a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 carpeta eliminada diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index c4f1513b0..69f46ee51 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 cartella eliminata diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 6fbb04242..39b44884c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 フォルダーを削除しました diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index cc3a126c5..215411e99 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 pasta eliminada diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 710cd65c9..c1e3cc2d7 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 mapp borttagen diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f1f1b48fb..8f36aef60 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -35,6 +35,8 @@ Hide folder Unhide folder (hidden) + Confirm external storage access + Please choose the root folder of the SD card to grant write access on the next screen 1 folder deleted