title: HorizontalScrollView with arrows
body: <p>I'm trying to make a scrollable horizontal menu using HorizontalScrollView using the layout shown below. The menu is scrollable using the previous/next arrow buttons or on fling. When the HorizontalScrollView reach one end I'd like the arrow at the same end to be hidden (in the image shown below I'd like the left arrow to be hidden).</p>
  
  <p>How can I detect that the HorizontalScrollView has reached an end?</p>
  
  <p>Thanks</p>
  
  <p><img src="https://i.stack.imgur.com/oTOBt.png" alt="enter image description here"></p>
  
  <pre><code>&lt;RelativeLayout android:background="@drawable/bg_home_menu"
      android:layout_width="fill_parent" android:layout_height="45dp"&gt;
      &lt;ImageView android:id="@+id/previous" android:src="@drawable/arrow_l"
          android:layout_height="14dp" android:layout_width="10dp"
          android:layout_alignParentLeft="true"
          android:layout_centerVertical="true" /&gt;
  
      &lt;ImageView android:id="@+id/next" android:src="@drawable/arrow_r"
          android:layout_height="14dp" android:layout_width="10dp"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true" /&gt;
  
      &lt;HorizontalScrollView android:id="@+id/horizontalScroll"
          android:layout_width="fill_parent" android:layout_height="fill_parent"
          android:scrollbars="none" android:fadingEdgeLength="30dp" android:layout_toLeftOf="@id/next"
          android:layout_toRightOf="@id/previous" &gt;
  
          &lt;LinearLayout android:id="@+id/home_menu"
              android:orientation="horizontal" android:layout_width="wrap_content"
              android:layout_height="fill_parent" android:gravity="center_vertical"&gt;
  
              &lt;Button android:id="@+id/btn_home" android:background="@drawable/btn_home_menu_on"
                  android:layout_height="35dp" android:layout_width="wrap_content" android:focusable="true"
                  android_clickable="false" android:text="@string/menu_home" android:textColor="#FFFFFF" android:tag="-1"/&gt;
  
              &lt;!-- More are added dynamically --&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/HorizontalScrollView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>