diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/main/TorrentList.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/main/TorrentList.kt index 9812f9075..3489b622a 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/main/TorrentList.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/main/TorrentList.kt @@ -18,19 +18,21 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp +import com.hippo.ehviewer.R import com.hippo.ehviewer.client.parser.Torrent import com.hippo.ehviewer.client.parser.format @Composable fun TorrentList( - title: String, items: List, onItemClick: (Torrent) -> Unit, modifier: Modifier = Modifier, ) { + val title = stringResource(R.string.torrents) Column( modifier = modifier.padding(vertical = 8.dp), horizontalAlignment = Alignment.CenterHorizontally, diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailScreen.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailScreen.kt index 7a8e37a49..d001f2eb2 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailScreen.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailScreen.kt @@ -561,12 +561,11 @@ fun GalleryDetailScreen(args: GalleryDetailScreenArgs, navigator: DestinationsNa ) }, ) - val torrentText = stringResource(R.string.torrents) + val torrentText = stringResource(R.string.torrent_count, galleryDetail.torrentCount) val permissionDenied = stringResource(R.string.permission_denied) val downloadTorrentFailed = stringResource(R.string.download_torrent_failure) val downloadTorrentStarted = stringResource(R.string.download_torrent_started) val noTorrents = stringResource(R.string.no_torrents) - val noCurrentTorrents = stringResource(R.string.no_current_torrents) val torrentResult = remember(galleryDetail) { async(Dispatchers.IO, CoroutineStart.LAZY) { EhEngine.getTorrentList(galleryDetail.torrentUrl!!, gid, token) @@ -575,11 +574,10 @@ fun GalleryDetailScreen(args: GalleryDetailScreenArgs, navigator: DestinationsNa suspend fun showTorrentDialog() { val torrentList = bgWork { torrentResult.await() } if (torrentList.isEmpty()) { - showSnackbar(noCurrentTorrents) + showSnackbar(noTorrents) } else { val selected = showNoButton(false) { TorrentList( - title = torrentText, items = torrentList, onItemClick = { dismissWith(it) }, ) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0dffa33dc..830232a64 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -119,7 +119,6 @@ 评分成功 评分失败 没有种子 - 没有当前版本画廊的种子 开始下载种子 无法下载种子 种子 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c29d20f52..58f290734 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -159,7 +159,6 @@ Rate successfully Rate failed No torrents - No torrents for the current version of the gallery Torrent download started Failed to download torrent Torrents