title: How to hide TextView and only show when scrolled
body: <p>I have a ScrollView and GridView in it, I want to put a TextView on top of GridView but it must not be seen until user scrolls to it. I thought about negative margins but I couldn't find a solution how to use scroll to get this view when on negative margin. </p>
  
  <p>So basicaly : 
  The only seen thing should be gridView, but when user is on top of gridView and pulls up, he should see a TextView.</p>
  
  <p>edit:
  the whole point of this is that I want to made pull-to-refresh out of this. I don't want to use popular on the internet libary because it doesn't work way I want. </p>
  
  <p><strong>EDIT 2:</strong> </p>
  
  <p>I got the answer but it is not fully what I try to achieve. 
  I want to smoothly show hidden TextView (just like in pull-to-refresh solutions) and setVisibility makes it quick and without any smoothnes.
  Here is my code : </p>
  
  <p>XML :</p>
  
  <pre><code>&lt;com.tas.android.quick.ui.controls.LockableScrollView
          android:id="@+id/scrollView"
          android:fillViewport="true"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="vertical" &gt;
  
              &lt;TextView 
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:id="@+id/pullText"
                  android:text="some text" /&gt;
  
              &lt;com.tas.android.quick.ui.controls.ExpandableGridView
                  android:id="@+id/gridview"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_centerInParent="true"
                  android:clipToPadding="false"
                  android:drawSelectorOnTop="true"
                  android:fadingEdge="none"
                  android:gravity="top"
                  android:horizontalSpacing="@dimen/image_grid_hspacing"
                  android:listSelector="@drawable/selector_shadow"
                  android:numColumns="@integer/grid_num_cols"
                  android:paddingBottom="50dp"
                  android:scrollbarAlwaysDrawVerticalTrack="false"
                  android:scrollbars="none"
                  android:scrollingCache="true"
                  android:smoothScrollbar="false"
                  android:stretchMode="columnWidth"
                  android:verticalSpacing="@dimen/image_grid_vspacing"
                  android:visibility="visible" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/com.tas.android.quick.ui.controls.LockableScrollView&gt;
  </code></pre>
  
  <p>and code:</p>
  
  <pre><code>textview = (TextView) findViewById(R.id.pullText);
          textview.setVisibility(View.VISIBLE);
  
          scrollView = (LockableScrollView) findViewById(R.id.scrollView);
  
          scrollView.setScrollingEnabled(false);
  
  ...
  
  gridView.setOnScrollListener(new OnScrollListener() {
                          @Override
                          public void onScrollStateChanged(AbsListView view, int scrollState) {
                              switch(scrollState) {
                              case 2: // SCROLL_STATE_FLING 
                                  //hide button here
                                  textview.setVisibility(View.VISIBLE);
                                  break;
  
                              case 1: // SCROLL_STATE_TOUCH_SCROLL 
                                  //hide button here
                                  textview.setVisibility(View.GONE);
                                  break;
  
                              case 0: // SCROLL_STATE_IDLE 
                                  //show button here
                                  textview.setVisibility(View.GONE);
                                  break;
                              }
                          }
  
                          @Override
                          public void onScroll(AbsListView view, int firstVisibleItem,
                                  int visibleItemCount, int totalItemCount) {
                                  }
                              }
                          }
                      });
  </code></pre>