What I am trying to achieve is to scroll to scroll_position_1 when tab1 (and so on) is clicked like this. I don\'t understand what\'s happening at
Looks like there is a bug when programmatically scrolling NestedScrollView within CoordinatorLayout. This solved my problem:
private void scrollToView(final View view) {
mScroller.scrollBy(0, 1);
mScroller.smoothScrollTo(0, view.getTop());
}
or for better control:
private void scrollToView(final View view) {
mScroller.scrollBy(0, 1);
ObjectAnimator.ofInt(mScroller, "scrollY", view.getTop()).setDuration(700).start();
}