-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Tabs] Fix tab indicator size #3336
[Tabs] Fix tab indicator size #3336
Conversation
Thanks for the PR! Can you explain what's the root cause of the issue and how the PR fixes it? |
Also, in the PR, |
6bf139b
to
431b7a3
Compare
The original implementation is kind of error-prone, therefore I'm a bit worried about just checking all children can introduce different unexpected bugs. Instead of that, for now can we fix this in a more conservative way? Like checking And if Let me know what you think. |
I don't think it's worth doing.
// #1 For custom view
TabView { CustomView() }
// #2 For icon and/or text (API 18+)
TabView { Icon(), Text() }
// #3 For icon and/or text (API 17-)
TabView {
FrameLayout(wrap_content, wrap_content) { Icon() },
FrameLayout(wrap_content, wrap_content) { Text() }
} The "PR" way and the "conservative" way will work the same in these cases, but the "PR" way will have a simpler implementation, it's more logically correct, and it's consistent with the behavior of a tab with a custom view set. |
The behavior is the same in the current happy flow, yes. : ) However clients can actually add any random view to a tab view, and the implementation of tab view might also changed in the future as well. If you insist, I can bring this to the internal review and see how the team thinks. |
This is unlikely, but even if so, the added views will become part of the |
431b7a3
to
9d2d6cc
Compare
Dan, can you provide your thoughts here? |
The fix seems reasonable to me, but I think we don't need it anymore now that the minSdkVersion is 19 for our library (and all androidx libraries). Closing the PR but feel free to comment or reopen if you feel it is still necessary. |
Fixes #3335