feat: 优化代码

pull/105/head
kunfei 5 years ago
parent 260cd64d77
commit 6fe01e336c
  1. 10
      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 import java.io.File
class FontSelectDialog : BaseDialogFragment(), class FontSelectDialog : BaseDialogFragment(),
FileChooserDialog.CallBack,
Toolbar.OnMenuItemClickListener, Toolbar.OnMenuItemClickListener,
FontAdapter.CallBack { FontAdapter.CallBack {
private val fontFolderRequestCode = 35485 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?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
when (requestCode) { when (requestCode) {

Loading…
Cancel
Save