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
88c6ccf6
Commit
88c6ccf6
authored
Jan 30, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix <a href ..> tag
parent
0aca8f0a
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 @
88c6ccf6
package
com.biganto.visual.roompark.presentation.screen.article.util
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.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
...
@@ -77,9 +79,13 @@ abstract class HtmlTagViewHolder<M:HtmlTag>(itemView: View) : RecyclerView.ViewH
...
@@ -77,9 +79,13 @@ abstract class HtmlTagViewHolder<M:HtmlTag>(itemView: View) : RecyclerView.ViewH
class
HtmlTextViewHolder
(
itemView
:
View
)
:
HtmlTagViewHolder
<
HtmlTag
.
Text
>(
itemView
)
{
class
HtmlTextViewHolder
(
itemView
:
View
)
:
HtmlTagViewHolder
<
HtmlTag
.
Text
>(
itemView
)
{
override
fun
onViewBound
(
model
:
HtmlTag
.
Text
)
{
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
)
{
class
HtmlImageViewHolder
(
itemView
:
View
)
:
HtmlTagViewHolder
<
HtmlTag
.
ImageSource
>(
itemView
)
{
...
...
app/src/main/res/layout/htlm_text_viewholder.xml
View file @
88c6ccf6
...
@@ -5,4 +5,5 @@
...
@@ -5,4 +5,5 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:linksClickable=
"true"
android:minHeight=
"16dp"
/>
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