I want a view containing a few buttons to disappear and appear when I slide recycleview as in the coordinator layout:
butthisiscurrentlyso,andithasnoanimation,justdisappearandappears:
Currentcode:
rv_noticas.addOnScrollListener(newRecyclerView.OnScrollListener(){@OverridepublicvoidonScrolled(RecyclerViewrecyclerView,intdx,intdy){super.onScrolled(recyclerView,dx,dy);y=dy;if(dy>0){Log.i(TAG,"onScrolled: " + "DOWN");
//layoutbotoes.setVisibility(View.GONE);
layoutbotoes.setVisibility(View.GONE);
} else {
Log.i(TAG, "onScrolled: " + "UP");
layoutbotoes.setVisibility(View.VISIBLE);
// Scrolling down
//layoutbotoes.setVisibility(View.VISIBLE);
}
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if(RecyclerView.SCROLL_STATE_IDLE ==newState){
// fragProductLl.setVisibility(View.VISIBLE);
if(y<=0){
layoutbotoes.setVisibility(View.VISIBLE);
}
else{
y=0;
layoutbotoes.setVisibility(View.GONE);
}
}
}
});