Skip to content
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

Hide Global/Header Footer when adapter is empty #36

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Redth
Copy link
Owner

@Redth Redth commented Apr 19, 2024

As described in #31 when the adapter is empty, the global header/footer (which are displayed in cells) overlap the empty view.

While the desired behaviour in some cases might be to make the emptyview fill the remaining space that the global header/footer do not occupy, the problem is the header/footer are implemented as cells in the list (so they scroll with the content of the list - if you didn't want them to scroll, you'd put them outside of the list anyway), so it would be challenging to make the empty view a cell which fills the remaining space.

This change instead hides the global header/footer if the adapter is empty, so that the empty view fills the entire space. If you really want the same global header/footer to appear when the adapter is empty, you can simply add them also to your empty view template (eg: use a grid with RowDefinitions="Auto,*Auto" where your header and footer are rows 0 and 2 and the middle view fills the remaining space.

As described in #31 when the adapter is empty, the global header/footer (which are displayed in cells) overlap the empty view.

While the desired behaviour in some cases might be to make the emptyview fill the remaining space that the global header/footer do not occupy, the problem is the header/footer are implemented as cells in the list (so they scroll with the content of the list - if you didn't want them to scroll, you'd put them outside of the list anyway), so it would be challenging to make the empty view a cell which fills the remaining space.

This change instead hides the global header/footer if the adapter is empty, so that the empty view fills the entire space.  If you really want the same global header/footer to appear when the adapter is empty, you can simply add them also to your empty view template (eg: use a grid with `RowDefinitions="Auto,*Auto"` where your header and footer are rows 0 and 2 and the middle view fills the remaining space.
@Redth Redth merged commit 9e51234 into main Apr 19, 2024
5 checks passed
@Redth Redth deleted the global-header-footer-hide-when-empty branch April 19, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant