-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(android): fix global header/footer title in ListView #14160
Conversation
@prashantsaini1 Can you please take a look? |
I'll take a look at it this week, but I feel this can be resolved using |
Keep in mind the view is only there as a fallback when you don't have any items, so a ListView with only a ListView header. As soon as you have items it will be overwritten with those anyways. |
I have been checking it currently and found that this fix is a temporary hack. Checking further for a proper fix. |
Found the issue:
Fix:
|
If you actually meant to take over the entire width, just like in your earlier fix screenshot, then |
Actually when we set the headerTitle and footerTitle, it should rather wrap itself than occupying the whole width. The only issue I see here is that it's in centre than on left. |
Tried multiple stuffs, could make them render to left but not full width. These titles' For long term I suggest two options:
|
Sounds like a good plan 👍 As mentioned before: this is was never reported by anyone so far. I just saw this issue in the test suite as most people have items in their listviews or use headerViews (because of the reasons you've described). |
@prashantsaini1 Can you please review this and approve if matching? |
I have tested the proper fix today for this issue with some further improvements. Opening a new PR soon. |
@m1ga Here is the fresh PR with all required changes. The first commit in new PR is the actual fix of the problem we discussed here. @hansemannn cc. |
closing in favor of #14175 |
Issue
I don't think it is widely used but you can add a
headerTitle
/footerTitle
in the ListView instead of the ListSection. When I was working on the test suite PR (#14158) I saw that that test was failing.12.6.1.GA:
The issue is that the
content
section has no view (as it is just the global headerTitle, so it doesn't have items) and that messes up the constraints. The "global header view" is visible as it creates a view.Fix
As I don't know at this point which kind of headerTitle (section or global) I just check if there are views inside the
content
section. If not I create an empty view and add it. That will keep the constraints workingTest