Hide Global/Header Footer when adapter is empty #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.