/** {@inheritDoc} */
 @Override
 public boolean onTouch(View v, MotionEvent event) {
   switch (event.getAction()) {
     case MotionEvent.ACTION_DOWN:
       mCarouselListener.onTouchDown();
       return true;
     case MotionEvent.ACTION_UP:
       mCarouselListener.onTouchUp();
       return true;
   }
   return super.onTouchEvent(event);
 }
  /** {@inheritDoc} */
  @Override
  protected void onScrollChanged(int x, int y, int oldX, int oldY) {
    super.onScrollChanged(x, y, oldX, oldY);

    // Guard against framework issue where onScrollChanged() is called twice
    // for each touch-move event. This wreaked havoc on the tab-carousel:
    // the
    // view-pager moved twice as fast as it should because we called
    // fakeDragBy()
    // twice with the same value.
    if (mLastScrollPosition == x) {
      return;
    }

    // Since we never completely scroll the about/updates tabs off-screen,
    // the draggable range is less than the width of the carousel. Our
    // listeners don't care about this... if we scroll 75% percent of our
    // draggable range, they want to scroll 75% of the entire carousel
    // width, not the same number of pixels that we scrolled.
    final int scaledL = (int) (x * mScrollScaleFactor);
    final int oldScaledL = (int) (oldX * mScrollScaleFactor);
    mCarouselListener.onCarouselScrollChanged(scaledL, y, oldScaledL, oldY);

    mLastScrollPosition = x;
    updateAlphaLayers();
  }
 /** {@inheritDoc} */
 @Override
 public boolean onInterceptTouchEvent(MotionEvent ev) {
   final boolean interceptTouch = super.onInterceptTouchEvent(ev);
   if (interceptTouch) {
     mCarouselListener.onTouchDown();
   }
   return interceptTouch;
 }