Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Last active July 11, 2020 07:51
Show Gist options
  • Save MrCrambo/8e00e1ef1cf5ca0ca5978df27273c3a2 to your computer and use it in GitHub Desktop.
Save MrCrambo/8e00e1ef1cf5ca0ca5978df27273c3a2 to your computer and use it in GitHub Desktop.
...
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