Add scrolling support to debug menu dialogs
This commit is contained in:
parent
8ef4a7fbbf
commit
93a9932358
@ -16,7 +16,9 @@ import androidx.compose.foundation.layout.navigationBars
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.text.selection.SelectionContainer
|
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.AlertDialog
|
import androidx.compose.material3.AlertDialog
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
@ -162,21 +164,12 @@ class SettingsDebugController : BasicComposeController() {
|
|||||||
CircularProgressIndicator()
|
CircularProgressIndicator()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result != null) {
|
|
||||||
AlertDialog(
|
ResultTextDialog(
|
||||||
onDismissRequest = { result = null },
|
result = result,
|
||||||
title = {
|
onDismissRequest = { result = null }
|
||||||
Text(text = result?.first.orEmpty())
|
|
||||||
},
|
|
||||||
confirmButton = {},
|
|
||||||
text = {
|
|
||||||
SelectionContainer {
|
|
||||||
Text(text = result?.second.orEmpty())
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
CircularProgressIndicator()
|
CircularProgressIndicator()
|
||||||
@ -184,6 +177,24 @@ class SettingsDebugController : BasicComposeController() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun ResultTextDialog(result: Pair<String, String>?, onDismissRequest: () -> Unit) {
|
||||||
|
if (result != null) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = onDismissRequest,
|
||||||
|
title = {
|
||||||
|
Text(text = result.first)
|
||||||
|
},
|
||||||
|
confirmButton = {},
|
||||||
|
text = {
|
||||||
|
SelectionContainer(Modifier.verticalScroll(rememberScrollState())) {
|
||||||
|
Text(text = result.second)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onActivityStopped(activity: Activity) {
|
override fun onActivityStopped(activity: Activity) {
|
||||||
super.onActivityStopped(activity)
|
super.onActivityStopped(activity)
|
||||||
router.popCurrentController()
|
router.popCurrentController()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user