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