From 8f4984f5e36ebd50ace0bccb4e6b00813a9c5081 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 8 Mar 2020 12:44:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/about/AboutActivity.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 8fc7d1294..d86cb39a1 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 @@ -1,13 +1,19 @@ package io.legado.app.ui.about import android.os.Bundle +import android.text.Spannable +import android.text.SpannableString +import android.text.style.ForegroundColorSpan import android.view.Menu import android.view.MenuItem import io.legado.app.R import io.legado.app.base.BaseActivity +import io.legado.app.lib.theme.accentColor import io.legado.app.utils.openUrl +import kotlinx.android.synthetic.main.activity_about.* import org.jetbrains.anko.share + class AboutActivity : BaseActivity(R.layout.activity_about) { override fun onActivityCreated(savedInstanceState: Bundle?) { @@ -17,6 +23,16 @@ class AboutActivity : BaseActivity(R.layout.activity_about) { supportFragmentManager.beginTransaction() .replace(R.id.fl_fragment, aboutFragment, fTag) .commit() + tv_app_summary.post { + val span = ForegroundColorSpan(accentColor) + val spannableString = SpannableString(tv_app_summary.text) + val start = spannableString.indexOf("开源阅读软件") + spannableString.setSpan( + span, start, start + 6, + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ) + tv_app_summary.text = spannableString + } } override fun onCompatCreateOptionsMenu(menu: Menu): Boolean {