how to detect the position of the scroll nestedscrollview android at the bottom?

Set setOnScrollChangeListener in a NestedScrollView params to get NestedScrollView v (parent with scroll) int scrollY int oldScrollY To detect whether the offset is at the bottom, it is necessary to obtain the value of content height v.getChildAt(0).getMeasuredHeight() and compare the current scroll over the height of the parent, if you have the same value , … Read more

NestedScrollView’s smoothScrollTo() behaves weird

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(); }

Android – NestedScrollView which contains ExpandableListView doesn’t scroll when expanded

You can use NonScrollExpandableListView you can achieve non-scroll property of any Lisview or GridView or ExpandableListView by overriding following method. @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec( Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom); ViewGroup.LayoutParams params = getLayoutParams(); params.height = getMeasuredHeight(); } So for using NonScrollExpandableListView you need to make one … Read more

Pagination not work for the RecyclerView within NestedScrollView

Follow this steps : 1. Set nested scrolling enabled false of recycler view. recyclerView.setNestedScrollingEnabled(false); 2. Add scroll listner to nested scrollview. mScrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { @Override public void onScrollChanged() { View view = (View)mScrollView.getChildAt(mScrollView.getChildCount() – 1); int diff = (view.getBottom() – (mScrollView.getHeight() + mScrollView .getScrollY())); if (diff == 0) { // your pagination code } } … Read more