-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[BottomSheetBehavior] Check for shouldSkipHalfExpandedWhenDragging
after nested scrolling
#2876
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
base: master
Are you sure you want to change the base?
[BottomSheetBehavior] Check for shouldSkipHalfExpandedWhenDragging
after nested scrolling
#2876
Conversation
… nested scrolling implementation Make `onStopNestedScroll` check to `shouldSkipHalfExpandedWhenDragging` before trying to set it's state to `STATE_EXPANDED`. This prevents the STATE_EXPANDED state from appearing even when `shouldSkipHalfExpandedWhenDragging` is set to true.
shouldSkipHalfExpandedWhenDragging
after nested scrolling
lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java
Outdated
Show resolved
Hide resolved
lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java
Outdated
Show resolved
Hide resolved
Clean up nested ifs in onStopNestedScroll where an OR would suffice.
Okay, simplified those if statements @drchen. |
Completely forgot about this PR. Any updates on this too? @drchen |
We found some problems during the internal review. I need to take more time to understand the relevant logic and figure out what's the cause. : ) |
Could you elaborate on the issue @drchen? I'm using this fix in my app, so it might affect me. Also, if I know the issue, I could try to figure it out on my end. |
My teammate patched and tested the PR and said: """ Haven't really got time to check it yet. |
Oh yeah, I already know about that bug @drchen. It was present before my fix (Discovered it while trying to fit the bottom sheet into my app), and I'm really not sure what the point behind that function was. I could go look into it and try to remove that function. Could I append it to this PR or should I go and make a new one? |
Any updates here @drchen? Should I make another PR to remove |
Hi the change is pretty difficult to land the change due to all the corner cases we found during running internal tests. I'll need a less busy timespan to go back working on this. Sorry for the long delay. |
@OxygenCobalt if Ive to use it in my app, can you refer me here? |
Sorry for taking awhile to respond @hellosagar. I don't really mind if you copy this changeset into your own vendored bottom sheet. Give credit if you want to be nice. |
Make
BottomSheetBehavior
check the experimentalshouldSkipHalfExpandedWhenDragging
flag before setting the state toHALF_EXPANDED
.The code changes the following behaviors in
onStopNestedScroll
:dy > 0
, the state will be set toSTATE_EXPANDED
instead ofSTATE_HALF_EXPANDED
when the flag is enabled.dy == 0
, the state will be set toSTATE_EXPANDED
when above the half-expanded offset, andSTATE_COLLAPSED
when below it when the flag is enabled.dy < 0
, the state will be set toSTATE_COLLAPSED
instead ofSTATE_HALF_EXPANDED
when the flag is enabled.Please let me know if the behavior here should be tweaked. It was difficult to understand the logic of the method so I may have made a mistake.
Also see #2874.