removed hardcoded strings

pull/508/head
magicalmeghan 2 years ago
parent 66046a86b0
commit 5137cd7777

@ -236,6 +236,8 @@ fun NewsResourceTopics(
// Store the ID of the Topic which has its "following" menu expanded, if any.
// To avoid UI confusion, only one topic can have an expanded menu at a time.
var expandedTopicId by remember { mutableStateOf<String?>(null) }
val isFollowed = stringResource(R.string.topic_is_followed)
val isNotFollowed = stringResource(R.string.topic_is_not_followed)
Row(
modifier = modifier.horizontalScroll(rememberScrollState()), // causes narrow chips
@ -255,10 +257,10 @@ fun NewsResourceTopics(
Text(
text = followableTopic.topic.name.uppercase(Locale.getDefault()),
modifier = Modifier.semantics {
contentDescription = followableTopic.topic.name +
if (followableTopic.isFollowed) " is followed"
else " is not followed"
// make sure this is the right place to add this - remove hardcoded strings
if (followableTopic.isFollowed) isFollowed
else isNotFollowed
}
)
}

@ -21,4 +21,7 @@
<string name="card_tap_action">Open Resource Link</string>
<string name="card_meta_data_text">%1$s • %2$s</string>
<string name="topic_is_followed">is followed</string>
<string name="topic_is_not_followed">is not followed</string>
</resources>

Loading…
Cancel
Save