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

Android: make ScrollContainer use correct widget for viewport #1619

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Oct 18, 2022

Fixes #1604.

The reason this issue appeared in dev36 was because of #1507. Before that, the widget passed to AndroidViewport was only used to get at the Resources object, so all viewports were the same size: a rather unreliable estimate of the size of the whole window. #1507 changed AndroidViewport to return the dimensions of the widget that was passed to it.

So this PR fixes ScrollContainer to create its viewport from the container, not the content.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@mhsmith
Copy link
Member Author

mhsmith commented Oct 18, 2022

This fixes the case where the ScrollContainer is the top-level widget in the window. But where the ScrollContainer is contained within a Box, there's a separate issue which also affects other platforms (#1624).

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually this makes sense; however, I'm not seeing any behavior change from screenshot provided in #1604:

Screen Shot 2022-10-18 at 7 08 58 am

Is there a behavioral change that I'm not seeing?

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/me facepalms.

When you're testing code, it helps to actually use the code you're testing.

Looks good to me.

@freakboy3742 freakboy3742 merged commit 975b2a1 into beeware:main Oct 18, 2022
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.

Scroll container not expanding to width of container
2 participants