以下は私のコードです
NestedScroll のスクロールで RelativeLayoput を隠したい
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);
}
}
});