splitting the CharSequence creation from the conversion to EpoxyCharSequence

This commit is contained in:
Adam Brown 2022-01-07 17:31:05 +00:00
parent 7c5e7a902d
commit bb2e3b1078
1 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,7 @@ class SplashCarouselStateFactory @Inject constructor(
private fun Int.colorTerminatingFullStop(@AttrRes color: Int): EpoxyCharSequence {
val string = stringProvider.getString(this)
val fullStop = "."
return (if (string.endsWith(fullStop)) {
val charSequence = if (string.endsWith(fullStop)) {
span {
+string.removeSuffix(fullStop)
span(fullStop) {
@ -70,6 +70,7 @@ class SplashCarouselStateFactory @Inject constructor(
}
} else {
string
}).toEpoxyCharSequence()
}
return charSequence.toEpoxyCharSequence()
}
}