mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 19:41:50 +01:00
Minor cleanup
- Use outlined icons where appropriate to match previous UI - Allow tapping entire ChapterHeader to bring up sheet
This commit is contained in:
parent
470a576441
commit
8ec91cddab
@ -299,7 +299,7 @@ fun ExtensionItemContent(
|
|||||||
|
|
||||||
if (warning != null) {
|
if (warning != null) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = warning).uppercase(),
|
text = stringResource(warning).uppercase(),
|
||||||
style = MaterialTheme.typography.bodySmall.copy(
|
style = MaterialTheme.typography.bodySmall.copy(
|
||||||
color = MaterialTheme.colorScheme.error,
|
color = MaterialTheme.colorScheme.error,
|
||||||
),
|
),
|
||||||
@ -370,7 +370,7 @@ fun ExtensionHeader(
|
|||||||
action: @Composable RowScope.() -> Unit = {},
|
action: @Composable RowScope.() -> Unit = {},
|
||||||
) {
|
) {
|
||||||
ExtensionHeader(
|
ExtensionHeader(
|
||||||
text = stringResource(id = textRes),
|
text = stringResource(textRes),
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
action = action,
|
action = action,
|
||||||
)
|
)
|
||||||
|
@ -219,7 +219,7 @@ fun SourceOptionsDialog(
|
|||||||
Column {
|
Column {
|
||||||
val textId = if (Pin.Pinned in source.pin) R.string.action_unpin else R.string.action_pin
|
val textId = if (Pin.Pinned in source.pin) R.string.action_unpin else R.string.action_pin
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = textId),
|
text = stringResource(textId),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable(onClick = onClickPin)
|
.clickable(onClick = onClickPin)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
@ -61,7 +61,7 @@ fun ChapterDownloadIndicator(
|
|||||||
)
|
)
|
||||||
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_delete)) },
|
text = { Text(text = stringResource(R.string.action_delete)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onClick(ChapterDownloadAction.DELETE)
|
onClick(ChapterDownloadAction.DELETE)
|
||||||
isMenuExpanded = false
|
isMenuExpanded = false
|
||||||
@ -122,14 +122,14 @@ fun ChapterDownloadIndicator(
|
|||||||
)
|
)
|
||||||
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
DropdownMenu(expanded = isMenuExpanded, onDismissRequest = { isMenuExpanded = false }) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_start_downloading_now)) },
|
text = { Text(text = stringResource(R.string.action_start_downloading_now)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onClick(ChapterDownloadAction.START_NOW)
|
onClick(ChapterDownloadAction.START_NOW)
|
||||||
isMenuExpanded = false
|
isMenuExpanded = false
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_cancel)) },
|
text = { Text(text = stringResource(R.string.action_cancel)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onClick(ChapterDownloadAction.CANCEL)
|
onClick(ChapterDownloadAction.CANCEL)
|
||||||
isMenuExpanded = false
|
isMenuExpanded = false
|
||||||
|
@ -17,7 +17,7 @@ fun EmptyScreen(
|
|||||||
actions: List<EmptyView.Action>? = null,
|
actions: List<EmptyView.Action>? = null,
|
||||||
) {
|
) {
|
||||||
EmptyScreen(
|
EmptyScreen(
|
||||||
message = stringResource(id = textResource),
|
message = stringResource(textResource),
|
||||||
actions = actions,
|
actions = actions,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
} else {
|
} else {
|
||||||
R.string.action_start
|
R.string.action_start
|
||||||
}
|
}
|
||||||
Text(text = stringResource(id = id))
|
Text(text = stringResource(id))
|
||||||
},
|
},
|
||||||
icon = { Icon(imageVector = Icons.Default.PlayArrow, contentDescription = null) },
|
icon = { Icon(imageVector = Icons.Default.PlayArrow, contentDescription = null) },
|
||||||
onClick = onContinueReading,
|
onClick = onContinueReading,
|
||||||
@ -410,7 +410,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
MangaChapterListItem(
|
MangaChapterListItem(
|
||||||
title = chapterTitle,
|
title = chapterTitle,
|
||||||
date = date,
|
date = date,
|
||||||
readProgress = lastPageRead?.let { stringResource(id = R.string.chapter_progress, it + 1) },
|
readProgress = lastPageRead?.let { stringResource(R.string.chapter_progress, it + 1) },
|
||||||
scanlator = scanlator,
|
scanlator = scanlator,
|
||||||
read = chapter.read,
|
read = chapter.read,
|
||||||
bookmark = chapter.bookmark,
|
bookmark = chapter.bookmark,
|
||||||
@ -599,7 +599,7 @@ fun MangaScreenLargeImpl(
|
|||||||
} else {
|
} else {
|
||||||
R.string.action_start
|
R.string.action_start
|
||||||
}
|
}
|
||||||
Text(text = stringResource(id = id))
|
Text(text = stringResource(id))
|
||||||
},
|
},
|
||||||
icon = { Icon(imageVector = Icons.Default.PlayArrow, contentDescription = null) },
|
icon = { Icon(imageVector = Icons.Default.PlayArrow, contentDescription = null) },
|
||||||
onClick = onContinueReading,
|
onClick = onContinueReading,
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
package eu.kanade.presentation.manga.components
|
package eu.kanade.presentation.manga.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.FilterList
|
import androidx.compose.material.icons.filled.FilterList
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.LocalMinimumTouchTargetEnforcement
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
@ -31,12 +29,13 @@ fun ChapterHeader(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(start = 16.dp, top = 4.dp, end = 8.dp, bottom = 4.dp),
|
.clickable(onClick = onFilterButtonClicked)
|
||||||
|
.padding(horizontal = 16.dp, vertical = 4.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = if (chapterCount == null) {
|
text = if (chapterCount == null) {
|
||||||
stringResource(id = R.string.chapters)
|
stringResource(R.string.chapters)
|
||||||
} else {
|
} else {
|
||||||
quantityStringResource(id = R.plurals.manga_num_chapters, quantity = chapterCount)
|
quantityStringResource(id = R.plurals.manga_num_chapters, quantity = chapterCount)
|
||||||
},
|
},
|
||||||
@ -44,18 +43,14 @@ fun ChapterHeader(
|
|||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
color = MaterialTheme.colorScheme.onBackground,
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
)
|
)
|
||||||
CompositionLocalProvider(LocalMinimumTouchTargetEnforcement provides false) {
|
Icon(
|
||||||
IconButton(onClick = onFilterButtonClicked) {
|
imageVector = Icons.Default.FilterList,
|
||||||
Icon(
|
contentDescription = stringResource(R.string.action_filter),
|
||||||
imageVector = Icons.Default.FilterList,
|
tint = if (isChapterFiltered) {
|
||||||
contentDescription = stringResource(id = R.string.action_filter),
|
Color(LocalContext.current.getResourceColor(R.attr.colorFilterActive))
|
||||||
tint = if (isChapterFiltered) {
|
} else {
|
||||||
Color(LocalContext.current.getResourceColor(R.attr.colorFilterActive))
|
MaterialTheme.colorScheme.onBackground
|
||||||
} else {
|
},
|
||||||
MaterialTheme.colorScheme.onBackground
|
)
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.BookmarkAdd
|
import androidx.compose.material.icons.filled.BookmarkAdd
|
||||||
import androidx.compose.material.icons.filled.BookmarkRemove
|
import androidx.compose.material.icons.filled.BookmarkRemove
|
||||||
import androidx.compose.material.icons.filled.Delete
|
|
||||||
import androidx.compose.material.icons.filled.DoneAll
|
import androidx.compose.material.icons.filled.DoneAll
|
||||||
import androidx.compose.material.icons.filled.Download
|
|
||||||
import androidx.compose.material.icons.filled.RemoveDone
|
import androidx.compose.material.icons.filled.RemoveDone
|
||||||
|
import androidx.compose.material.icons.outlined.Delete
|
||||||
|
import androidx.compose.material.icons.outlined.Download
|
||||||
import androidx.compose.material.ripple.rememberRipple
|
import androidx.compose.material.ripple.rememberRipple
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
@ -89,7 +89,7 @@ fun MangaBottomActionMenu(
|
|||||||
) {
|
) {
|
||||||
if (onBookmarkClicked != null) {
|
if (onBookmarkClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_bookmark),
|
title = stringResource(R.string.action_bookmark),
|
||||||
icon = Icons.Default.BookmarkAdd,
|
icon = Icons.Default.BookmarkAdd,
|
||||||
toConfirm = confirm[0],
|
toConfirm = confirm[0],
|
||||||
onLongClick = { onLongClickItem(0) },
|
onLongClick = { onLongClickItem(0) },
|
||||||
@ -98,7 +98,7 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onRemoveBookmarkClicked != null) {
|
if (onRemoveBookmarkClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_remove_bookmark),
|
title = stringResource(R.string.action_remove_bookmark),
|
||||||
icon = Icons.Default.BookmarkRemove,
|
icon = Icons.Default.BookmarkRemove,
|
||||||
toConfirm = confirm[1],
|
toConfirm = confirm[1],
|
||||||
onLongClick = { onLongClickItem(1) },
|
onLongClick = { onLongClickItem(1) },
|
||||||
@ -107,7 +107,7 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onMarkAsReadClicked != null) {
|
if (onMarkAsReadClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_mark_as_read),
|
title = stringResource(R.string.action_mark_as_read),
|
||||||
icon = Icons.Default.DoneAll,
|
icon = Icons.Default.DoneAll,
|
||||||
toConfirm = confirm[2],
|
toConfirm = confirm[2],
|
||||||
onLongClick = { onLongClickItem(2) },
|
onLongClick = { onLongClickItem(2) },
|
||||||
@ -116,7 +116,7 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onMarkAsUnreadClicked != null) {
|
if (onMarkAsUnreadClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_mark_as_unread),
|
title = stringResource(R.string.action_mark_as_unread),
|
||||||
icon = Icons.Default.RemoveDone,
|
icon = Icons.Default.RemoveDone,
|
||||||
toConfirm = confirm[3],
|
toConfirm = confirm[3],
|
||||||
onLongClick = { onLongClickItem(3) },
|
onLongClick = { onLongClickItem(3) },
|
||||||
@ -125,7 +125,7 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onMarkPreviousAsReadClicked != null) {
|
if (onMarkPreviousAsReadClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_mark_previous_as_read),
|
title = stringResource(R.string.action_mark_previous_as_read),
|
||||||
icon = ImageVector.vectorResource(id = R.drawable.ic_done_prev_24dp),
|
icon = ImageVector.vectorResource(id = R.drawable.ic_done_prev_24dp),
|
||||||
toConfirm = confirm[4],
|
toConfirm = confirm[4],
|
||||||
onLongClick = { onLongClickItem(4) },
|
onLongClick = { onLongClickItem(4) },
|
||||||
@ -134,8 +134,8 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onDownloadClicked != null) {
|
if (onDownloadClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_download),
|
title = stringResource(R.string.action_download),
|
||||||
icon = Icons.Default.Download,
|
icon = Icons.Outlined.Download,
|
||||||
toConfirm = confirm[5],
|
toConfirm = confirm[5],
|
||||||
onLongClick = { onLongClickItem(5) },
|
onLongClick = { onLongClickItem(5) },
|
||||||
onClick = onDownloadClicked,
|
onClick = onDownloadClicked,
|
||||||
@ -143,8 +143,8 @@ fun MangaBottomActionMenu(
|
|||||||
}
|
}
|
||||||
if (onDeleteClicked != null) {
|
if (onDeleteClicked != null) {
|
||||||
Button(
|
Button(
|
||||||
title = stringResource(id = R.string.action_delete),
|
title = stringResource(R.string.action_delete),
|
||||||
icon = Icons.Default.Delete,
|
icon = Icons.Outlined.Delete,
|
||||||
toConfirm = confirm[6],
|
toConfirm = confirm[6],
|
||||||
onLongClick = { onLongClickItem(6) },
|
onLongClick = { onLongClickItem(6) },
|
||||||
onClick = onDeleteClicked,
|
onClick = onDeleteClicked,
|
||||||
|
@ -74,7 +74,7 @@ fun MangaChapterListItem(
|
|||||||
if (bookmark) {
|
if (bookmark) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Bookmark,
|
imageVector = Icons.Default.Bookmark,
|
||||||
contentDescription = stringResource(id = R.string.action_filter_bookmarked),
|
contentDescription = stringResource(R.string.action_filter_bookmarked),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.sizeIn(maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp }),
|
.sizeIn(maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp }),
|
||||||
tint = textColor,
|
tint = textColor,
|
||||||
|
@ -64,20 +64,20 @@ fun MangaCoverDialog(
|
|||||||
IconButton(onClick = onDismissRequest) {
|
IconButton(onClick = onDismissRequest) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Close,
|
imageVector = Icons.Default.Close,
|
||||||
contentDescription = stringResource(id = R.string.action_close),
|
contentDescription = stringResource(R.string.action_close),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
IconButton(onClick = onShareClick) {
|
IconButton(onClick = onShareClick) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Outlined.Share,
|
imageVector = Icons.Outlined.Share,
|
||||||
contentDescription = stringResource(id = R.string.action_share),
|
contentDescription = stringResource(R.string.action_share),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
IconButton(onClick = onSaveClick) {
|
IconButton(onClick = onSaveClick) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Outlined.Save,
|
imageVector = Icons.Outlined.Save,
|
||||||
contentDescription = stringResource(id = R.string.action_save),
|
contentDescription = stringResource(R.string.action_save),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (onEditClick != null) {
|
if (onEditClick != null) {
|
||||||
@ -88,7 +88,7 @@ fun MangaCoverDialog(
|
|||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Outlined.Edit,
|
imageVector = Icons.Outlined.Edit,
|
||||||
contentDescription = stringResource(id = R.string.action_edit_cover),
|
contentDescription = stringResource(R.string.action_edit_cover),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
@ -96,14 +96,14 @@ fun MangaCoverDialog(
|
|||||||
onDismissRequest = { onExpand(false) },
|
onDismissRequest = { onExpand(false) },
|
||||||
) {
|
) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_edit)) },
|
text = { Text(text = stringResource(R.string.action_edit)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onEditClick(EditCoverAction.EDIT)
|
onEditClick(EditCoverAction.EDIT)
|
||||||
onExpand(false)
|
onExpand(false)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_delete)) },
|
text = { Text(text = stringResource(R.string.action_delete)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onEditClick(EditCoverAction.DELETE)
|
onEditClick(EditCoverAction.DELETE)
|
||||||
onExpand(false)
|
onExpand(false)
|
||||||
|
@ -165,9 +165,9 @@ fun MangaInfoHeader(
|
|||||||
val defaultActionButtonColor = MaterialTheme.colorScheme.onSurface.copy(alpha = .38f)
|
val defaultActionButtonColor = MaterialTheme.colorScheme.onSurface.copy(alpha = .38f)
|
||||||
MangaActionButton(
|
MangaActionButton(
|
||||||
title = if (favorite) {
|
title = if (favorite) {
|
||||||
stringResource(id = R.string.in_library)
|
stringResource(R.string.in_library)
|
||||||
} else {
|
} else {
|
||||||
stringResource(id = R.string.add_to_library)
|
stringResource(R.string.add_to_library)
|
||||||
},
|
},
|
||||||
icon = if (favorite) Icons.Default.Favorite else Icons.Default.FavoriteBorder,
|
icon = if (favorite) Icons.Default.Favorite else Icons.Default.FavoriteBorder,
|
||||||
color = if (favorite) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
color = if (favorite) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
||||||
@ -177,7 +177,7 @@ fun MangaInfoHeader(
|
|||||||
if (onTrackingClicked != null) {
|
if (onTrackingClicked != null) {
|
||||||
MangaActionButton(
|
MangaActionButton(
|
||||||
title = if (trackingCount == 0) {
|
title = if (trackingCount == 0) {
|
||||||
stringResource(id = R.string.manga_tracking_tab)
|
stringResource(R.string.manga_tracking_tab)
|
||||||
} else {
|
} else {
|
||||||
quantityStringResource(id = R.plurals.num_trackers, quantity = trackingCount, trackingCount)
|
quantityStringResource(id = R.plurals.num_trackers, quantity = trackingCount, trackingCount)
|
||||||
},
|
},
|
||||||
@ -188,7 +188,7 @@ fun MangaInfoHeader(
|
|||||||
}
|
}
|
||||||
if (onWebViewClicked != null) {
|
if (onWebViewClicked != null) {
|
||||||
MangaActionButton(
|
MangaActionButton(
|
||||||
title = stringResource(id = R.string.action_web_view),
|
title = stringResource(R.string.action_web_view),
|
||||||
icon = Icons.Default.Public,
|
icon = Icons.Default.Public,
|
||||||
color = defaultActionButtonColor,
|
color = defaultActionButtonColor,
|
||||||
onClick = onWebViewClicked,
|
onClick = onWebViewClicked,
|
||||||
@ -287,7 +287,7 @@ private fun MangaAndSourceTitlesLarge(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Text(
|
Text(
|
||||||
text = title.takeIf { it.isNotBlank() } ?: stringResource(id = R.string.unknown),
|
text = title.takeIf { it.isNotBlank() } ?: stringResource(R.string.unknown),
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
modifier = Modifier.clickableNoIndication(
|
modifier = Modifier.clickableNoIndication(
|
||||||
onLongClick = { if (title.isNotBlank()) context.copyToClipboard(title, title) },
|
onLongClick = { if (title.isNotBlank()) context.copyToClipboard(title, title) },
|
||||||
@ -297,7 +297,7 @@ private fun MangaAndSourceTitlesLarge(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = author?.takeIf { it.isNotBlank() } ?: stringResource(id = R.string.unknown_author),
|
text = author?.takeIf { it.isNotBlank() } ?: stringResource(R.string.unknown_author),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.secondaryItemAlpha()
|
.secondaryItemAlpha()
|
||||||
@ -350,13 +350,13 @@ private fun MangaAndSourceTitlesLarge(
|
|||||||
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
||||||
Text(
|
Text(
|
||||||
text = when (status) {
|
text = when (status) {
|
||||||
SManga.ONGOING.toLong() -> stringResource(id = R.string.ongoing)
|
SManga.ONGOING.toLong() -> stringResource(R.string.ongoing)
|
||||||
SManga.COMPLETED.toLong() -> stringResource(id = R.string.completed)
|
SManga.COMPLETED.toLong() -> stringResource(R.string.completed)
|
||||||
SManga.LICENSED.toLong() -> stringResource(id = R.string.licensed)
|
SManga.LICENSED.toLong() -> stringResource(R.string.licensed)
|
||||||
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(id = R.string.publishing_finished)
|
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(R.string.publishing_finished)
|
||||||
SManga.CANCELLED.toLong() -> stringResource(id = R.string.cancelled)
|
SManga.CANCELLED.toLong() -> stringResource(R.string.cancelled)
|
||||||
SManga.ON_HIATUS.toLong() -> stringResource(id = R.string.on_hiatus)
|
SManga.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
|
||||||
else -> stringResource(id = R.string.unknown)
|
else -> stringResource(R.string.unknown)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DotSeparatorText()
|
DotSeparatorText()
|
||||||
@ -406,7 +406,7 @@ private fun MangaAndSourceTitlesSmall(
|
|||||||
)
|
)
|
||||||
Column(modifier = Modifier.padding(start = 16.dp)) {
|
Column(modifier = Modifier.padding(start = 16.dp)) {
|
||||||
Text(
|
Text(
|
||||||
text = title.ifBlank { stringResource(id = R.string.unknown) },
|
text = title.ifBlank { stringResource(R.string.unknown) },
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
modifier = Modifier.clickableNoIndication(
|
modifier = Modifier.clickableNoIndication(
|
||||||
onLongClick = { if (title.isNotBlank()) context.copyToClipboard(title, title) },
|
onLongClick = { if (title.isNotBlank()) context.copyToClipboard(title, title) },
|
||||||
@ -415,7 +415,7 @@ private fun MangaAndSourceTitlesSmall(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = author?.takeIf { it.isNotBlank() } ?: stringResource(id = R.string.unknown_author),
|
text = author?.takeIf { it.isNotBlank() } ?: stringResource(R.string.unknown_author),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.secondaryItemAlpha()
|
.secondaryItemAlpha()
|
||||||
@ -466,13 +466,13 @@ private fun MangaAndSourceTitlesSmall(
|
|||||||
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
ProvideTextStyle(MaterialTheme.typography.bodyMedium) {
|
||||||
Text(
|
Text(
|
||||||
text = when (status) {
|
text = when (status) {
|
||||||
SManga.ONGOING.toLong() -> stringResource(id = R.string.ongoing)
|
SManga.ONGOING.toLong() -> stringResource(R.string.ongoing)
|
||||||
SManga.COMPLETED.toLong() -> stringResource(id = R.string.completed)
|
SManga.COMPLETED.toLong() -> stringResource(R.string.completed)
|
||||||
SManga.LICENSED.toLong() -> stringResource(id = R.string.licensed)
|
SManga.LICENSED.toLong() -> stringResource(R.string.licensed)
|
||||||
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(id = R.string.publishing_finished)
|
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(R.string.publishing_finished)
|
||||||
SManga.CANCELLED.toLong() -> stringResource(id = R.string.cancelled)
|
SManga.CANCELLED.toLong() -> stringResource(R.string.cancelled)
|
||||||
SManga.ON_HIATUS.toLong() -> stringResource(id = R.string.on_hiatus)
|
SManga.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
|
||||||
else -> stringResource(id = R.string.unknown)
|
else -> stringResource(R.string.unknown)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DotSeparatorText()
|
DotSeparatorText()
|
||||||
|
@ -13,11 +13,11 @@ import androidx.compose.foundation.layout.windowInsetsPadding
|
|||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.Download
|
|
||||||
import androidx.compose.material.icons.filled.FlipToBack
|
import androidx.compose.material.icons.filled.FlipToBack
|
||||||
import androidx.compose.material.icons.filled.MoreVert
|
import androidx.compose.material.icons.filled.MoreVert
|
||||||
import androidx.compose.material.icons.filled.SelectAll
|
import androidx.compose.material.icons.filled.SelectAll
|
||||||
import androidx.compose.material.icons.filled.Share
|
import androidx.compose.material.icons.outlined.Download
|
||||||
|
import androidx.compose.material.icons.outlined.Share
|
||||||
import androidx.compose.material3.DropdownMenuItem
|
import androidx.compose.material3.DropdownMenuItem
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
@ -81,7 +81,7 @@ fun MangaSmallAppBar(
|
|||||||
IconButton(onClick = onBackClicked) {
|
IconButton(onClick = onBackClicked) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = if (isActionMode) Icons.Default.Close else Icons.Default.ArrowBack,
|
imageVector = if (isActionMode) Icons.Default.Close else Icons.Default.ArrowBack,
|
||||||
contentDescription = stringResource(id = R.string.abc_action_bar_up_description),
|
contentDescription = stringResource(R.string.abc_action_bar_up_description),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -90,21 +90,21 @@ fun MangaSmallAppBar(
|
|||||||
IconButton(onClick = onSelectAll) {
|
IconButton(onClick = onSelectAll) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.SelectAll,
|
imageVector = Icons.Default.SelectAll,
|
||||||
contentDescription = stringResource(id = R.string.action_select_all),
|
contentDescription = stringResource(R.string.action_select_all),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
IconButton(onClick = onInvertSelection) {
|
IconButton(onClick = onInvertSelection) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.FlipToBack,
|
imageVector = Icons.Default.FlipToBack,
|
||||||
contentDescription = stringResource(id = R.string.action_select_inverse),
|
contentDescription = stringResource(R.string.action_select_inverse),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (onShareClicked != null) {
|
if (onShareClicked != null) {
|
||||||
IconButton(onClick = onShareClicked) {
|
IconButton(onClick = onShareClicked) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Share,
|
imageVector = Icons.Outlined.Share,
|
||||||
contentDescription = stringResource(id = R.string.action_share),
|
contentDescription = stringResource(R.string.action_share),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -114,8 +114,8 @@ fun MangaSmallAppBar(
|
|||||||
Box {
|
Box {
|
||||||
IconButton(onClick = { onDownloadExpanded(!downloadExpanded) }) {
|
IconButton(onClick = { onDownloadExpanded(!downloadExpanded) }) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Download,
|
imageVector = Icons.Outlined.Download,
|
||||||
contentDescription = stringResource(id = R.string.manga_download),
|
contentDescription = stringResource(R.string.manga_download),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val onDismissRequest = { onDownloadExpanded(false) }
|
val onDismissRequest = { onDownloadExpanded(false) }
|
||||||
@ -124,42 +124,42 @@ fun MangaSmallAppBar(
|
|||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
) {
|
) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_1)) },
|
text = { Text(text = stringResource(R.string.download_1)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.NEXT_1_CHAPTER)
|
onDownloadClicked(DownloadAction.NEXT_1_CHAPTER)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_5)) },
|
text = { Text(text = stringResource(R.string.download_5)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.NEXT_5_CHAPTERS)
|
onDownloadClicked(DownloadAction.NEXT_5_CHAPTERS)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_10)) },
|
text = { Text(text = stringResource(R.string.download_10)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.NEXT_10_CHAPTERS)
|
onDownloadClicked(DownloadAction.NEXT_10_CHAPTERS)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_custom)) },
|
text = { Text(text = stringResource(R.string.download_custom)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.CUSTOM)
|
onDownloadClicked(DownloadAction.CUSTOM)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_unread)) },
|
text = { Text(text = stringResource(R.string.download_unread)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.UNREAD_CHAPTERS)
|
onDownloadClicked(DownloadAction.UNREAD_CHAPTERS)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.download_all)) },
|
text = { Text(text = stringResource(R.string.download_all)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDownloadClicked(DownloadAction.ALL_CHAPTERS)
|
onDownloadClicked(DownloadAction.ALL_CHAPTERS)
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
@ -175,7 +175,7 @@ fun MangaSmallAppBar(
|
|||||||
IconButton(onClick = { onMoreExpanded(!moreExpanded) }) {
|
IconButton(onClick = { onMoreExpanded(!moreExpanded) }) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.MoreVert,
|
imageVector = Icons.Default.MoreVert,
|
||||||
contentDescription = stringResource(id = R.string.abc_action_menu_overflow_description),
|
contentDescription = stringResource(R.string.abc_action_menu_overflow_description),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val onDismissRequest = { onMoreExpanded(false) }
|
val onDismissRequest = { onMoreExpanded(false) }
|
||||||
@ -184,14 +184,14 @@ fun MangaSmallAppBar(
|
|||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
) {
|
) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_edit_categories)) },
|
text = { Text(text = stringResource(R.string.action_edit_categories)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onEditCategoryClicked()
|
onEditCategoryClicked()
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(id = R.string.action_migrate)) },
|
text = { Text(text = stringResource(R.string.action_migrate)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onMigrateClicked()
|
onMigrateClicked()
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
@ -211,7 +211,7 @@ fun MangaSmallAppBar(
|
|||||||
|
|
||||||
if (downloadedOnlyMode) {
|
if (downloadedOnlyMode) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = R.string.label_downloaded_only),
|
text = stringResource(R.string.label_downloaded_only),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = MaterialTheme.colorScheme.tertiary)
|
.background(color = MaterialTheme.colorScheme.tertiary)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@ -223,7 +223,7 @@ fun MangaSmallAppBar(
|
|||||||
}
|
}
|
||||||
if (incognitoMode) {
|
if (incognitoMode) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = R.string.pref_incognito_mode),
|
text = stringResource(R.string.pref_incognito_mode),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = MaterialTheme.colorScheme.primary)
|
.background(color = MaterialTheme.colorScheme.primary)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
Loading…
Reference in New Issue
Block a user