-
Notifications
You must be signed in to change notification settings - Fork 223
Make sure HeaderFooterPage can contents be scrolled #4704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
22bd75e
9586102
af52512
668838a
2932242
33db77f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,14 @@ package io.element.android.libraries.designsystem.atomic.pages | |
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.IntrinsicSize | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.calculateEndPadding | ||
import androidx.compose.foundation.layout.calculateStartPadding | ||
import androidx.compose.foundation.layout.consumeWindowInsets | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.imePadding | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.rememberScrollState | ||
|
@@ -94,17 +96,19 @@ fun HeaderFooterPage( | |
.run { | ||
if (isScrollable) { | ||
verticalScroll(rememberScrollState()) | ||
// Make sure the scrollable content takes the full available height | ||
.height(IntrinsicSize.Max) | ||
} else { | ||
Modifier | ||
} | ||
} | ||
// Apply insets here so if the content is scrollable it can get below the top app bar if needed | ||
.padding(contentInsetsPadding) | ||
.weight(1f), | ||
.weight(1f, fill = true), | ||
) { | ||
// Header | ||
header() | ||
Box(modifier = Modifier.weight(1f)) { | ||
Box { | ||
content() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should add some padding between the footer and the content? This looks a bit weird without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... maybe, but maybe that should be added for the content on each screen? Otherwise we need to remember we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ganfra just to remind you of this question: should we add a default padding for all screens and then diff with the designs or leave it at 0 and just apply the padding to each content component so it matches the designs 1:1? |
||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FocusRequester
is not enough?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That made the textfield visible, but only half of it (the other half was under the IME).