Last active
July 11, 2020 07:51
-
-
Save MrCrambo/8e00e1ef1cf5ca0ca5978df27273c3a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { | |
@Override | |
public void onStateChanged(View view, int i) { | |
// .. | |
// your code is here | |
} | |
@Override | |
public void onSlide(View view, float v) { | |
// .. | |
// animating the view on top of Bottom Sheet | |
yourView.animate().y(v <= 0 ? | |
view.getY() + mSheetBehavior.getPeekHeight() - yourView.getHeight() : | |
view.getHeight() - yourView.getHeight()).setDuration(0).start(); | |
} | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment