title: Hide only the Action bar on Scroll not action bar tabs
body: <p>I am getting an issue at trying to hide the action bar while scrolling down.Then while scrolling up,the action bar have to shown again.</p>
  
  <p><strong>For Eg:</strong></p>
  
  <p>I referred this <a href="http://www.techrepublic.com/article/pro-tip-maximize-android-screen-real-estate-by-showing-and-hiding-the-action-bar/" rel="nofollow noreferrer">Tutorial</a>.Here you can see the output and respective codes related to hide and show the action bar.</p>
  
  <p>I am showing the <strong>output</strong> what I get it till now.</p>
  
  <p><img src="https://i.stack.imgur.com/fFd1t.png" alt="enter image description here"></p>
  
  <p><strong>After scrolling down:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/FRFsQ.png" alt="enter image description here"></p>
  
  <p>The screenshot above shown, it hide the action bar tab also.But it have to hide only the action bar.That's the major issue.</p>
  
  <p><strong>After scrolling up:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/dPxz8.png" alt="enter image description here"></p>
  
  <p>The screenshot above shows it displays back the action bar with tabs.</p>
  
  <p><strong>TopRatedFragment.java:</strong></p>
  
  <pre><code>import info.androidhive.tabsswipe.R;
  import android.app.ActionBar;
  import android.content.res.TypedArray;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.ViewTreeObserver;
  import android.view.Window;
  import android.widget.ScrollView;
  
  public class TopRatedFragment extends Fragment implements ViewTreeObserver.OnScrollChangedListener {
  
      private float mActionBarHeight;
      private ActionBar actionBar;
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.fragment_top_rated, container, false);
  
          final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes(
                  new int[] { android.R.attr.actionBarSize });
          mActionBarHeight = styledAttributes.getDimension(0, 0);
          styledAttributes.recycle(); 
          actionBar = getActivity().getActionBar();  
  
  
  
          ((ScrollView)rootView.findViewById(R.id.parent)).getViewTreeObserver().addOnScrollChangedListener(this);
  
  
          return rootView;
      }
  
  
      @Override
      public void onScrollChanged() {
  
          float y = ((ScrollView)getActivity().findViewById(R.id.parent)).getScrollY();
          if (y &gt;= mActionBarHeight &amp;&amp; actionBar.isShowing()) {
              actionBar.hide();
          } else if ( y==0 &amp;&amp; !actionBar.isShowing()) {
              actionBar.show();
          }
      }
  }
  </code></pre>
  
  <p><strong>fragment_top_rated.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/parent"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;LinearLayout
              android:id="@+id/linearLayout1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
                android:paddingTop="?android:attr/actionBarSize" 
              android:orientation="vertical" &gt;  
  
              &lt;Button
                  android:id="@+id/button1"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="Button" /&gt;
  
              &lt;Button
                  android:id="@+id/button5"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="Button" /&gt;
  
                 .
                 .
      &lt;/LinearLayout&gt;
  
      &lt;/ScrollView&gt;
  </code></pre>
  
  <p>My issue is, While scrolling down it only have to hide the action bar only not action bar tabs.</p>