Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

mLastStableState was not set on setState #43

Open
cesardeazevedo opened this issue Mar 31, 2017 · 5 comments
Open

mLastStableState was not set on setState #43

cesardeazevedo opened this issue Mar 31, 2017 · 5 comments

Comments

@cesardeazevedo
Copy link

Hi, thank you so much for this project.

I had a issue when setting state directly with setState, and it seems the mLastStableState was not set on this line: https://github.com/miguelhincapie/CustomBottomSheetBehavior/blob/master/app/src/main/java/co/com/parsoniisolutions/custombottomsheetbehavior/lib/BottomSheetBehaviorGoogleMapsLike.java#L563

What happens is when we set the state directly from expand to collapse, and starting dragging again, the bottom sheet makes a "hard jump" expanding like crazy, this happens on the sample project when we press the navigation close icon.

I've solved by moving the assignment out of the if (mViewRef == null) statement, but i'm still not sure about that, i just would like to point that, and hear this from you, and others who having this issue.

i am currently integrating this awesome project with react-native (react-native-bottom-sheet-behavior), but this isn't related though.

Thank you.

cesardeazevedo added a commit to cesardeazevedo/react-native-bottom-sheet-behavior that referenced this issue Apr 2, 2017
@michael-rapp
Copy link
Contributor

michael-rapp commented Apr 20, 2018

I encountered the same issue and the change proposed by @cesardeazevedo solved the problem. I did not notice any negative side effects so far.

@miguelhincapie
Copy link
Owner

ok, so I think we can close this issue right?

@michael-rapp
Copy link
Contributor

michael-rapp commented Apr 25, 2018

The fix works, yes. But it is not part of this repository, is it?

@cesardeazevedo
Copy link
Author

I think this should be definitely part of this repository, i just didn't created a pull request earlier because i wasn't sure of any side effects, but i haven't seen so far.

@michael-rapp would you mind to create a pull request?

michael-rapp added a commit to michael-rapp/CustomBottomSheetBehavior that referenced this issue Apr 29, 2018
@michael-rapp
Copy link
Contributor

michael-rapp commented Apr 29, 2018

I have created a pull request (#59) including the changes I used to solve this issue. My solution is slightly different from the one suggested by @cesardeazevedo as I think that the variables mState and mLastStableState should always be set together. As mentioned before, I did not encounter any regressions after applying this patch.

miguelhincapie added a commit that referenced this issue Jun 6, 2018
Fix for issue #43 "mLastStableState was not set on setState"
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants