Is there a way to programmatically scroll to the top of a NestedScrollView by also triggering the scroll events for the parent? smoothScrollTo(x, y)
You could easily fake the scrolling on NestedScrollView level. You basically tell the coordinatorLayout that you just scrolled by the height of the toolbar.
NestedScrollView nestedScrollView = (NestedScrollView) getActivity().findViewById(R.id.your_nested_scroll_view);
int toolbarHeight = getActivity().findViewById(R.id.toolbar).getHeight();
nestedScrollView.startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL);
nestedScrollView.dispatchNestedPreScroll(0, toolbarHeight, null, null);
nestedScrollView.dispatchNestedScroll(0, 0, 0, 0, new int[]{0, -toolbarHeight});
nestedScrollView.scrollTo(0, nestedScrollView.getBottom());