@Override
public booleanonStartNestedScroll(finalCoordinatorLayout coordinatorLayout, finalFloatingActionButton child,
finalView directTargetChild, finalView target, final intnestedScrollAxes) {
// Ensure we react to vertical scrolling
returnnestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL
||super.onStartNestedScroll(coordinatorLayout,child,directTargetChild,target,nestedScrollAxes);
}
@Override
public voidonNestedScroll(CoordinatorLayout coordinatorLayout,FloatingActionButton child,
View target, intdxConsumed, intdyConsumed, intdxUnconsumed,
intdyUnconsumed) {
super.onNestedScroll(coordinatorLayout,child,target,dxConsumed,dyConsumed,dxUnconsumed,dyUnconsumed);
if(dyConsumed >0&& child.getVisibility() == View.VISIBLE) {
child.hide();
RxBus.getInstance().post(AppConstant.MENU_SHOW_HIDE,false);
}else if(dyConsumed <0&& child.getVisibility() != View.VISIBLE) {
RxBus.getInstance().post(AppConstant.MENU_SHOW_HIDE,true);
child.show();
}
}