Closed sebastianmarschall closed 1 year ago
Just noticed: same is the case when integrating as Fragment
Hey, sorry for the late reply :b
I will look into this issue soon, could you please provide some extra info?
Like the modifier
and/or parent you used would be helpful :)
hi @maik-mursall, thanks for your response. i tried it like suggested in the README:
setContent {
val xS2AWizardConfig = XS2AWizardConfig(
sessionKey = "your-session-key",
onFinish = ::onFinish,
onAbort = ::onAbort,
theme = XS2AThemeLight,
)
XS2AWizard(xS2AWizardConfig = xS2AWizardConfig)
}
Hey again, i managed to reproduce this issue and i think you could just set the maximum-/height for the wizard.
Like so:
XS2AWizard(
modifier = Modifier.heightIn(
max = LocalConfiguration.current.screenHeightDp.dp // Set the maximum height to the screen height
),
xS2AWizardConfig = xS2AWizardConfig
)
Or like so:
XS2AWizard(
modifier = Modifier.height(
LocalConfiguration.current.screenHeightDp.dp // Set the height to the screen height
),
xS2AWizardConfig = xS2AWizardConfig
)
Please let me know if this helps :)
Hi @maik-mursall,
yes that helped, thanks.
But:
It's still crashing when using the XS2AWizardFragment instead of Compose (since you are not adding the modifiers either). FYI: i'm adding it to a Fragments ChildFragmentManager, not in an Activity like your example - in case this makes any difference.
Even though it works for me now when using Compose, the scrolling behaviour is still unexpected. When scrolling in the XS2A wizard my Toolbar gets pushed off screen. My activity layout looks like this:
`
`
Where the Fragment only consists of the XS2AWizard composable.
Thanks again :)
Hey @sebastianmarschall, you're absolutely right, i will look into implementing a fix inside the SDK.
I will keep you updated :)
Hi again @sebastianmarschall, Unfortunately I'm certain that I cannot fix this issue on the SDK side, this unfortunately is a problem on the host-app.
As a further suggestion it would make more sense to set the maximum height of the parent anyway. You can do that in your layout file or I even recommend the usage of ConstraintLayouts for your use case. :)
Or in the case of Jetpack Compose to not set the maximum height of the wizard component and set the max height of the parent. This should be easily achieved with Modifier.fillMaxHeight()
.
Please let me know if you have further questions :).
I will close this Issue now due to inactivity.
Please reopen it if you have any further problems.
I get following exception when trying to add the XS2AWizard to my compose view:
java.lang.IllegalStateException: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.
SDK version: 3.4.2 Compose Version: 1.1.1