diff --git a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt index 5ad68b611..e3162860c 100644 --- a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt @@ -31,6 +31,7 @@ import org.jetbrains.anko.toast import java.io.File class FontSelectDialog : BaseDialogFragment(), + FileChooserDialog.CallBack, Toolbar.OnMenuItemClickListener, FontAdapter.CallBack { private val fontFolderRequestCode = 35485 @@ -218,6 +219,15 @@ class FontSelectDialog : BaseDialogFragment(), ?: "" } + override fun onFilePicked(requestCode: Int, currentPath: String) { + when (requestCode) { + fontFolderRequestCode -> { + putPrefString(PreferKey.fontFolder, currentPath) + getFontFilesByPermission(currentPath) + } + } + } + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) when (requestCode) {