-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Fix margins in ListView #3281
base: ucr
Are you sure you want to change the base?
Fix margins in ListView #3281
Conversation
Fix for ListView.swift, issue mit-cml#3153
Can one of the admins verify this patch? |
85a61d8
to
90043d8
Compare
Why do I have 3 additional commits in this PR?
Did something go wrong or is this how it should be? |
@AppInventorWorkerBee ok to test |
@patryk84a It looks like because you used the Github-based merge (which creates a merge commit by default), your ucr branch got a bit out of sync with ours. Don't worry about this as we will squash merge this PR into a single commit once approved. |
What do I need to do to revert my fork's ucr branch to its original state for future reference? Because now it shows me it's in sync. |
@patryk84a Assuming you have git checkout ucr # switch to your local ucr branch
git fetch upstream # gets the latest MIT version
git reset --hard upstream/ucr # makes your local ucr point to the same commit as our ucr
git push -f origin ucr # force-push to reset the fork to match MIT and local Note that the use of the force push is only really necessary because they aren't in sync. If you keep the branches clean, then you can do: git checkout ucr
git pull --ff-only upstream ucr
git push # assuming your local ucr is set to track origin/ucr
git push origin ucr # otherwise... |
if (position == 0) { | ||
outRect.set(margins, margins, margins, margins); | ||
} else { | ||
outRect.set(0, margins, margins, margins); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I focused on margins, not paying attention to element widths. To fix this we need to set the element width. I also added a screen orientation listener to update widths after screen rotation. I also simplified the code for setting margins for vertical layout, removing lines of code that I had tested with Grid layout before.
General items:
ant tests
passes on my machineIf your code changes how something works on the device (i.e., it affects the companion):
ucr
ucr
as the baseFurther, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):
For all other changes:
master
master
as the baseWhat does this PR accomplish?
Description
There was no implementation for setting margins in the horizontal layout of ListView. Therefore, the horizontal layout displayed margins incorrectly, adjusting them as for the vertical layout.