I want to implement such a thing in the tape: when you scroll through a couple of recyclerview news, the UP button appears (raise the tape up to the very beginning).

I know how to make a button, but I don’t know what check to put on the recyclerview !!! Could you tell?

  • one
    as an option via OnScrollListener - Maxim Kuznetsov
  • and then what check put? - sviter-pro

1 answer 1

Did so

recyclerview.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (dy > 0) { buttontop.setVisibility(View.VISIBLE); } if (dy < 0){ buttontop.setVisibility(View.GONE); } } });