|
@@ -9,6 +9,7 @@ import androidx.compose.animation.shrinkVertically
|
|
|
import androidx.compose.foundation.combinedClickable
|
|
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
+import androidx.compose.foundation.layout.Box
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
import androidx.compose.foundation.layout.RowScope
|
|
@@ -37,8 +38,10 @@ import androidx.compose.material3.Text
|
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableStateListOf
|
|
|
+import androidx.compose.runtime.mutableStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
|
+import androidx.compose.runtime.setValue
|
|
|
import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.graphics.vector.ImageVector
|
|
@@ -48,6 +51,7 @@ import androidx.compose.ui.res.stringResource
|
|
|
import androidx.compose.ui.res.vectorResource
|
|
|
import androidx.compose.ui.text.style.TextOverflow
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
+import eu.kanade.presentation.manga.DownloadAction
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
import kotlinx.coroutines.Job
|
|
|
import kotlinx.coroutines.delay
|
|
@@ -211,7 +215,7 @@ fun LibraryBottomActionMenu(
|
|
|
onChangeCategoryClicked: (() -> Unit)?,
|
|
|
onMarkAsReadClicked: (() -> Unit)?,
|
|
|
onMarkAsUnreadClicked: (() -> Unit)?,
|
|
|
- onDownloadClicked: (() -> Unit)?,
|
|
|
+ onDownloadClicked: ((DownloadAction) -> Unit)?,
|
|
|
onDeleteClicked: (() -> Unit)?,
|
|
|
) {
|
|
|
AnimatedVisibility(
|
|
@@ -270,13 +274,23 @@ fun LibraryBottomActionMenu(
|
|
|
)
|
|
|
}
|
|
|
if (onDownloadClicked != null) {
|
|
|
- Button(
|
|
|
- title = stringResource(R.string.action_download),
|
|
|
- icon = Icons.Outlined.Download,
|
|
|
- toConfirm = confirm[3],
|
|
|
- onLongClick = { onLongClickItem(3) },
|
|
|
- onClick = onDownloadClicked,
|
|
|
- )
|
|
|
+ Box {
|
|
|
+ var downloadExpanded by remember { mutableStateOf(false) }
|
|
|
+ [email protected](
|
|
|
+ title = stringResource(R.string.action_download),
|
|
|
+ icon = Icons.Outlined.Download,
|
|
|
+ toConfirm = confirm[3],
|
|
|
+ onLongClick = { onLongClickItem(3) },
|
|
|
+ onClick = { downloadExpanded = !downloadExpanded },
|
|
|
+ )
|
|
|
+ val onDismissRequest = { downloadExpanded = false }
|
|
|
+ DownloadDropdownMenu(
|
|
|
+ expanded = downloadExpanded,
|
|
|
+ onDismissRequest = onDismissRequest,
|
|
|
+ onDownloadClicked = onDownloadClicked,
|
|
|
+ includeDownloadAllOption = false,
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
if (onDeleteClicked != null) {
|
|
|
Button(
|