feat: 修复bug

pull/248/head
gedoor 5 years ago
parent 67f76f8a93
commit d161a3400b
  1. 22
      app/src/main/java/io/legado/app/ui/about/AboutActivity.kt

@ -24,15 +24,19 @@ class AboutActivity : BaseActivity(R.layout.activity_about) {
.replace(R.id.fl_fragment, aboutFragment, fTag) .replace(R.id.fl_fragment, aboutFragment, fTag)
.commit() .commit()
tv_app_summary.post { tv_app_summary.post {
val span = ForegroundColorSpan(accentColor) try {
val spannableString = SpannableString(tv_app_summary.text) val span = ForegroundColorSpan(accentColor)
val gzh = getString(R.string.legado_gzh) val spannableString = SpannableString(tv_app_summary.text)
val start = spannableString.indexOf(gzh) val gzh = getString(R.string.legado_gzh)
spannableString.setSpan( val start = spannableString.indexOf(gzh)
span, start, start + gzh.length, spannableString.setSpan(
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE span, start, start + gzh.length,
) Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
tv_app_summary.text = spannableString )
tv_app_summary.text = spannableString
} catch (e: Exception) {
e.printStackTrace()
}
} }
} }

Loading…
Cancel
Save