bumble-tech / appyx

Model-driven navigation + UI components with gesture control for Compose Multiplatform
https://bumble-tech.github.io/appyx/
Apache License 2.0
1.13k stars 62 forks source link

Only add top padding if there's actually a back button #254

Open zsoltk opened 2 years ago

zsoltk commented 2 years ago

The current logic in SamplesContainerNode means there's always a 40.dp top padding – even on elements without a back button, and even on the samples list itself.

The padding should only be applied to the child which corresponds to the NavTarget with showBackButton == true.

LachlanMcKee commented 2 years ago

I did that deliberately originally.

If you have different padding values the screen transitions don't look great. if you come up with a solution for that, please keep that in mind when switching between screens.

zsoltk commented 2 years ago

I think I know what you mean – there's a visual "jump" if we change the padding value. But if we only apply the padding on the needed element rather than the container, this shouldn't happen, no?

LachlanMcKee commented 2 years ago

yeah, a visual jump! that rings a bell. Yes, if we add it to the element it should hopefully fix the problem