Tabnine Logo
RecyclerView$SmoothScroller$Action.update
Code IndexAdd Tabnine to your IDE (free)

How to use
update
method
in
android.support.v7.widget.RecyclerView$SmoothScroller$Action

Best Java code snippets using android.support.v7.widget.RecyclerView$SmoothScroller$Action.update (Showing top 16 results out of 315)

origin: facebook/litho

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
 int[] snapDistances =
   calculateDistanceToFinalSnap(mRecyclerView.getLayoutManager(), targetView);
 final int dx = snapDistances[0];
 final int dy = snapDistances[1];
 final int time = calculateTimeForDeceleration(Math.max(Math.abs(dx), Math.abs(dy)));
 if (time > 0) {
  action.update(dx, dy, time, mDecelerateInterpolator);
 }
}
origin: Ramotion/garland-view-android

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  int[] snapDistances = calculateDistanceToFinalSnap(mRecyclerView.getLayoutManager(),
      targetView);
  final int dx = snapDistances[0];
  final int dy = snapDistances[1];
  final int time = calculateTimeForDeceleration(Math.max(Math.abs(dx), Math.abs(dy)));
  if (time > 0) {
    action.update(dx, dy, time, mDecelerateInterpolator);
  }
}
origin: hanhailong/GridPagerSnapHelper

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  int[] snapDistances = calculateDistanceToFinalSnap(mRecyclerView.getLayoutManager(),
      targetView);
  final int dx = snapDistances[0];
  final int dy = snapDistances[1];
  final int time = calculateTimeForDeceleration(Math.max(Math.abs(dx), Math.abs(dy)));
  if (time > 0) {
    action.update(dx, dy, time, mDecelerateInterpolator);
  }
}
origin: ymex/banner

final int time = calculateTimeForDeceleration(distance);
if (time > 0) {
  action.update(-dx, -dy, time, mDecelerateInterpolator);
origin: yuyakaido/CardStackView

case AutomaticSwipe:
  setting = manager.getCardStackSetting().swipeAnimationSetting;
  action.update(
      -getDx(setting),
      -getDy(setting),
case AutomaticRewind:
  setting = manager.getCardStackSetting().rewindAnimationSetting;
  action.update(
      x,
      y,
  int dy = -y * 10;
  setting = manager.getCardStackSetting().swipeAnimationSetting;
  action.update(
      dx,
      dy,
case ManualCancel:
  setting = manager.getCardStackSetting().rewindAnimationSetting;
  action.update(
      x,
      y,
origin: zzyyppqq/AnswerEffect

  @Override
  protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
    if (getLayoutManager() == null) {
      return;
    }
    int dx = calculateDxToMakeVisible(targetView,
        getHorizontalSnapPreference());
    int dy = calculateDyToMakeVisible(targetView,
        getVerticalSnapPreference());
    if (dx > 0) {
      dx = dx - getLayoutManager()
          .getLeftDecorationWidth(targetView);
    } else {
      dx = dx + getLayoutManager()
          .getRightDecorationWidth(targetView);
    }
    if (dy > 0) {
      dy = dy - getLayoutManager()
          .getTopDecorationHeight(targetView);
    } else {
      dy = dy + getLayoutManager()
          .getBottomDecorationHeight(targetView);
    }
    final int distance = (int) Math.sqrt(dx * dx + dy * dy);
    final int time = calculateTimeForDeceleration(distance);
    if (time > 0) {
      action.update(-dx, -dy, time, mDecelerateInterpolator);
    }
  }
};
origin: ymex/banner

/**
 * When the target scroll position is not a child of the RecyclerView, this method calculates
 * a direction vector towards that child and triggers a smooth scroll.
 *
 * @see #computeScrollVectorForPosition(int)
 */
protected void updateActionForInterimTarget(Action action) {
  // find an interim target position
  PointF scrollVector = computeScrollVectorForPosition(getTargetPosition());
  if (scrollVector == null || (scrollVector.x == 0 && scrollVector.y == 0)) {
    final int target = getTargetPosition();
    action.jumpTo(target);
    stop();
    return;
  }
  normalize(scrollVector);
  mTargetVector = scrollVector;
  mInterimTargetDx = (int) (TARGET_SEEK_SCROLL_DISTANCE_PX * scrollVector.x);
  mInterimTargetDy = (int) (TARGET_SEEK_SCROLL_DISTANCE_PX * scrollVector.y);
  final int time = calculateTimeForScrolling(TARGET_SEEK_SCROLL_DISTANCE_PX);
  // To avoid UI hiccups, trigger a smooth scroll to a distance little further than the
  // interim target. Since we track the distance travelled in onSeekTargetStep callback, it
  // won't actually scroll more than what we need.
  action.update((int) (mInterimTargetDx * TARGET_SEEK_EXTRA_SCROLL_RATIO),
      (int) (mInterimTargetDy * TARGET_SEEK_EXTRA_SCROLL_RATIO),
      (int) (time * TARGET_SEEK_EXTRA_SCROLL_RATIO), mLinearInterpolator);
}
origin: Meituan-Dianping/Shield

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  int xOffset = 0;
  int yOffset = 0;
  if (llm.getOrientation() == LinearLayoutManager.VERTICAL) {
    yOffset = offset;
  } else if (llm.getOrientation() == LinearLayoutManager.HORIZONTAL) {
    xOffset = offset;
  }
  final int dx = calculateDxToMakeVisible(targetView, getHorizontalSnapPreference()) + xOffset;
  final int dy = calculateDyToMakeVisible(targetView, getVerticalSnapPreference()) + yOffset + getTopOffset();
  final int distance = (int) Math.sqrt(dx * dx + dy * dy);
  final int time = calculateTimeForDeceleration(distance);
  if (time > 0) {
    action.update(-dx, -dy, time, mDecelerateInterpolator);
  }
}
@Override
origin: alexeykovalev/epg_magic_carousel

  @Override
  protected void onSeekTargetStep(int dx, int dy, RecyclerView.State state, Action action) {
    if (getChildCount() == 0) {
      stop();
      return;
    }

    final WheelRotationDirection rotationDirection = computeRotationDirectionForPosition(getTargetPosition());

    final int targetSeekScrollDistanceAsInt = (int) layoutManager.computationHelper.fromWheelRotationAngleToTraveledDistance(targetSeekScrollAngleInRad);
    final int time = calculateTimeForScrolling(targetSeekScrollDistanceAsInt);

//        final int newDy = (int) (targetSeekScrollDistanceAsInt * TARGET_SEEK_EXTRA_SCROLL_RATIO);
    final int newDy = rotationDirection == WheelRotationDirection.Anticlockwise ?
        targetSeekScrollDistanceAsInt : -targetSeekScrollDistanceAsInt;

    action.update(0, newDy, time, mLinearInterpolator);
  }

origin: alexeykovalev/epg_magic_carousel

  @Override
  protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
//        String title = ((WheelBigWrapperView) targetView).getTitle();
    final double rotationAngleInRad = calculateAngleInRadToMakeSectorInvisible(targetView);

//        final int dy = (int) Math.round(layoutManager.fromWheelRotationAngleToTraveledDistance(rotationAngleInRad));
    int dy = (int) layoutManager.computationHelper.fromWheelRotationAngleToTraveledDistance(rotationAngleInRad);

//        Log.e(TAG, "WheelSmoothScroller title [" + title + "], " +
//                "dy [" + dy + "], " +
//                "rotationAngleInRad [" + WheelComputationHelper.radToDegree(rotationAngleInRad) + "]");

    final int time = calculateTimeForDeceleration(dy);
    if (time > 0) {
      action.update(0, -dy, time, decelerateInterpolator);
    }
  }

origin: hanhailong/GridPagerSnapHelper

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  int[] snapDistances = calculateDistanceToFinalSnap(mRecyclerView.getLayoutManager(),
      targetView);
  final int dx = snapDistances[0];
  final int dy = snapDistances[1];
  final int time = calculateTimeForDeceleration(Math.max(Math.abs(dx), Math.abs(dy)));
  if (time > 0) {
    action.update(dx, dy, time, mDecelerateInterpolator);
  }
}
origin: zhimaochen/SnapHelperDemo

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  int[] snapDistances = calculateDistanceToFinalSnap(mRecyclerView.getLayoutManager(), targetView);
  final int dx = snapDistances[0];
  final int dy = snapDistances[1];
  final int time = calculateTimeForDeceleration(Math.max(Math.abs(dx), Math.abs(dy)));
  if (time > 0) {
    action.update(dx, dy, time, mDecelerateInterpolator);
  }
}
origin: nshmura/SnappySmoothScroller

@Override
protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
  final int dx = calculateDxToMakeVisible(targetView, getHorizontalSnapPreference());
  final int dy = calculateDyToMakeVisible(targetView, getVerticalSnapPreference());
  action.update(-dx, -dy, snapDuration, snapInterpolator);
}
origin: BCsl/GalleryLayoutManager

  @Override
  protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
    final int dx = calculateDxToMakeCentral(targetView);
    final int dy = calculateDyToMakeCentral(targetView);
    final int distance = (int) Math.sqrt(dx * dx + dy * dy);
    final int time = calculateTimeForDeceleration(distance);
    if (time > 0) {
      action.update(-dx, -dy, time, mDecelerateInterpolator);
    }
  }
}
origin: yuyakaido/CardStackView

@Override
protected void onSeekTargetStep(int dx, int dy, RecyclerView.State state, Action action) {
  if (type == ScrollType.AutomaticRewind) {
    RewindAnimationSetting setting = manager.getCardStackSetting().rewindAnimationSetting;
    action.update(
        -getDx(setting),
        -getDy(setting),
        setting.getDuration(),
        setting.getInterpolator()
    );
  }
}
origin: Meituan-Dianping/Shield

  @Override
  protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
    final int dx = calculateDxToMakeVisible(targetView, getHorizontalSnapPreference());
    final int dy = calculateDyToMakeVisible(targetView, getVerticalSnapPreference()) + getTopOffset();
    final int distance = (int) Math.sqrt(dx * dx + dy * dy);
    final int time = calculateTimeForDeceleration(distance);
    if (time > 0) {
      action.update(-dx, -dy, time, mDecelerateInterpolator);
    }
  }
}
android.support.v7.widgetRecyclerView$SmoothScroller$Actionupdate

Popular methods of RecyclerView$SmoothScroller$Action

  • getDuration
  • getDx
  • getDy
  • getInterpolator
  • jumpTo
  • setInterpolator

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JFileChooser (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now