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. // 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. // To avoid UI confusion, only one topic can have an expanded menu at a time.
var expandedTopicId by remember { mutableStateOf<String?>(null) } 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( Row(
modifier = modifier.horizontalScroll(rememberScrollState()), // causes narrow chips modifier = modifier.horizontalScroll(rememberScrollState()), // causes narrow chips
@ -255,10 +257,10 @@ fun NewsResourceTopics(
Text( Text(
text = followableTopic.topic.name.uppercase(Locale.getDefault()), text = followableTopic.topic.name.uppercase(Locale.getDefault()),
modifier = Modifier.semantics { modifier = Modifier.semantics {
contentDescription = followableTopic.topic.name + contentDescription = followableTopic.topic.name +
if (followableTopic.isFollowed) " is followed" if (followableTopic.isFollowed) isFollowed
else " is not followed" else isNotFollowed
// make sure this is the right place to add this - remove hardcoded strings
} }
) )
} }

@ -21,4 +21,7 @@
<string name="card_tap_action">Open Resource Link</string> <string name="card_tap_action">Open Resource Link</string>
<string name="card_meta_data_text">%1$s • %2$s</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> </resources>

Loading…
Cancel
Save