Allow manual selection of manga description instead of copying to clipboard
Closes #6548 Notably missing some "standard" options like "Select all" or "Share": https://issuetracker.google.com/issues/226648919 (cherry picked from commit 60bcebe4d17730e5abb0a409a06af2d6853c61ad)
This commit is contained in:
parent
b9f1bfb9ff
commit
2f33b90eca
@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.size
|
|||||||
import androidx.compose.foundation.layout.sizeIn
|
import androidx.compose.foundation.layout.sizeIn
|
||||||
import androidx.compose.foundation.lazy.LazyRow
|
import androidx.compose.foundation.lazy.LazyRow
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.AttachMoney
|
import androidx.compose.material.icons.filled.AttachMoney
|
||||||
import androidx.compose.material.icons.filled.Block
|
import androidx.compose.material.icons.filled.Block
|
||||||
@ -224,7 +225,6 @@ fun ExpandableMangaDescription(
|
|||||||
doSearch: (query: String, global: Boolean) -> Unit,
|
doSearch: (query: String, global: Boolean) -> Unit,
|
||||||
// SY <--
|
// SY <--
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
|
||||||
Column(modifier = modifier) {
|
Column(modifier = modifier) {
|
||||||
val (expanded, onExpanded) = rememberSaveable {
|
val (expanded, onExpanded) = rememberSaveable {
|
||||||
mutableStateOf(defaultExpandState)
|
mutableStateOf(defaultExpandState)
|
||||||
@ -243,10 +243,7 @@ fun ExpandableMangaDescription(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.clickableNoIndication(
|
.clickableNoIndication { onExpanded(!expanded) },
|
||||||
onLongClick = { context.copyToClipboard(desc, desc) },
|
|
||||||
onClick = { onExpanded(!expanded) },
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
val tags = tagsProvider()
|
val tags = tagsProvider()
|
||||||
if (!tags.isNullOrEmpty()) {
|
if (!tags.isNullOrEmpty()) {
|
||||||
@ -597,6 +594,7 @@ private fun MangaSummary(
|
|||||||
expandedHeight = expandedPlaceable.maxByOrNull { it.height }?.height?.coerceAtLeast(shrunkHeight) ?: 0
|
expandedHeight = expandedPlaceable.maxByOrNull { it.height }?.height?.coerceAtLeast(shrunkHeight) ?: 0
|
||||||
|
|
||||||
val actualPlaceable = subcompose("description") {
|
val actualPlaceable = subcompose("description") {
|
||||||
|
SelectionContainer {
|
||||||
Text(
|
Text(
|
||||||
text = if (expanded) expandedDescription else shrunkDescription,
|
text = if (expanded) expandedDescription else shrunkDescription,
|
||||||
maxLines = Int.MAX_VALUE,
|
maxLines = Int.MAX_VALUE,
|
||||||
@ -604,6 +602,7 @@ private fun MangaSummary(
|
|||||||
color = MaterialTheme.colorScheme.onBackground,
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
modifier = Modifier.secondaryItemAlpha(),
|
modifier = Modifier.secondaryItemAlpha(),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}.map { it.measure(constraints) }
|
}.map { it.measure(constraints) }
|
||||||
|
|
||||||
val scrimPlaceable = subcompose("scrim") {
|
val scrimPlaceable = subcompose("scrim") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user