add some things related to kitkat sdcard write permissions
This commit is contained in:
parent
165cff24e6
commit
4f74709774
16 changed files with 79 additions and 0 deletions
|
@ -110,4 +110,12 @@ public class Config {
|
||||||
public void setAutoplayVideos(boolean autoplay) {
|
public void setAutoplayVideos(boolean autoplay) {
|
||||||
mPrefs.edit().putBoolean(Constants.AUTOPLAY_VIDEOS, autoplay).apply();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ public class Constants {
|
||||||
public static final String HIDDEN_FOLDERS = "hidden_folders";
|
public static final String HIDDEN_FOLDERS = "hidden_folders";
|
||||||
public static final String SHOW_HIDDEN_FOLDERS = "show_hidden_folders";
|
public static final String SHOW_HIDDEN_FOLDERS = "show_hidden_folders";
|
||||||
public static final String AUTOPLAY_VIDEOS = "autoplay_videos";
|
public static final String AUTOPLAY_VIDEOS = "autoplay_videos";
|
||||||
|
public static final String TREE_URI = "tree_uri";
|
||||||
|
|
||||||
// sorting
|
// sorting
|
||||||
public static final int SORT_BY_NAME = 1;
|
public static final int SORT_BY_NAME = 1;
|
||||||
|
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
25
app/src/main/res/layout/dialog_write_permission.xml
Normal file
25
app/src/main/res/layout/dialog_write_permission.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/dialog_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dialog_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
|
android:text="@string/confirm_storage_access_text"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/dialog_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@mipmap/write_storage"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
BIN
app/src/main/res/mipmap-hdpi/write_storage.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/write_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
app/src/main/res/mipmap-mdpi/write_storage.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/write_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-xhdpi/write_storage.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/write_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/write_storage.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/write_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/write_storage.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/write_storage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Ordner verstecken</string>
|
<string name="hide_folder">Ordner verstecken</string>
|
||||||
<string name="unhide_folder">Ordner sichtbar machen</string>
|
<string name="unhide_folder">Ordner sichtbar machen</string>
|
||||||
<string name="hidden">(versteckt)</string>
|
<string name="hidden">(versteckt)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 Ordner gelöscht</item>
|
<item quantity="one">1 Ordner gelöscht</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 carpeta eliminada</item>
|
<item quantity="one">1 carpeta eliminada</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 cartella eliminata</item>
|
<item quantity="one">1 cartella eliminata</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 フォルダーを削除しました</item>
|
<item quantity="one">1 フォルダーを削除しました</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 pasta eliminada</item>
|
<item quantity="one">1 pasta eliminada</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 mapp borttagen</item>
|
<item quantity="one">1 mapp borttagen</item>
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
<string name="hide_folder">Hide folder</string>
|
<string name="hide_folder">Hide folder</string>
|
||||||
<string name="unhide_folder">Unhide folder</string>
|
<string name="unhide_folder">Unhide folder</string>
|
||||||
<string name="hidden">(hidden)</string>
|
<string name="hidden">(hidden)</string>
|
||||||
|
<string name="confirm_storage_access_title">Confirm external storage access</string>
|
||||||
|
<string name="confirm_storage_access_text">Please choose the root folder of the SD card to grant write access on the next screen</string>
|
||||||
|
|
||||||
<plurals name="folders_deleted">
|
<plurals name="folders_deleted">
|
||||||
<item quantity="one">1 folder deleted</item>
|
<item quantity="one">1 folder deleted</item>
|
||||||
|
|
Loading…
Reference in a new issue