Improve internalization

pull/1837/head
Rob Orgiu 1 year ago
parent 5b674e2247
commit 7eb0dba21e

@ -97,6 +97,12 @@ fun NewsResourceCardExpanded(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val clickActionLabel = stringResource(R.string.core_ui_card_tap_action) val clickActionLabel = stringResource(R.string.core_ui_card_tap_action)
val sharingLabel = stringResource(R.string.core_ui_feed_sharing)
val sharingContent = stringResource(
R.string.core_ui_feed_sharing_data,
userNewsResource.title,
userNewsResource.url,
)
val dragAndDropFlags = if (VERSION.SDK_INT >= VERSION_CODES.N) { val dragAndDropFlags = if (VERSION.SDK_INT >= VERSION_CODES.N) {
View.DRAG_FLAG_GLOBAL View.DRAG_FLAG_GLOBAL
@ -128,15 +134,16 @@ fun NewsResourceCardExpanded(
Row { Row {
NewsResourceTitle( NewsResourceTitle(
userNewsResource.title, userNewsResource.title,
modifier = Modifier.fillMaxWidth((.8f)) modifier = Modifier
.fillMaxWidth((.8f))
.dragAndDropSource { .dragAndDropSource {
detectTapGestures( detectTapGestures(
onLongPress = { onLongPress = {
startTransfer( startTransfer(
DragAndDropTransferData( DragAndDropTransferData(
ClipData.newPlainText( ClipData.newPlainText(
"Feed sharing", sharingLabel,
userNewsResource.title + ": " + userNewsResource.url, sharingContent,
), ),
flags = dragAndDropFlags, flags = dragAndDropFlags,
), ),

@ -29,4 +29,6 @@
<string name="core_ui_interests_card_follow_button_content_desc">Follow interest</string> <string name="core_ui_interests_card_follow_button_content_desc">Follow interest</string>
<string name="core_ui_interests_card_unfollow_button_content_desc">Unfollow interest</string> <string name="core_ui_interests_card_unfollow_button_content_desc">Unfollow interest</string>
<string name="core_ui_feed_sharing">Feed sharing</string>
<string name="core_ui_feed_sharing_data">%1$s: %2$s</string>
</resources> </resources>

Loading…
Cancel
Save