title: How can I Remove/Hide an item in RecyclerView after '5' seconds?
body: <p>Basically I am having two question ...I think both answer have similar approach. That's why asking both.</p>
  <p>Part1-
  I am having a RecyclerView inside a Fragment whose items are having a countdown timer and are in ascending order of the time left. <strong>I want that after the countdown comes to Zero</strong>* (or better say, when the countdown time expires) The <em><strong>Recyclerview should wait</strong></em> <code>5 seconds</code> *<strong>holding the item at the top and then the Visiblity of the expired item should be invisible and the bottom item should replace its place</strong>...
  And it should be never be Visible after I start my app again.</p>
  <p>Part2-
  In this case I want  that the <strong>expired item should go down to <code>bottom of the queue</code> of items in the recylerview</strong>.</p>
  <p>Note that- notifyDataSetChanged() should work properly after this.</p>
  <p>Please help me I am trying to implement this since weeks but failing everytime.</p>
  <p><em>What I have tried is working but Whenever i open the app again or switch between fragments it shows the old Expired items, holds them for 5 seconds and then Hides them</em>.</p>
  <p>This is my onBindviewHolder Method-    [1]: <a href="https://i.stack.imgur.com/Rd0rR.png" rel="nofollow noreferrer">https://i.stack.imgur.com/Rd0rR.png</a> [![This is the dummy Recylerview With Timer][1]][1]</p>
  <pre><code>
      @Override
      public void onBindViewHolder(@NonNull Holder holder, int position) {
  
          UserDetail userDetail = UserArrayList.get(position);
          long timer = userDetail.getCategoryTime().toDate().getTime();
          Date today = new Date();
          final long currentTime = today.getTime();
          long expiryTime = timer - currentTime;
  
          new CountDownTimer(expiryTime, 1000) {
              public void onTick(long millisUntilFinished) {
                             //do something
                             }
  
              public void onFinish() {
  
  
                  holder.itemView.setEnabled(false);  
                  holder.ques_time_h.setText(&quot;Time up!&quot;);
                  
                  
     
  
                  Handler handler = new Handler();
                  handler.postDelayed(new Runnable() {
                      public void run() {
  holder.itemView.setVisibility(View.GONE); 
                          ViewGroup.LayoutParams params = holder.itemView.getLayoutParams();
                          params.height = 0;
  
                      }
                  }, 5000);
  
              }
          }.start();```
  
  </code></pre>