Skip to content

Commit 7b559bd

Browse files
Anna Powolnyfacebook-github-bot
authored andcommitted
Add clickable Span listener to kotlin wrapper
Summary: found another missing bit... {gif:hdh1m9rl} When you think you've finally finished adding props, but then you realize you have to add another one Reviewed By: pentiumao Differential Revision: D73853730 fbshipit-source-id: 62bf8620f629c222f614027ad52c6700dea4a336
1 parent 67f549d commit 7b559bd

File tree

1 file changed

+4
-1
lines changed
  • litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget

1 file changed

+4
-1
lines changed

litho-widget-kotlin/src/main/kotlin/com/facebook/litho/kotlin/widget/Text.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import com.facebook.litho.Handle
3030
import com.facebook.litho.ResourcesScope
3131
import com.facebook.litho.Style
3232
import com.facebook.litho.kotlinStyle
33+
import com.facebook.litho.widget.ClickableSpanListener
3334
import com.facebook.litho.widget.Text
3435
import com.facebook.litho.widget.TextAlignment
3536
import com.facebook.litho.widget.TouchableSpanListener
@@ -80,7 +81,8 @@ inline fun ResourcesScope.Text(
8081
minimallyWide: Boolean = false,
8182
@ColorInt outlineColor: Int? = null,
8283
outlineWidth: Dimen = 0.dp,
83-
touchableSpanListener: TouchableSpanListener? = null
84+
touchableSpanListener: TouchableSpanListener? = null,
85+
spanListener: ClickableSpanListener? = null
8486
): Text {
8587
val builder =
8688
Text.create(context, defStyleAttr, defStyleRes)
@@ -104,6 +106,7 @@ inline fun ResourcesScope.Text(
104106
.minLines(minLines)
105107
.maxLines(maxLines)
106108
.touchableSpanListener(touchableSpanListener)
109+
.spanListener(spanListener)
107110
.apply { lineHeight?.let { lineHeightPx(it.toPixels().toFloat()) } }
108111
.apply { extraSpacing?.let { extraSpacingPx(it.toPixels().toFloat()) } }
109112
.letterSpacing(letterSpacing)

0 commit comments

Comments
 (0)