Use same icons as action bar in swipe actions

This commit is contained in:
arkon 2023-06-25 14:50:48 -04:00
parent 88e9fefa59
commit a07e0df815

View File

@ -17,13 +17,14 @@ import androidx.compose.material.DismissValue
import androidx.compose.material.SwipeToDismiss
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Bookmark
import androidx.compose.material.icons.filled.BookmarkRemove
import androidx.compose.material.icons.filled.Circle
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.Download
import androidx.compose.material.icons.filled.FileDownloadOff
import androidx.compose.material.icons.filled.Visibility
import androidx.compose.material.icons.filled.VisibilityOff
import androidx.compose.material.icons.outlined.BookmarkAdd
import androidx.compose.material.icons.outlined.BookmarkRemove
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Done
import androidx.compose.material.icons.outlined.Download
import androidx.compose.material.icons.outlined.FileDownloadOff
import androidx.compose.material.icons.outlined.RemoveDone
import androidx.compose.material.rememberDismissState
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
@ -294,32 +295,30 @@ private fun SwipeBackgroundIcon(
val imageVector = when (swipeAction) {
LibraryPreferences.ChapterSwipeAction.ToggleRead -> {
if (!read) {
Icons.Default.Visibility
Icons.Outlined.Done
} else {
Icons.Default.VisibilityOff
Icons.Outlined.RemoveDone
}
}
LibraryPreferences.ChapterSwipeAction.ToggleBookmark -> {
if (!bookmark) {
Icons.Default.Bookmark
Icons.Outlined.BookmarkAdd
} else {
Icons.Default.BookmarkRemove
Icons.Outlined.BookmarkRemove
}
}
LibraryPreferences.ChapterSwipeAction.Download -> {
when (downloadState) {
Download.State.NOT_DOWNLOADED,
Download.State.ERROR,
-> { Icons.Default.Download }
-> { Icons.Outlined.Download }
Download.State.QUEUE,
Download.State.DOWNLOADING,
-> { Icons.Default.FileDownloadOff }
Download.State.DOWNLOADED -> { Icons.Default.Delete }
-> { Icons.Outlined.FileDownloadOff }
Download.State.DOWNLOADED -> { Icons.Outlined.Delete }
}
}
LibraryPreferences.ChapterSwipeAction.Disabled -> {
null
}
LibraryPreferences.ChapterSwipeAction.Disabled -> null
}
imageVector?.let {
Icon(