Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save virendersran01/302df0b9e798171c3c83a8d51f90b055 to your computer and use it in GitHub Desktop.
Save virendersran01/302df0b9e798171c3c83a8d51f90b055 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