Replace String.capitalize with replaceFirstChar
This commit is contained in:
@@ -226,7 +226,10 @@ fun LongCommunityHeader(
|
||||
) {
|
||||
it.first.role?.let { it1 ->
|
||||
Text(
|
||||
text = it1.capitalize(Locale.ROOT),
|
||||
text =
|
||||
it1.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.width(75.dp),
|
||||
|
||||
@@ -262,7 +262,10 @@ fun RenderLiveActivityEventInner(
|
||||
Spacer(StdHorzSpacer)
|
||||
it.first.role?.let {
|
||||
Text(
|
||||
text = it.capitalize(Locale.ROOT),
|
||||
text =
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
color = MaterialTheme.colorScheme.placeholderText,
|
||||
maxLines = 1,
|
||||
)
|
||||
|
||||
@@ -258,7 +258,9 @@ fun RenderEyeGlassesPrescription(
|
||||
}
|
||||
visionPrescription.status?.let {
|
||||
Text(
|
||||
text = "Status: ${it.capitalize(Locale.getDefault())}",
|
||||
text = "Status: ${it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
}}",
|
||||
modifier = Modifier.padding(4.dp).fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
@@ -359,7 +361,10 @@ fun RenderEyeGlassesPrescriptionRow(data: LensSpecification) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
text = data.eye?.capitalize(Locale.getDefault()) ?: "Unknown",
|
||||
text =
|
||||
data.eye?.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
} ?: "Unknown",
|
||||
modifier = Modifier.padding(4.dp).weight(1f),
|
||||
)
|
||||
VerticalDivider(thickness = DividerThickness)
|
||||
@@ -515,7 +520,10 @@ fun RenderEyeContactsPrescriptionRow(data: LensSpecification) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
text = data.eye?.capitalize(Locale.getDefault()) ?: "Unknown",
|
||||
text =
|
||||
data.eye?.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
} ?: "Unknown",
|
||||
modifier = Modifier.padding(4.dp).weight(1f),
|
||||
)
|
||||
VerticalDivider(thickness = DividerThickness)
|
||||
|
||||
+4
-1
@@ -181,7 +181,10 @@ fun LongLiveActivityChannelHeader(
|
||||
) {
|
||||
it.first.role?.let { it1 ->
|
||||
Text(
|
||||
text = it1.capitalize(Locale.ROOT),
|
||||
text =
|
||||
it1.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.width(55.dp),
|
||||
|
||||
+12
-4
@@ -114,7 +114,9 @@ class DiscoveryFilterAssembler(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.capitalize(Locale.getDefault()),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten(),
|
||||
),
|
||||
@@ -277,7 +279,9 @@ class DiscoveryFilterAssembler(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.capitalize(Locale.getDefault()),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten(),
|
||||
),
|
||||
@@ -338,7 +342,9 @@ class DiscoveryFilterAssembler(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.capitalize(Locale.getDefault()),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten(),
|
||||
),
|
||||
@@ -400,7 +406,9 @@ class DiscoveryFilterAssembler(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.capitalize(Locale.getDefault()),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten(),
|
||||
),
|
||||
|
||||
+3
-1
@@ -80,7 +80,9 @@ class HashtagFilterAssembler(
|
||||
it.hashtag,
|
||||
it.hashtag.lowercase(),
|
||||
it.hashtag.uppercase(),
|
||||
it.hashtag.capitalize(Locale.getDefault()),
|
||||
it.hashtag.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten()
|
||||
|
||||
|
||||
+3
-1
@@ -177,7 +177,9 @@ class HomeFilterAssembler(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.capitalize(Locale.getDefault()),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten(),
|
||||
),
|
||||
|
||||
+10
-2
@@ -103,8 +103,16 @@ class VideoFilterAssembler(
|
||||
|
||||
val hashtags =
|
||||
hashToLoad
|
||||
.map { listOf(it, it.lowercase(), it.uppercase(), it.capitalize(Locale.getDefault())) }
|
||||
.flatten()
|
||||
.map {
|
||||
listOf(
|
||||
it,
|
||||
it.lowercase(),
|
||||
it.uppercase(),
|
||||
it.replaceFirstChar {
|
||||
if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString()
|
||||
},
|
||||
)
|
||||
}.flatten()
|
||||
|
||||
return listOf(
|
||||
TypedFilter(
|
||||
|
||||
Reference in New Issue
Block a user