Skip to content

Commit 915ad30

Browse files
committed
Changed operator plus
1 parent 08543a5 commit 915ad30

File tree

1 file changed

+8
-0
lines changed
  • omegatypes/src/main/java/com/omega_r/libs/omegatypes

1 file changed

+8
-0
lines changed

omegatypes/src/main/java/com/omega_r/libs/omegatypes/Text.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,4 +315,12 @@ fun String.toText(textStyle: TextStyle? = null) = Text.from(this, textStyle)
315315

316316
fun CharSequence.toText(textStyle: TextStyle? = null) = Text.from(this, textStyle)
317317

318+
operator fun Text?.plus(text: Text?): Text? {
319+
return when {
320+
this == null -> text
321+
text == null -> this
322+
else -> this + text
323+
}
324+
}
325+
318326
operator fun Text.plus(textStyle: TextStyle) = Text.from(this, textStyle = textStyle)

0 commit comments

Comments
 (0)