Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查询结果不解析复杂标签 #52

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package me.ykrank.s1next.data.api.model.search

import android.text.Spanned
import com.github.ykrank.androidtools.ui.adapter.StableIdModel
import me.ykrank.s1next.widget.span.HtmlCompat

/**
* Created by ykrank on 2016/10/18.
Expand All @@ -9,6 +11,12 @@ import com.github.ykrank.androidtools.ui.adapter.StableIdModel
class ForumSearchResult : StableIdModel, SearchResult() {

var content: String? = null
private var _htmlContent: Spanned? = null
ykrank marked this conversation as resolved.
Show resolved Hide resolved
val htmlContent: Spanned?
get() = if (_htmlContent != null || content == null)
_htmlContent
else
HtmlCompat.fromHtml(content, HtmlCompat.FROM_HTML_MODE_COMPACT_EXCLUDE_BLOCKQUOTE)

override fun equals(o: Any?): Boolean {
if (this === o) return true
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_search_forum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
android:lineSpacingExtra="@dimen/text_line_spacing_extra"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textIsSelectable="true"
app:imgHtml="@{model.content}"
android:text="@{model.htmlContent}"
app:movementMethod="@{SearchMovementMethod.instance}"
tools:text="ABC\nkhk"/>

Expand Down