Thanks for this example.
Here is a suggestion. Since the normal way for AppBarLayout to behave is to scroll, it could be interesting for the bottom bar to behave the same. To get the view scrolling in and out instead of this animation, we can simply just translate it:
@Override
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, View child, View target, int dx, int dy, int[] consumed) {
float oldTranslation = child.getTranslationY();
float newTranslation = oldTranslation + dy;
if (newTranslation > child.getHeight()) {
child.setTranslationY(child.getHeight());
} else if (newTranslation < 0) {
child.setTranslationY(0);
} else {
child.setTranslationY(newTranslation);
}
}
A small gist of the same https://gist.github.com/snowpong/2a9eaf80d814c6938d55