title: Get maximum HorizontalScrollView scroll amount
body: <p>I'm adding floating arrows to my <code>HorizontalScrollView</code> which will let the user know that there are more item's outside of the current view.</p>
  
  <p>What I need is how to tell if the View has been scrolled to it's maximum. You would have thought the method <code>getMaxScrollAmount()</code> would give you this - it doesn't, in my code it gives me the width of the View. Go figure why. Here's my code - nice and simple:</p>
  
  <pre><code>    final ImageView leftArrow = (ImageView) toReturn.findViewById(R.id.leftArrow);
      final ImageView rightArrow = (ImageView) toReturn.findViewById(R.id.rightArrow);
  
      final HorizontalScrollView scrollView = (HorizontalScrollView) toReturn.findViewById(R.id.actionBarHoriztonalScroll);
  
  
      final GestureDetector gd = new GestureDetector(new SimpleOnGestureListener() {
          @Override
          public boolean onScroll(MotionEvent e1, 
                                  MotionEvent e2, 
                                  float distanceX, 
                                  float distanceY) {
              if(scrollView.getScrollX() == 0) {
                  leftArrow.setVisibility(View.GONE);
              } else {
                  leftArrow.setVisibility(View.VISIBLE);
              }
              if(scrollView.getScrollX() == scrollView.getMaxScrollAmount() ||
                  scrollView.getMaxScrollAmount() == 0) {
                  rightArrow.setVisibility(View.GONE);
              } else {
                  rightArrow.setVisibility(View.VISIBLE);
              }
  
              Log.v(ClientDetailsFragment.class.getSimpleName(), "max: " + scrollView.getMaxScrollAmount() +
                                                              "current: " + scrollView.getScrollX());
              return super.onScroll(e1, e2, distanceX, distanceY);
          }
      });
  
      scrollView.setOnTouchListener(new OnTouchListener() {
  
          @Override
          public boolean onTouch(View arg0, MotionEvent ev) {
              gd.onTouchEvent(ev);
              return false;
          }
      });
  </code></pre>
  
  <p>Output from the above debugging:</p>
  
  <pre><code>10-03 14:36:16.343: VERBOSE/(20508): max: 240 current: 126
  10-03 14:36:16.363: VERBOSE/(20508): max: 240 current: 127
  10-03 14:36:16.386: VERBOSE/(20508): max: 240 current: 132
  10-03 14:36:16.398: VERBOSE/(20508): max: 240 current: 143
  10-03 14:36:16.417: VERBOSE/(20508): max: 240 current: 149
  10-03 14:36:16.433: VERBOSE/(20508): max: 240 current: 152
  10-03 14:36:16.449: VERBOSE/(20508): max: 240 current: 152
  10-03 14:36:16.468: VERBOSE/(20508): max: 240 current: 152
  </code></pre>
  
  <p>(152 is the Max in this case)</p>