pull/1652/head
kunfei 3 years ago
parent b756f407b2
commit 20efb228f7
  1. 5
      app/src/main/java/io/legado/app/ui/font/FontAdapter.kt

@ -15,8 +15,9 @@ import java.net.URLDecoder
class FontAdapter(context: Context, curFilePath: String, val callBack: CallBack) : class FontAdapter(context: Context, curFilePath: String, val callBack: CallBack) :
RecyclerAdapter<FileDoc, ItemFontBinding>(context) { RecyclerAdapter<FileDoc, ItemFontBinding>(context) {
private val curName = URLDecoder.decode(curFilePath, "utf-8") private val curName = kotlin.runCatching {
.substringAfterLast(File.separator) URLDecoder.decode(curFilePath, "utf-8")
}.getOrNull()?.substringAfterLast(File.separator)
override fun getViewBinding(parent: ViewGroup): ItemFontBinding { override fun getViewBinding(parent: ViewGroup): ItemFontBinding {
return ItemFontBinding.inflate(inflater, parent, false) return ItemFontBinding.inflate(inflater, parent, false)

Loading…
Cancel
Save