The app I\'m working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows:
To reset the scroll state, just get the AppBarLayout.Behavior object
CoordinatorLayout coordinator = (CoordinatorLayout) findViewById(R.id.coordinator);
AppBarLayout appbar = (AppBarLayout) findViewById(R.id.appbar);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appbar.getLayoutParams();
AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior();
and call onNestedPreScroll method manually:
int[] consumed = new int[2];
behavior.onNestedPreScroll(coordinator, appbar, null, 0, -1000, consumed);
If you would like to reset smoothly with an animation, you can try calling onNestedFling instead:
behavior.onNestedFling(coordinator, appbar, null, 0, -1000, true);