From cd96ddef8a4610d6818818ed1ec2c5320586b71e Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 1 Feb 2021 16:22:50 +0800 Subject: [PATCH] edit FontAdapter.kt --- .../main/java/io/legado/app/ui/widget/font/FontAdapter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt b/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt index 9f8bb77ca..8ff31f9f5 100644 --- a/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt @@ -14,6 +14,7 @@ import io.legado.app.utils.visible import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.toast import java.io.File +import java.net.URLDecoder class FontAdapter(context: Context, val callBack: CallBack) : RecyclerAdapter(context) { @@ -50,7 +51,9 @@ class FontAdapter(context: Context, val callBack: CallBack) : } tvFont.text = item.name root.onClick { callBack.onClick(item) } - if (item.name == callBack.curFilePath.substringAfterLast(File.separator)) { + if (item.name == URLDecoder.decode(callBack.curFilePath, "utf-8") + .substringAfterLast(File.separator) + ) { ivChecked.visible() } else { ivChecked.invisible()