diff --git a/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt
index 7b6aa0f..b666227 100644
--- a/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt
+++ b/app/src/main/java/sushi/hardcore/droidfs/explorers/BaseExplorerActivity.kt
@@ -149,6 +149,26 @@ open class BaseExplorerActivity : BaseActivity() {
ExternalProvider.open(this, gocryptfsVolume, fullPath)
}
+ private fun showOpenAsDialog(path: String) {
+ val adapter = OpenAsDialogAdapter(this, usf_open)
+ ColoredAlertDialogBuilder(this)
+ .setSingleChoiceItems(adapter, -1) { dialog, which ->
+ when (adapter.getItem(which)) {
+ "image" -> startFileViewer(ImageViewer::class.java, path)
+ "video" -> startFileViewer(VideoPlayer::class.java, path)
+ "audio" -> startFileViewer(AudioPlayer::class.java, path)
+ "text" -> startFileViewer(TextEditor::class.java, path)
+ "external" -> if (usf_open) {
+ openWithExternalApp(path)
+ }
+ }
+ dialog.dismiss()
+ }
+ .setTitle(getString(R.string.open_as) + ':')
+ .setNegativeButton(R.string.cancel, null)
+ .show()
+ }
+
protected open fun onExplorerItemClick(position: Int) {
val wasSelecting = explorerAdapter.selectedItems.isNotEmpty()
explorerAdapter.onItemClick(position)
@@ -174,25 +194,7 @@ open class BaseExplorerActivity : BaseActivity() {
isAudio(fullPath) -> {
startFileViewer(AudioPlayer::class.java, fullPath)
}
- else -> {
- val adapter = OpenAsDialogAdapter(this, usf_open)
- ColoredAlertDialogBuilder(this)
- .setSingleChoiceItems(adapter, -1){ dialog, which ->
- when (adapter.getItem(which)){
- "image" -> startFileViewer(ImageViewer::class.java, fullPath)
- "video" -> startFileViewer(VideoPlayer::class.java, fullPath)
- "audio" -> startFileViewer(AudioPlayer::class.java, fullPath)
- "text" -> startFileViewer(TextEditor::class.java, fullPath)
- "external" -> if (usf_open){
- openWithExternalApp(fullPath)
- }
- }
- dialog.dismiss()
- }
- .setTitle(getString(R.string.open_as))
- .setNegativeButton(R.string.cancel, null)
- .show()
- }
+ else -> showOpenAsDialog(fullPath)
}
}
}
@@ -458,6 +460,7 @@ open class BaseExplorerActivity : BaseActivity() {
protected fun handleMenuItems(menu: Menu){
menu.findItem(R.id.rename).isVisible = false
+ menu.findItem(R.id.open_as)?.isVisible = false
if (usf_open){
menu.findItem(R.id.external_open)?.isVisible = false
}
@@ -470,8 +473,11 @@ open class BaseExplorerActivity : BaseActivity() {
toolbar.setNavigationIcon(R.drawable.icon_arrow_back)
if (explorerAdapter.selectedItems.size == 1) {
menu.findItem(R.id.rename).isVisible = true
- if (usf_open && explorerElements[explorerAdapter.selectedItems[0]].isRegularFile) {
- menu.findItem(R.id.external_open)?.isVisible = true
+ if (explorerElements[explorerAdapter.selectedItems[0]].isRegularFile) {
+ menu.findItem(R.id.open_as)?.isVisible = true
+ if (usf_open) {
+ menu.findItem(R.id.external_open)?.isVisible = true
+ }
}
}
}
@@ -520,6 +526,10 @@ open class BaseExplorerActivity : BaseActivity() {
dialog.show()
true
}
+ R.id.open_as -> {
+ showOpenAsDialog(PathUtils.pathJoin(currentDirectoryPath, explorerElements[explorerAdapter.selectedItems[0]].name))
+ true
+ }
R.id.external_open -> {
if (usf_open){
openWithExternalApp(PathUtils.pathJoin(currentDirectoryPath, explorerElements[explorerAdapter.selectedItems[0]].name))
diff --git a/app/src/main/res/menu/explorer.xml b/app/src/main/res/menu/explorer.xml
index 9370b7f..81f0937 100644
--- a/app/src/main/res/menu/explorer.xml
+++ b/app/src/main/res/menu/explorer.xml
@@ -48,6 +48,12 @@
android:visible="false"
android:title="@string/external_open"/>
+
+
-
-
-
+
+
+
+
- Definir uma cor personalizada do tema
DroidFS tenta ser o mais seguro possível. No entanto, a segurança muitas vezes resulta em falta de conforto. Por isso o DroidFS oferece opções adicionais que você pode alternar de acordo com as suas necessidades.\n\nAviso: estas opções podem ser PERIGOSAS. Não as utilize a menos que você saiba o que está fazendo. É altamente recomendável ler a documentação antes de ativá-las.
Ver opções perigosas
- Abrir como:
+ Abrir como
Imagem
Vídeo
Áudio
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 7da1103..f9e907c 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -110,7 +110,7 @@
Установить собственный цвет темы
DroidFS старается быть максимально безопасным, однако безопасность часто связана с появлением неудобств. Поэтому DroidFS предлагает дополнительные небезопасные функции, которые вы можете включить/отключить в соответствии со своими потребностями.\n\nПредупреждение: эти функции могут быть НЕБЕЗОПАСНЫМИ. Не используйте их, если не уверены в своих действиях. Настоятельно рекомендуется прочитать документацию перед их включением.
Посмотреть небезопасные функции
- Открыть как:
+ Открыть как
Изображение
Видео
Аудио
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e08d7fa..36873d1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -113,7 +113,7 @@
Set a custom theme color
DroidFS try to be as secure as possible. However, security often involves lack of comfort. This is why DroidFS offer you additional unsafe features that you can enable/disable according to your needs.\n\nWarning: this features can be UNSAFE. Do not use them unless you know exactly what you are doing. It is highly recommended to read the documentation before enabling them.
See unsafe features
- Open as:
+ Open as
Image
Video
Audio