使用系统文件夹选择器出错时自动打开应用文件夹选择器,部分系统文件夹选择器被阉割了

This commit is contained in:
gedoor 2021-11-13 19:26:17 +08:00
parent a9881308db
commit b693cb79d3
8 changed files with 18 additions and 1 deletions

View File

@ -79,7 +79,17 @@ class HandleFileActivity :
alert(title) {
items(selectList) { _, item, _ ->
when (item.value) {
HandleFileContract.DIR -> selectDocTree.launch(null)
HandleFileContract.DIR -> kotlin.runCatching {
selectDocTree.launch(null)
}.onFailure {
toastOnUi(R.string.open_sys_dir_picker_error)
checkPermissions {
FilePickerDialog.show(
supportFragmentManager,
mode = HandleFileContract.DIR
)
}
}
HandleFileContract.FILE -> selectDoc.launch(typesOfExtensions(allowExtensions))
10 -> checkPermissions {
FilePickerDialog.show(

View File

@ -904,5 +904,6 @@
<string name="font_scale_summary">当前字体大小:%.1f</string>
<string name="tts_speech_reduce">语速减</string>
<string name="tts_speech_add">语速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -908,5 +908,6 @@
<string name="font_scale_summary">当前字体大小:%.1f</string>
<string name="tts_speech_reduce">语速减</string>
<string name="tts_speech_add">语速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -908,5 +908,6 @@
<string name="font_scale_summary">当前字体大小:%.1f</string>
<string name="tts_speech_reduce">语速减</string>
<string name="tts_speech_add">语速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -905,5 +905,6 @@
<string name="font_scale_summary">當前字亂大小:%.1f</string>
<string name="tts_speech_reduce">語速减</string>
<string name="tts_speech_add">語速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -907,5 +907,6 @@
<string name="font_scale_summary">當前字體大小:%.1f</string>
<string name="tts_speech_reduce">語速减</string>
<string name="tts_speech_add">語速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -907,5 +907,6 @@
<string name="font_scale_summary">当前字体大小:%.1f</string>
<string name="tts_speech_reduce">语速减</string>
<string name="tts_speech_add">语速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>

View File

@ -908,5 +908,6 @@
<string name="font_scale_summary">font scale:%.1f</string>
<string name="tts_speech_reduce">语速减</string>
<string name="tts_speech_add">语速加</string>
<string name="open_sys_dir_picker_error">打开系统文件夹选择器出错,自动打开应用文件夹选择器</string>
</resources>