0
I want a view containing some buttons to disappear and appear when I slide the recycleview as in Coordinator layout:
but currently this way, and he has no animation, just fades and appears:
Current code:
rv_noticas.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
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);
}
}
}
});
Browse animations https://developer.android.com/guide/topics/graphics/prop-animation.html
– GabrielLocalhost