Commit 9599b62a authored by Mygod's avatar Mygod

Refine

parent c39fa67b
...@@ -40,10 +40,10 @@ class AboutFragment : ToolbarFragment() { ...@@ -40,10 +40,10 @@ class AboutFragment : ToolbarFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
toolbar.title = getString(R.string.about_title, BuildConfig.VERSION_NAME) toolbar.title = getString(R.string.about_title, BuildConfig.VERSION_NAME)
val builder = SpannableStringBuilder(HtmlCompat.fromHtml( view.findViewById<TextView>(R.id.tv_about).apply {
text = SpannableStringBuilder(HtmlCompat.fromHtml(
resources.openRawResource(R.raw.about).bufferedReader().readText(), resources.openRawResource(R.raw.about).bufferedReader().readText(),
HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM)) HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM)).apply {
builder.apply {
for (span in getSpans(0, length, URLSpan::class.java)) { for (span in getSpans(0, length, URLSpan::class.java)) {
setSpan(object : ClickableSpan() { setSpan(object : ClickableSpan() {
override fun onClick(view: View) { override fun onClick(view: View) {
...@@ -58,8 +58,6 @@ class AboutFragment : ToolbarFragment() { ...@@ -58,8 +58,6 @@ class AboutFragment : ToolbarFragment() {
removeSpan(span) removeSpan(span)
} }
} }
view.findViewById<TextView>(R.id.tv_about).apply {
text = builder
movementMethod = LinkMovementMethod.getInstance() movementMethod = LinkMovementMethod.getInstance()
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment