From 6fe01e336c4236b79adfef22b5ae783e5abc83e6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 19 Feb 2020 11:21:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/widget/font/FontSelectDialog.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) {