Add a Share string

This commit is contained in:
Ash 2022-05-13 11:09:58 +08:00
parent b18f459a71
commit 8913cf9f2e
6 changed files with 12 additions and 6 deletions

View File

@ -39,6 +39,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
@ -601,7 +602,7 @@ private fun TextComposer.appendTextChildren(
.fillMaxWidth(),
data = video.imageUrl,
size = maxImageSize(),
contentDescription = "点击播放视频",
contentDescription = stringResource(R.string.touch_to_play_video),
precision = Precision.INEXACT,
contentScale = ContentScale.FillWidth,
)
@ -614,7 +615,7 @@ private fun TextComposer.appendTextChildren(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = PADDING_HORIZONTAL.dp),
text = "点击播放视频",
text = stringResource(R.string.touch_to_play_video),
style = captionStyle(),
)

View File

@ -27,7 +27,6 @@ package me.ash.reader.ui.ext
*/
import android.view.ViewConfiguration
import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ScrollState
@ -89,7 +88,7 @@ fun Modifier.drawHorizontalScrollbar(
fun Modifier.drawVerticalScrollbar(
state: LazyListState,
reverseScrolling: Boolean = false
): Modifier = drawScrollbar(state, Orientation.Vertical, reverseScrolling).animateContentSize()
): Modifier = drawScrollbar(state, Orientation.Vertical, reverseScrolling)
private fun Modifier.drawScrollbar(
state: ScrollState,

View File

@ -163,7 +163,7 @@ private fun TopBar(
FeedbackIconButton(
modifier = Modifier.size(20.dp),
imageVector = Icons.Outlined.Share,
contentDescription = stringResource(R.string.search),
contentDescription = stringResource(R.string.share),
tint = MaterialTheme.colorScheme.onSurface,
) {
context.startActivity(Intent.createChooser(Intent(Intent.ACTION_SEND).apply {
@ -172,7 +172,7 @@ private fun TopBar(
title?.takeIf { it.isNotBlank() }?.let { it + "\n" } + link
)
type = "text/plain"
}, "Share"))
}, context.getString(R.string.share)))
}
}
)

View File

@ -168,4 +168,6 @@
<string name="tips_top_bar_tonal_elevation">Das farbliche Hervorheben der oberen Leiste ist nur beim Scrollen verfügbar.</string>
<string name="tips_article_list_tonal_elevation">Das farbliche Hervorheben der Artikelliste ist nur für das helle Design verfügbar.</string>
<string name="tips_group_list_tonal_elevation">Das farbliche Hervorheben der Gruppenliste ist nur für das helle Design verfügbar.</string>
<string name="share">Aktie</string>
<string name="touch_to_play_video">Berühren, um Video abzuspielen</string>
</resources>

View File

@ -165,4 +165,6 @@
<string name="tips_top_bar_tonal_elevation">标题栏的色调海拔仅在滚动时可用。</string>
<string name="tips_article_list_tonal_elevation">文章列表的色调海拔仅在亮色主题时可用。</string>
<string name="tips_group_list_tonal_elevation">分组列表的色调海拔仅在亮色主题时可用。</string>
<string name="share">分享</string>
<string name="touch_to_play_video">轻触播放视频</string>
</resources>

View File

@ -175,4 +175,6 @@
<string name="tips_top_bar_tonal_elevation">Tone elevation of the top bar is only available when scrolling.</string>
<string name="tips_article_list_tonal_elevation">Tone elevation of the article list is only available for light theme.</string>
<string name="tips_group_list_tonal_elevation">Tone elevation of the group list is only available for light theme.</string>
<string name="share">Share</string>
<string name="touch_to_play_video">Touch to play video</string>
</resources>