congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JComboBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Sublime Text plugins
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