Android LinearInterpolator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android LinearInterpolator class.

This code example shows how to use the following methods:
    } 
	 
	@Test 
	public void testInterpolation() throws Exception { 
        assertThat(animation.getInterpolator()).isNull();
		LinearInterpolator i = new LinearInterpolator();
		animation.setInterpolator(i);
        assertThat((LinearInterpolator) animation.getInterpolator()).isSameAs(i);
	} 
 
    @Test 
    public void testRepeatCount() throws Exception { 
        assertThat(animation.getRepeatCount()).isNotEqualTo(5);
        animation.setRepeatCount(5);
        assertThat(animation.getRepeatCount()).isEqualTo(5);
    } 
 
    @Test 
    public void testRepeatMode() throws Exception { 
        assertThat(animation.getRepeatMode()).isNotEqualTo(Animation.REVERSE);
8
CodeRank
This code example shows how to use the following methods:
    return anim; 
  } 
 
  @Implementation 
  public static Interpolator loadInterpolator(Context context, int id) { 
    return new LinearInterpolator(); 
  } 
 
  @Implementation 
  public static LayoutAnimationController loadLayoutAnimation(Context context, int id) { 
    Animation anim = new TranslateAnimation(0, 0, 30, 0); 
    LayoutAnimationController layoutAnim = new LayoutAnimationController(anim); 
    Robolectric.shadowOf(layoutAnim).setLoadedFromResourceId(id); 
    return layoutAnim; 
  } 
 
} 
7
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	protected int mRepeatCount;
	protected double mDelay;
	protected double mDuration;
	protected double mStartTime;
	protected ATransformable3D mTransformable3D;
	protected Interpolator mInterpolator = new LinearInterpolator();
	protected RepeatMode mRepeatMode = RepeatMode.NONE;
 
	// Internal 
	protected boolean mIsReversing;
	protected boolean mIsStarted;
	protected double mDelayCount;
	protected double mElapsedTime;
	protected double mInterpolatedTime;
	protected int mNumRepeat;
 
	public Animation3D() { 
		mAnimationListeners = new ArrayList<IAnimation3DListener>();
	} 
 
6
CodeRank
This code example shows how to use the following methods:
        super(context, attrs, defStyle);
        mAnimation = null;
    } 
 
    private void initAnimation(long duration, boolean isForward, int repeatCount) {
        LinearInterpolator lir = new LinearInterpolator();
        float from;
        float to;
        if (isForward) {
            from = (mAnimation == null || mAnimation.getRepeatCount() != Animation.INFINITE) ? 0.0f
                    : mAnimation.getDegree();
            to = from + 360.0f;
        } else { 
            from = (mAnimation == null || mAnimation.getRepeatCount() != Animation.INFINITE) ? 360.0f
                    : mAnimation.getDegree();
            to = from - 360.0f;
        } 
 
        if (isForward) {
            mAnimation = new SeamlessAnimation(from, to, Animation.RELATIVE_TO_SELF, 0.5f,

6
CodeRank
This code example shows how to use the following methods:
 * button. The logic of drawing the button with a skew transform is handled in the 
 * draw() override. 
 */ 
public class AnticiButton extends Button {
 
    private static final LinearInterpolator sLinearInterpolator = new LinearInterpolator();
    private static final DecelerateInterpolator sDecelerator = new DecelerateInterpolator(8);
    private static final AccelerateInterpolator sAccelerator = new AccelerateInterpolator();
    private static final OvershootInterpolator sOvershooter = new OvershootInterpolator();
    private static final DecelerateInterpolator sQuickDecelerator = new DecelerateInterpolator();
     
    private float mSkewX = 0;
    ObjectAnimator downAnim = null;
    boolean mOnLeft = true;
    RectF mTempRect = new RectF();
     
    public AnticiButton(Context context) {
        super(context);
        init(); 
    } 
6
CodeRank
This code example shows how to use the following methods:
        boolean reverse = true; 
 
        RotateVertical3DAnimation rotation = new RotateVertical3DAnimation(fromDegrees, toDegrees, centerX, centerY, depthZ, reverse, shadow1, shadow2); 
        rotation.setDuration(duration); 
        rotation.setFillAfter(false); 
        rotation.setInterpolator(new LinearInterpolator()); 
        return rotation; 
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:
        boolean reverse = true; 
 
        RotateVertical3DAnimation rotation = new RotateVertical3DAnimation(fromDegrees, toDegrees, centerX, centerY, depthZ, reverse, shadow1, shadow2); 
        rotation.setDuration(duration); 
        rotation.setFillAfter(false); 
        rotation.setInterpolator(new LinearInterpolator()); 
        return rotation; 
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    private static final boolean LOG_SWIPE_DISMISS_VELOCITY = false; // STOPSHIP - DEBUG ONLY
 
    public static final int X = 0;
    public static final int Y = 1;
 
    private static LinearInterpolator sLinearInterpolator = new LinearInterpolator();
 
    private static int SWIPE_ESCAPE_VELOCITY = -1;
    private static int DEFAULT_ESCAPE_ANIMATION_DURATION;
    private static int MAX_ESCAPE_ANIMATION_DURATION;
    private static int MAX_DISMISS_VELOCITY;
    private static int SNAP_ANIM_LEN;
    private static int DISMISS_ANIMATION_DURATION;
    private static int SWIPE_SCROLL_SLOP;
    private static float MIN_SWIPE;
    private static float MIN_VERT;
    private static float MIN_LOCK;
 
    public static float ALPHA_FADE_START = 0f; // fraction of thumbnail width
                                                 // where fade starts 
5
CodeRank

Related Android LinearInterpolator Questions & Answers:

See Code Examples for Android LinearInterpolator Methods: