I used NestedScrollView with CoordinatorLayout to enable scroll animation for Toolbar (by app:layout_scrollFlags=\"scroll|enterAlways\").
NestedScrollView contain th
It is a Bug mention at Google #issues 194398.
Just need to use this WorkaroundNestedScrollView.java class which extends NestedScrollView like,
WorkaroundNestedScrollView.java
public class WorkaroundNestedScrollView extends NestedScrollView {
public WorkaroundNestedScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
// Explicitly call computeScroll() to make the Scroller compute itself
computeScroll();
}
return super.onInterceptTouchEvent(ev);
}
}
And in yourlayout use it like this,
layout.xml
...
...
You can alson find more details here.