title: RecyclerView onDrawOver view disappear after scroll
body: <p>I want to display a View (example <code>TextView</code>) over the <code>RecyclerView</code> after scroll to a position (example: 3) so I use</p>
  
  <pre><code>public class HeaderItemDecoration extends RecyclerView.ItemDecoration {
  
      @Override
      public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
          super.onDrawOver(c, parent, state);
          int topChildPosition = parent.getChildAdapterPosition(parent.getChildAt(0));
  
          if(topChildPosition == 3) {
              Log.i("TAG", "draw header");
              TextView textView = new TextView(parent.getContext());
              textView.setText("bbdasdasd");
              textView.setBackgroundColor(Color.RED);
              textView.layout(0, 0, 100, 100);
              drawText(c, textView);
          }
      }
  
      private void drawText(Canvas c, View header) {
          c.save();
          c.translate(0, 0);
          header.draw(c);
          c.restore();
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>mRecyclerView.addItemDecoration(new HeaderItemDecoration());
  </code></pre>
  
  <p>I work but the problem is this <code>TextView</code> will gone if I continue scroll. How to make this View always visible after I draw it? Any help or suggestion would be great appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/8SVf0.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8SVf0.gif" alt="enter image description here"></a></p>