0

Following is my code

Now I want to hide RelativeLayoput On Scroll of NestedScroll I did it but view fluctuating with this : requestLayout() improperly called by android.widget.RelativeLayout{4f3557b V.E..

nestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
        @Override
        public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
            Log.d("ScrollView", "scrollX : " + scrollX + " oldScrollX :" + oldScrollX + " scrollY :" + scrollY + " oldScrollY :" + oldScrollY);
            if (scrollY > oldScrollY +20) {
                if(relativeLayout.getVisibility()==View.VISIBLE && isTimerStart )
                relativeLayout.setVisibility(View.GONE);
            } else {
                if(relativeLayout.getVisibility()==View.GONE && isTimerStart)
                relativeLayout.setVisibility(View.VISIBLE);
            }

        }
    });
Rajesh Gauswami
  • 528
  • 6
  • 20

0 Answers0