From d161a3400b311e7d79e32dfbe4c607e40686b1e0 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 16 Jun 2020 21:36:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/about/AboutActivity.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt b/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt index 1ce1202de..ca71714f1 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutActivity.kt +++ b/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) .commit() tv_app_summary.post { - val span = ForegroundColorSpan(accentColor) - val spannableString = SpannableString(tv_app_summary.text) - val gzh = getString(R.string.legado_gzh) - val start = spannableString.indexOf(gzh) - spannableString.setSpan( - span, start, start + gzh.length, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ) - tv_app_summary.text = spannableString + try { + val span = ForegroundColorSpan(accentColor) + val spannableString = SpannableString(tv_app_summary.text) + val gzh = getString(R.string.legado_gzh) + val start = spannableString.indexOf(gzh) + spannableString.setSpan( + span, start, start + gzh.length, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ) + tv_app_summary.text = spannableString + } catch (e: Exception) { + e.printStackTrace() + } } }