use of android.support.design.widget.BottomSheetBehavior.BottomSheetCallback in project Rocket by mozilla-tw.
the class TabTrayFragment method setupBottomSheetCallback.
private void setupBottomSheetCallback() {
BottomSheetBehavior behavior = getBehavior(recyclerView);
if (behavior == null) {
return;
}
behavior.setBottomSheetCallback(new BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
dismiss();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
slideCoordinator.onSlide(slideOffset);
}
});
}
Aggregations