Make LongPressMenu scrollable if it does not fit on screen
This commit is contained in:
parent
a92c8b2243
commit
2a28e7a805
@ -28,8 +28,10 @@ import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.InlineTextContent
|
||||
import androidx.compose.foundation.text.appendInlineContent
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.OpenInNew
|
||||
import androidx.compose.material.icons.automirrored.filled.PlaylistPlay
|
||||
@ -242,8 +244,12 @@ private fun LongPressMenuContent(
|
||||
// width for the landscape/reduced header, measured in button widths
|
||||
val headerWidthInButtonsReducedSpan = 4
|
||||
val buttonsPerRow = (this.maxWidth / MinButtonWidth).toInt()
|
||||
val scrollState = rememberScrollState()
|
||||
|
||||
Column {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.verticalScroll(scrollState)
|
||||
) {
|
||||
var actionIndex = if (header != null) -1 else 0 // -1 indicates the header
|
||||
while (actionIndex < actions.size) {
|
||||
Row(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user