congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
FlingAnimation.setMaxValue
Code IndexAdd Tabnine to your IDE (free)

How to use
setMaxValue
method
in
android.support.animation.FlingAnimation

Best Java code snippets using android.support.animation.FlingAnimation.setMaxValue (Showing top 3 results out of 315)

origin: recruit-lifestyle/FloatingView

/**
 * Start fling animation(Y coordinate)
 *
 * @param velocityY velocity Y coordinate
 */
private void startFlingAnimationY(float velocityY) {
  final FlingAnimation flingAnimationY = new FlingAnimation(new FloatValueHolder());
  flingAnimationY.setStartVelocity(velocityY);
  flingAnimationY.setMaxValue(mPositionLimitRect.bottom);
  flingAnimationY.setMinValue(mPositionLimitRect.top);
  flingAnimationY.setStartValue(mParams.y);
  flingAnimationY.setFriction(ANIMATION_FLING_Y_FRICTION);
  flingAnimationY.setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS);
  flingAnimationY.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() {
    @Override
    public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {
      final int y = Math.round(value);
      // Not moving, or the touch operation is continuing
      if (mParams.y == y || mVelocityTracker != null) {
        return;
      }
      // update y coordinate
      mParams.y = y;
      updateViewLayout();
    }
  });
  flingAnimationY.start();
}
origin: recruit-lifestyle/FloatingView

/**
 * Start fling animation(X coordinate)
 *
 * @param velocityX velocity X coordinate
 */
private void startFlingAnimationX(float velocityX) {
  final FlingAnimation flingAnimationX = new FlingAnimation(new FloatValueHolder());
  flingAnimationX.setStartVelocity(velocityX);
  flingAnimationX.setMaxValue(mPositionLimitRect.right);
  flingAnimationX.setMinValue(mPositionLimitRect.left);
  flingAnimationX.setStartValue(mParams.x);
  flingAnimationX.setFriction(ANIMATION_FLING_X_FRICTION);
  flingAnimationX.setMinimumVisibleChange(DynamicAnimation.MIN_VISIBLE_CHANGE_PIXELS);
  flingAnimationX.addUpdateListener(new DynamicAnimation.OnAnimationUpdateListener() {
    @Override
    public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {
      final int x = Math.round(value);
      // Not moving, or the touch operation is continuing
      if (mParams.x == x || mVelocityTracker != null) {
        return;
      }
      // update y coordinate
      mParams.x = x;
      updateViewLayout();
    }
  });
  flingAnimationX.start();
}
origin: richakhanna/physicsbasedanimation

  @Override
  public boolean onFling(MotionEvent downEvent, MotionEvent moveEvent, float velocityX, float velocityY) {
    //downEvent : when user puts his finger down on the view
    //moveEvent : when user lifts his finger at the end of the movement
    float distanceInX = Math.abs(moveEvent.getRawX() - downEvent.getRawX());
    float distanceInY = Math.abs(moveEvent.getRawY() - downEvent.getRawY());
    mTvFlingDistance.setText("distanceInX : " + distanceInX + "\n" + "distanceInY : " + distanceInY);
    if (distanceInX > MIN_DISTANCE_MOVED) {
      //Fling Right/Left
      FlingAnimation flingX = new FlingAnimation(mViewTobeFlung, DynamicAnimation.TRANSLATION_X);
      flingX.setStartVelocity(velocityX)
          .setMinValue(MIN_TRANSLATION) // minimum translationX property
          .setMaxValue(maxTranslationX)  // maximum translationX property
          .setFriction(FRICTION)
          .start();
    } else if (distanceInY > MIN_DISTANCE_MOVED) {
      //Fling Down/Up
      FlingAnimation flingY = new FlingAnimation(mViewTobeFlung, DynamicAnimation.TRANSLATION_Y);
      flingY.setStartVelocity(velocityY)
          .setMinValue(MIN_TRANSLATION)  // minimum translationY property
          .setMaxValue(maxTranslationY) // maximum translationY property
          .setFriction(FRICTION)
          .start();
    }
    return true;
  }
};
android.support.animationFlingAnimationsetMaxValue

Popular methods of FlingAnimation

  • <init>
  • setFriction
  • setStartVelocity
  • start
  • addUpdateListener
  • setMinValue
  • addEndListener
  • cancel
  • removeEndListener
  • removeUpdateListener
  • setMinimumVisibleChange
  • setStartValue
  • setMinimumVisibleChange,
  • setStartValue

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JComboBox (javax.swing)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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