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 25690886c..c0c0685d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -67,6 +67,16 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList { + pinFolder() + mode.finish() + true + } + R.id.cab_unpin -> { + unpinFolder() + mode.finish() + true + } R.id.cab_hide -> { hideDirs() mode.finish() @@ -163,6 +173,14 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList() val positions = multiSelector.selectedPositions 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 df84fe545..21ec1083b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -39,6 +39,10 @@ class Config private constructor(context: Context) { get() = mPrefs.getBoolean(SHOW_HIDDEN_FOLDERS, false) set(showHiddenFolders) = mPrefs.edit().putBoolean(SHOW_HIDDEN_FOLDERS, showHiddenFolders).apply() + var pinnedFolders: Set + get() = mPrefs.getStringSet(PINNED_FOLDERS, HashSet()) + set(pinnedFolders) = mPrefs.edit().putStringSet(PINNED_FOLDERS, pinnedFolders).apply() + fun addHiddenDirectory(path: String) { val currHiddenFolders = HashSet(hiddenFolders) currHiddenFolders.add(path) 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 d1a5fb32b..0aedfe75e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -12,6 +12,7 @@ val SHOW_HIDDEN_FOLDERS = "show_hidden_folders" val AUTOPLAY_VIDEOS = "autoplay_videos" val TREE_URI = "tree_uri" val DISPLAY_FILE_NAMES = "display_file_names" +val PINNED_FOLDERS = "pinned_folders" // sorting val SORT_BY_NAME = 1 diff --git a/app/src/main/res/layout/directory_item.xml b/app/src/main/res/layout/directory_item.xml index d8f9f1bd8..d371745f3 100644 --- a/app/src/main/res/layout/directory_item.xml +++ b/app/src/main/res/layout/directory_item.xml @@ -8,6 +8,16 @@ + + + + (versteckt) Save as File saved successfully + Pin folder + Unpin folder Kopieren Verschieben Kopieren/Verschieben diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 0d5ea5ecf..8534517a3 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -40,6 +40,8 @@ (hidden) Salvar como Archivo guardado con éxito + Pin folder + Unpin folder Copy Move Copy/Move diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index f3727e408..3f8299692 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -40,6 +40,8 @@ (nascosta) Salva come File salvato correttamente + Pin folder + Unpin folder Copia Sposta Copia/Sposta diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index bbc0b823d..27a70bd9c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -40,6 +40,8 @@ (非表示) 名前を付けて保存 ファイルを正常に保存しました + Pin folder + Unpin folder コピー 移動 コピー/移動 diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 6b34a2dd4..05e80bb20 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -40,6 +40,8 @@ (oculta) Guardar como Ficheiro guardado com sucesso + Pin folder + Unpin folder Copiar Mover Copiar/mover para diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index c8681db93..12d1a176e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -41,6 +41,8 @@ (Скрытый) Сохранить как Файл успешно сохранен + Pin folder + Unpin folder Копировать Переместить Копировать / Переместить diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 60e0dc0b8..4145ac3b4 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -40,6 +40,8 @@ (hidden) Save as File saved successfully + Pin folder + Unpin folder Kopiera Flytta Copy/Move diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index eea6e7722..4f23bc132 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -1,6 +1,7 @@ 150dp 120dp + 30dp 60dp 240dp 16dp diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 95ec4d3ab..0f25a5790 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -41,6 +41,8 @@ (隐藏) 保存 文件保存成功 + Pin folder + Unpin folder 复制 移动 复制/移动 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 88a5aff64..52566ba0d 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -5,6 +5,7 @@ 8dp 150dp 100dp + 20dp 40dp 160dp 8dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 70898e37e..d76f37c20 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -40,6 +40,8 @@ (hidden) Save as File saved successfully + Pin folder + Unpin folder Copy Move Copy/Move