title: RecyclerView: Disable scrolling caused by change in focus
body: <p><strong>TL;DR</strong> I have a <code>RecyclerView</code> of <code>EditText</code>s. When the user is focused on <code>EditText #1</code> and taps on <code>EditText #2</code>, I want <code>EditText #2</code> to get focus but I don't want the <code>ReyclerView</code> to scroll. How can I achieve this?</p>
  
  <hr>
  
  <p>I'm trying to work with a <code>RecyclerView</code> populated with a bunch of <code>EditText</code>s. When I'm focused on one <code>EditText</code> and I click on another, the <code>RecyclerView</code> scrolls so that the second is at the top of the screen. I want to disable this auto-scrolling from the <code>RecyclerView</code>, but I still want the user to be able to scroll, and I still want the second <code>EditText</code> to be focused on so the user can start typing. How can I achieve this?</p>
  
  <p>I've already tried the following solutions:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/a/8101614/4077294">https://stackoverflow.com/a/8101614/4077294</a>, but with a <code>RecyclerView.OnItemTouchListener</code>. I called <code>recyclerView.requestFocusFromTouch</code> in <code>onInterceptTouchEvent</code>.</p>
  
  <ul>
  <li><strong>Behavior:</strong> Scrolled to the top of the tapped <code>EditText</code> all the time.</li>
  </ul></li>
  <li><p>Clearing the focus from any <code>EditText</code> whenever it was focused on, via</p>
  
  <pre><code>editText.setOnFocusChangeListener(new OnFocusChangeListener() {
      @Override
      public void onFocusChange(View v, bool hasFocus) {
          if (hasFocus) {
              v.clearFocus();
          }
      }
  });
  </code></pre>
  
  <ul>
  <li><strong>Behavior:</strong> The keyboard never showed up, and the <code>RecyclerView</code> still scrolled to the top.</li>
  </ul></li>
  </ul>
  
  <p>Disabling scrolling altogether as in <a href="https://stackoverflow.com/questions/30531091/how-to-disable-recyclerview-scrolling">this question</a> is not acceptable because I still want the user to be able to scroll.</p>