title: On collapsing actionbar search recyclerview moves to bottom of screen
body: <p>So the problem is,</p>
  
  <p>When Actionbar searchitem expands recyclerview appears to be correct but as i click back button on searchitem it collapse and recyclerview moves to bottom of screen automatically as shown in below images  </p>
  
  <p>Screen 1: When i click on search item of actionbar  </p>
  
  <p><a href="https://i.stack.imgur.com/ZSsIu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZSsIu.png" alt="enter image description here"></a>  </p>
  
  <p>Screen 2: When i click on back button of search item  </p>
  
  <p><a href="https://i.stack.imgur.com/kGfbs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kGfbs.png" alt="enter image description here"></a>  </p>
  
  <p>Screen 3: When i try to scroll recyclerview it moves automatically to bottom  </p>
  
  <p><a href="https://i.stack.imgur.com/PyQ8j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PyQ8j.png" alt="enter image description here"></a>  </p>
  
  <p>I am using following libraries    </p>
  
  <pre><code>compile 'com.android.support:appcompat-v7:22.2.0'  
  
  compile 'com.android.support:design:22.2.0'  
  
  compile 'com.android.support:recyclerview-v7:22.2.0'  
  </code></pre>
  
  <p>I am using following fragment layout  <strong>clinic_fragment.xml</strong></p>
  
  <pre><code>&lt;android.support.v7.widget.RecyclerView
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/my_recycler_view"
  
      android:scrollbars="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffffff"
      &gt;
      &lt;/android.support.v7.widget.RecyclerView&gt;  
  </code></pre>
  
  <p>My <strong>onCreateView()</strong> method of fragment class  </p>
  
  <pre><code>  @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          Bundle arguments = getArguments();
          int pageNumber = arguments.getInt(ARG_PAGE);
          RecyclerView recyclerView = (RecyclerView) inflater.inflate(R.layout.fragment_clinic,container,false);
          recyclerView.setAdapter(new YourRecyclerAdapter(getActivity()));
          recyclerView.setLayoutManager(/*new LinearLayoutManager(getActivity())*/new GridLayoutManager(getActivity(),4, LinearLayoutManager.VERTICAL,false));
          return recyclerView;
      }    
  </code></pre>
  
  <p>My <strong>activity</strong> layout:  </p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/root_coordinator"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/app_bar_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/app_bar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
              app:layout_scrollFlags="scroll|enterAlways"
               /&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tab_layout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@color/colorAccent"
              app:tabIndicatorColor="@color/colorPrimary"
              app:tabSelectedTextColor="@android:color/white"
              app:tabTextColor="#EEE" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/view_pager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>Please Note :</strong> </p>
  
  <p>This problem can be solved by removing <code>android:scrollbars="vertical"</code> from <code>RecyclerView</code>  but i want to show scrollbar on scroll hence i can not remove it.  </p>
  
  <p>Please help out and thanks</p>