We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 915ad30 commit 89dee9eCopy full SHA for 89dee9e
1 file changed
omegatypes/src/main/java/com/omega_r/libs/omegatypes/Text.kt
@@ -78,6 +78,10 @@ open class Text(protected val defaultTextStyle: TextStyle?) : Serializable {
78
return TextBuilder.BuilderText(this) + string
79
}
80
81
+ operator fun plus(textStyle: TextStyle?): Text {
82
+ return textStyle?.let { from(this, textStyle = textStyle) } ?: this
83
+ }
84
+
85
override fun equals(other: Any?): Boolean {
86
if (this === other) return true
87
if (javaClass != other?.javaClass) return false
@@ -323,4 +327,6 @@ operator fun Text?.plus(text: Text?): Text? {
323
327
324
328
325
329
326
-operator fun Text.plus(textStyle: TextStyle) = Text.from(this, textStyle = textStyle)
330
+operator fun Text?.plus(textStyle: TextStyle?): Text? {
331
+ return this?.let { this + textStyle }
332
+}
0 commit comments