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

Fix broken swipe distance when item width < recyclerView's width #951

Merged
merged 5 commits into from
Nov 30, 2020
Merged

Fix broken swipe distance when item width < recyclerView's width #951

merged 5 commits into from
Nov 30, 2020

Conversation

RobbWatershed
Copy link
Contributor

This time I'm fixing a broken swipe animation that happens when using a grid layout instead of a linear layout. The details are in the comment I left in the code.

Thanks~

PS : Sorry for the fragmented PR's, but I'm discovering issues step by step, as I'm extending my use of FastAdapter to create new features.

@mikepenz
Copy link
Owner

This still seems to have some strange behavior
device-2020-11-26-132303.mp4.zip

@RobbWatershed
Copy link
Contributor Author

RobbWatershed commented Nov 26, 2020

That can be explained :

  • Immobile items : You might not remember it, but SwipeListActivity and SwipeDrawerListActivity showcase the ability to set the "swipable" property individually. Hence line 92 of SwipeDrawerListActivity that says
swipeableItem.withIsSwipeable(i % 5 != 0)

that's why item 16 is blocked (16 being the 15th item in a 1-indexed list)

  • Weird button display when swiping right : That's due to the fact that the layout constraints defined in swipeable_drawer_item.xml haven't been designed with half the screen width in mind :
    • On the left side, the Archive and Share buttons have each a fixed width of 80dp
    • On the right side, the Delete button has a fixed width of 80dp

As a consequence, when the item only takes up half the screen width, the two buttons on the left and the button on the right overlap, which creates what you've seen. This is a layout issue that has nothing to do with the fix suggested in this PR.

I think the fix will be easier to check if you set .withSwipeRight(80) on line 112 of SwipeDrawerListActivity, which should allow to swipe right to the width of the Archive button only 😄

@mikepenz
Copy link
Owner

Thanks for mentioning these things again, but the main problem I actually see is, that I can't drag back to dismiss. it seems to not take the action. It works though with full width beautifully.

Can you also please try that one if it works for you fully?

@RobbWatershed
Copy link
Contributor Author

You're right, when using a two-column grid view, it takes multiple swipes to dismiss the view. I'm gonna investigate this.

@RobbWatershed
Copy link
Contributor Author

That's done ! There were two other issues I solved in today's batch.

PS : Not sure about how to solve the merge conflict myself...

@mikepenz
Copy link
Owner

Looks good :D thank you so much for the fixes

@mikepenz mikepenz merged commit f2235df into mikepenz:develop Nov 30, 2020
@mikepenz mikepenz added the fix label Nov 30, 2020
@RobbWatershed
Copy link
Contributor Author

Looks good :D thank you so much for the fixes
Neat !!

I'm gonna do some research on the differ and the loading system, as I'm facing crashes on certain devices (~4% of my users). Stay tuned for more discussions / PRs...

@mikepenz
Copy link
Owner

@RobbWatershed thanks a ton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants