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

Enhancement - Remove clip path on drag end #1

Merged
merged 2 commits into from Nov 2, 2021

Conversation

mvk059
Copy link
Contributor

@mvk059 mvk059 commented Nov 2, 2021

✍️ Existing behaviour

Whenever the user drags on the screen, the internal body part is shown. But when the user stops the drag, the clipped circle path stays on the screen.

💡 Suggested Feature

When the user stops dragging on the screen, the clipped path is removed and the original body image is shown.

📝 Changes

In the detectDragGestures method, the scannedOffset and circleRadius properties have been set accordingly.

@V9vek
Copy link
Owner

V9vek commented Nov 2, 2021

Hey @mvk059
Thanks for this feature 😉 and raising the PR
I will review it and get back to you.

detectDragGestures { change, _ ->
detectDragGestures(
onDragStart = { offset ->
scannedOffset = offset
Copy link
Owner

@V9vek V9vek Nov 2, 2021

Choose a reason for hiding this comment

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

I reviewed it and found that line 50 is unnecessary as we are updating the scanned offset in the lambda function also

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@V9vek I've updated to code to remove the unnecessary assignment

Copy link
Owner

Choose a reason for hiding this comment

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

okay thanks for the changes

circleRadius = 300f
},
onDragEnd = {
scannedOffset = Offset.Zero
Copy link
Owner

@V9vek V9vek Nov 2, 2021

Choose a reason for hiding this comment

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

same for line 54 as you are making the circle radius = 0 inside onDragEnd, then we should not change the offset of the scanned circle as it will disappear automatically, you getting me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@V9vek I've updated to code to remove the unnecessary assignment

Copy link
Owner

@V9vek V9vek left a comment

Choose a reason for hiding this comment

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

Can you look at these changes I mentioned and let me know

@mvk059 mvk059 requested a review from V9vek November 2, 2021 15:07
@mvk059
Copy link
Contributor Author

mvk059 commented Nov 2, 2021

Please check now. I've updated the code.

@V9vek
Copy link
Owner

V9vek commented Nov 2, 2021

Please check now. I've updated the code.

Okay thanks, now things are fine
Merging the PR
Thanks for the PR 😉

@V9vek V9vek closed this Nov 2, 2021
@V9vek V9vek reopened this Nov 2, 2021
@V9vek V9vek merged commit 7c258a4 into V9vek:master Nov 2, 2021
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.

None yet

2 participants