|
|
@ -316,10 +316,8 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { |
|
|
|
val config: ReadBookConfig.Config = GSON.fromJsonObject(configFile.readText())!! |
|
|
|
val config: ReadBookConfig.Config = GSON.fromJsonObject(configFile.readText())!! |
|
|
|
if (config.textFont.isNotEmpty()) { |
|
|
|
if (config.textFont.isNotEmpty()) { |
|
|
|
val fontName = FileUtils.getName(config.textFont) |
|
|
|
val fontName = FileUtils.getName(config.textFont) |
|
|
|
val file = FileUtils.createFileIfNotExist( |
|
|
|
val file = File( |
|
|
|
requireContext().externalFilesDir, |
|
|
|
FileUtils.getPath(requireContext().externalFilesDir, "font", fontName) |
|
|
|
"font", |
|
|
|
|
|
|
|
fontName |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
FileUtils.getFile(configDir, fontName).copyTo(file) |
|
|
|
FileUtils.getFile(configDir, fontName).copyTo(file) |
|
|
|
config.textFont = file.absolutePath |
|
|
|
config.textFont = file.absolutePath |
|
|
|