Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
d95a21a3
Commit
d95a21a3
authored
Jan 30, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Plain Diff
gMerge branch 'develop' into feature/photo_scroller
parents
73741584
88c6ccf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
textAdapter.kt
.../roompark/presentation/screen/article/util/textAdapter.kt
+8
-2
htlm_text_viewholder.xml
app/src/main/res/layout/htlm_text_viewholder.xml
+1
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/util/textAdapter.kt
View file @
d95a21a3
package
com.biganto.visual.roompark.presentation.screen.article.util
import
android.text.Html
import
android.text.method.LinkMovementMethod
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -77,9 +79,13 @@ abstract class HtmlTagViewHolder<M:HtmlTag>(itemView: View) : RecyclerView.ViewH
class
HtmlTextViewHolder
(
itemView
:
View
)
:
HtmlTagViewHolder
<
HtmlTag
.
Text
>(
itemView
)
{
override
fun
onViewBound
(
model
:
HtmlTag
.
Text
)
{
(
itemView
as
MaterialTextView
).
text
=
model
.
text
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
N
)
{
(
itemView
as
MaterialTextView
).
text
=
Html
.
fromHtml
(
model
.
text
,
Html
.
FROM_HTML_MODE_COMPACT
)
}
else
{
(
itemView
as
MaterialTextView
).
text
=
Html
.
fromHtml
(
model
.
text
)
}
itemView
.
movementMethod
=
LinkMovementMethod
.
getInstance
()
}
}
class
HtmlImageViewHolder
(
itemView
:
View
)
:
HtmlTagViewHolder
<
HtmlTag
.
ImageSource
>(
itemView
)
{
...
...
app/src/main/res/layout/htlm_text_viewholder.xml
View file @
d95a21a3
...
...
@@ -5,4 +5,5 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:linksClickable=
"true"
android:minHeight=
"16dp"
/>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment