From a0625e5de24943dd19173ea40a70fef66417fb22 Mon Sep 17 00:00:00 2001 From: semenvav Date: Mon, 24 Jul 2023 23:58:39 +0300 Subject: [PATCH] add BackHandler add actionModeCounter --- .../more/download/DownloadStatsScreen.kt | 12 ++++++++++-- i18n/src/main/res/values/strings.xml | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreen.kt b/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreen.kt index 9d8d340317..ef1c0e1f84 100644 --- a/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/download/DownloadStatsScreen.kt @@ -1,5 +1,6 @@ package eu.kanade.presentation.more.download +import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons @@ -160,6 +161,9 @@ private fun DownloadStatsAppBar( navigateUp = navigateUp, onMultiDeleteClicked = onMultiDeleteClicked, ) + BackHandler( + onBack = onCancelActionMode, + ) } else { SearchToolbar( navigateUp = navigateUp, @@ -212,6 +216,9 @@ private fun DownloadStatsAppBar( }, scrollBehavior = scrollBehavior, ) + BackHandler( + onBack = { onChangeSearchQuery(null) }, + ) } } @@ -230,7 +237,7 @@ private fun DownloadStatsActionAppBar( modifier = modifier, title = stringResource(R.string.label_download_stats), onCancelActionMode = onCancelActionMode, - actions = { + actionModeActions = { AppBarActions( listOf( AppBar.Action( @@ -251,6 +258,7 @@ private fun DownloadStatsActionAppBar( ), ) }, + actionModeCounter = selected.size, scrollBehavior = scrollBehavior, navigateUp = navigateUp, ) @@ -296,7 +304,7 @@ fun SortDropdownMenu( onDismissRequest = onDismissRequest, ) { listOfNotNull( - SortingMode.BY_ALPHABET to stringResource(R.string.action_sort_alpha), + SortingMode.BY_ALPHABET to stringResource(R.string.action_sort_A_Z), SortingMode.BY_SIZE to stringResource(R.string.action_sort_size), ).map { (mode, string) -> SortItem( diff --git a/i18n/src/main/res/values/strings.xml b/i18n/src/main/res/values/strings.xml index b9b1ad12d8..11fc6294a1 100644 --- a/i18n/src/main/res/values/strings.xml +++ b/i18n/src/main/res/values/strings.xml @@ -58,6 +58,7 @@ Remove filter Alphabetically + A-Z Total entries Total chapters Last read