Improving rendering of the text
This commit is contained in:
@@ -178,13 +178,17 @@ private fun RenderWord(
|
|||||||
nav: (String) -> Unit,
|
nav: (String) -> Unit,
|
||||||
tags: List<List<String>>?
|
tags: List<List<String>>?
|
||||||
) {
|
) {
|
||||||
|
val wordSpace = remember {
|
||||||
|
"$word "
|
||||||
|
}
|
||||||
|
|
||||||
if (canPreview) {
|
if (canPreview) {
|
||||||
// Explicit URL
|
// Explicit URL
|
||||||
val img = state.imagesForPager[word]
|
val img = state.imagesForPager[word]
|
||||||
if (img != null) {
|
if (img != null) {
|
||||||
ZoomableContentView(img, state.imageList)
|
ZoomableContentView(img, state.imageList)
|
||||||
} else if (state.urlSet.contains(word)) {
|
} else if (state.urlSet.contains(word)) {
|
||||||
UrlPreview(word, "$word ")
|
UrlPreview(word, wordSpace)
|
||||||
} else if (state.customEmoji.any { word.contains(it.key) }) {
|
} else if (state.customEmoji.any { word.contains(it.key) }) {
|
||||||
RenderCustomEmoji(word, state.customEmoji)
|
RenderCustomEmoji(word, state.customEmoji)
|
||||||
} else if (word.startsWith("lnbc", true)) {
|
} else if (word.startsWith("lnbc", true)) {
|
||||||
@@ -217,7 +221,7 @@ private fun RenderWord(
|
|||||||
HashTag(word, nav)
|
HashTag(word, nav)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -232,26 +236,26 @@ private fun RenderWord(
|
|||||||
Text("$additionalChars ")
|
Text("$additionalChars ")
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (state.urlSet.contains(word)) {
|
if (state.urlSet.contains(word)) {
|
||||||
ClickableUrl("$word ", word)
|
ClickableUrl(wordSpace, word)
|
||||||
} else if (word.startsWith("lnurl", true)) {
|
} else if (word.startsWith("lnurl", true)) {
|
||||||
val lnWithdrawal = LnWithdrawalUtil.findWithdrawal(word)
|
val lnWithdrawal = LnWithdrawalUtil.findWithdrawal(word)
|
||||||
if (lnWithdrawal != null) {
|
if (lnWithdrawal != null) {
|
||||||
ClickableWithdrawal(withdrawalString = lnWithdrawal)
|
ClickableWithdrawal(withdrawalString = lnWithdrawal)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -283,7 +287,7 @@ private fun RenderWord(
|
|||||||
HashTag(word, nav)
|
HashTag(word, nav)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -298,13 +302,13 @@ private fun RenderWord(
|
|||||||
Text("$additionalChars ")
|
Text("$additionalChars ")
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
text = "$word ",
|
text = wordSpace,
|
||||||
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
style = LocalTextStyle.current.copy(textDirection = TextDirection.Content)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user