@@ -27,16 +27,13 @@ import androidx.compose.ui.text.style.TextDecoration
27
27
import androidx.compose.ui.unit.TextUnit
28
28
import androidx.compose.ui.viewinterop.AndroidView
29
29
import androidx.core.content.res.ResourcesCompat
30
- import com.troplo.privateuploader.TpuApp
31
30
import io.noties.markwon.AbstractMarkwonPlugin
32
31
import io.noties.markwon.Markwon
33
32
import io.noties.markwon.MarkwonConfiguration
34
33
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin
35
34
import io.noties.markwon.ext.tables.TablePlugin
36
35
import io.noties.markwon.html.HtmlPlugin
37
36
import io.noties.markwon.linkify.LinkifyPlugin
38
- import io.wax911.emojify.parser.parseToHtmlDecimal
39
- import io.wax911.emojify.parser.parseToUnicode
40
37
41
38
42
39
@Composable
@@ -53,7 +50,7 @@ fun MarkdownText(
53
50
onClick : (() -> Unit )? = null,
54
51
// this option will disable all clicks on links, inside the markdown text
55
52
// it also enable the parent view to receive the click event
56
- onLinkClicked : ((String ) -> Unit )? = null,
53
+ onLinkClicked : (() -> Unit )? = null,
57
54
onTextLayout : ((numLines: Int ) -> Unit )? = null,
58
55
onLongClick : (() -> Unit )? = null,
59
56
) {
@@ -75,8 +72,7 @@ fun MarkdownText(
75
72
maxLines = maxLines,
76
73
style = style,
77
74
textAlign = textAlign,
78
- viewId = viewId,
79
- onClick = onClick
75
+ viewId = viewId
80
76
)
81
77
},
82
78
update = { textView ->
@@ -88,8 +84,11 @@ fun MarkdownText(
88
84
}
89
85
textView.maxLines = maxLines
90
86
textView.setOnLongClickListener {
87
+ Log .d(" MarkdownText" , " onLongClick" )
91
88
preventLinkClick.value = true
92
- onLongClick?.invoke()
89
+ if (onLongClick != null ) {
90
+ onLongClick()
91
+ }
93
92
true
94
93
}
95
94
}
@@ -147,7 +146,7 @@ private fun createTextView(
147
146
148
147
private fun createMarkdownRender (
149
148
context : Context ,
150
- onLinkClicked : ((String ) -> Unit )? = null,
149
+ onLinkClicked : (() -> Unit )? = null,
151
150
preventLinkClick : MutableState <Boolean >,
152
151
): Markwon {
153
152
return Markwon .builder(context)
0 commit comments