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

Scroll Group (Panning) #106

Open
appify-pro opened this issue Apr 8, 2021 · 8 comments
Open

Scroll Group (Panning) #106

appify-pro opened this issue Apr 8, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@appify-pro
Copy link

I have created a simple text box that displays perfectly in Android Studio, however when I turn the text box into a scroll group the text box does not display anymore after hot reload.

In XD I receive the following error:
1 Error:
[Scroll Group 1] Unable to create export node from none named 'ScrollableGroup'.

@appify-pro appify-pro added the bug Something isn't working label Apr 8, 2021
@gskinner
Copy link
Collaborator

We currently don't support ScrollableGroup in the plugin, though I would like to add support if the APIs are there to support it (I think they are now). I'll check if we can make a quick update to turn that into a warning and preserve the child content as an immediate fix for the impending next version, and look into proper support for the following version (which should follow fairly quickly).

@gskinner
Copy link
Collaborator

Ok. I've looked into this, but unfortunately it looks like XD's API for ScrollableGroup is incomplete in that it does not provide a way to access the dimensions of the scrolling content. For example, for a vertically scrolling list, .localBounds.height, .boundsInParent.height, and .viewport.viewportHeight all appear to the height of the viewport (cropped area). This seems like it's probably a bug, since there is no reason to replicate localBounds.height into viewport.

I'd expect a property like .viewport.contentHeight to exist. We could potentially work around this by iterating through every child and getting the union of their boundsInParent, but that seems like it should be unnecessary.

For now I have added a warning for scroll groups. Time permitting, I may add the iterative bounds calculation so we don't have to wait on Adobe to add this value. If that works out, I may be able to sneak in horizontal & vertical scrolling for the next version, but likely not panning (which requires a different Flutter output).

@gskinner
Copy link
Collaborator

Alright, I worked around the issues above by iteratively calculating the merged bounds, and then manually adjusting child positions based on the scroll offset (XD treats scrollable content as content that has moved, not as content that has been scrolled).

Horizontal and vertical scrolling now appear to be working well and will be in the next release. Panning should land in the following version.

@appify-pro
Copy link
Author

appify-pro commented Apr 19, 2021 via email

@appify-pro
Copy link
Author

appify-pro commented Apr 20, 2021

Hi Grant

Seems that your fix is working! Thank you!

@gskinner
Copy link
Collaborator

Just to confirm - are you testing the plugin built from source code? This feature isn't in the public plugin quite yet.

@gskinner
Copy link
Collaborator

gskinner commented May 3, 2021

Horizontal and vertical scroll groups shipped in v2.0.0, but I'd still like to add support for panning, so I'm going to leave this open.

@gskinner gskinner added enhancement New feature or request and removed bug Something isn't working labels May 3, 2021
@appify-pro
Copy link
Author

appify-pro commented May 5, 2021 via email

@gskinner gskinner changed the title Scroll Group Scroll Group (Panning) Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants