Exemplo n.º 1
0
 @Override
 protected void onScrollChanged(int l, int t, int oldl, int oldt) {
   super.onScrollChanged(l, t, oldl, oldt);
   if (mListener != null) {
     mListener.onScrollChanged(l, t, oldl, oldt);
   }
 }
 @Override
 protected void onScrollChanged(int x, int y, int oldX, int oldY) {
   super.onScrollChanged(x, y, oldX, oldY);
   if (scrollListener != null) {
     scrollListener.onScrollChanged(x, y);
   }
 }
Exemplo n.º 3
0
 @Override
 public void scrollTo(int x, int y) {
   // TODO Auto-generated method stub
   super.scrollTo(x, y);
   if (null != sListener) {
     sListener.onOffsetChanged(getScrollX());
   }
   postInvalidate();
 }
  private void onCourseListScrollChanged(int scrollY) {
    if (onScroll != null) {
      onScroll.handle(courseList, scrollY);
    }

    // Animate tab elevation depending on the scroll distance.
    float maxElevation = ViewUtils.dpToPx(this, TAB_SCROLL_ELEVATION);
    float elevationDistance = ViewUtils.dpToPx(this, TAB_SCROLL_ELEVATION_DISTANCE);
    float elevationAmount = Math.min(elevationDistance, scrollY) / elevationDistance;
    float elevation = maxElevation * elevationAmount;
    tabs.setElevation(elevation);
  }