Android BounceInterpolator - 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 BounceInterpolator class.

This code example shows how to use the following methods:
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(1500);
                bounceAnim.setInterpolator(new BounceInterpolator());
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void seek(long seekTime) {
            createAnimation(); 
            bounceAnim.setCurrentPlayTime(seekTime);
        } 
 
6
CodeRank
This code example shows how to use the following methods:
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(1500);
                bounceAnim.setInterpolator(new BounceInterpolator());
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void seek(long seekTime) {
            createAnimation(); 
            bounceAnim.setCurrentPlayTime(seekTime);
        } 
 
6
CodeRank
This code example shows how to use the following methods:
 
        private void createAnimation() { 
            if (bounceAnim == null) {
                bounceAnim = ObjectAnimator.ofFloat(ball, "y",
                        ball.getY(), getHeight() - BALL_SIZE).setDuration(1500);
                bounceAnim.setInterpolator(new BounceInterpolator());
                bounceAnim.addUpdateListener(this);
            } 
        } 
 
        public void startAnimation() { 
            createAnimation(); 
            bounceAnim.start();
        } 
 
        public void seek(long seekTime) {
            createAnimation(); 
            bounceAnim.setCurrentPlayTime(seekTime);
        } 
 
6
CodeRank
This code example shows how to use the following methods:
    private Animation mAnim;
 
    public Render(GLSurfaceView surface){
        mSurface = surface;
        mQuadShape = new QuadShape();
        Interpolator interpolator = new BounceInterpolator();
        Animation animTranslate = new GotoAnimation(0f,0f,2f,2f,-6f,-50f, interpolator,5000);
        Animation animRotate =  new RotateAnimation(45,135,180,0,0,359,interpolator,5000);
        mAnim = new SequentialAnimation(Arrays.asList(new Animation[]{animTranslate,animRotate}));
        mAnim.setTarget(mQuadShape);
    } 
 
    @Override 
    public void onSurfaceChanged(GL10 gl, int width, int height) {
        if(height == 0) {                       //Prevent A Divide By Zero By
            height = 1;                         //Making Height Equal One
        } 
 
        gl.glViewport(0, 0, width, height);     //Reset The Current Viewport
        gl.glMatrixMode(GL10.GL_PROJECTION);    //Select The Projection Matrix
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	} 
	 
	public static Animation getButtonDialogAnimation(Context context) {
		if(buttonDialogAnimation == null) {
			buttonDialogAnimation = new ScaleAnimation(1.0f,1.2f,1.0f,1.2f,ScaleAnimation.RELATIVE_TO_SELF,0.5f,ScaleAnimation.RELATIVE_TO_SELF,0.5f);
			buttonDialogAnimation.setInterpolator(new BounceInterpolator());
			buttonDialogAnimation.setRepeatMode(Animation.REVERSE); 
			buttonDialogAnimation.setRepeatCount(Animation.INFINITE);
			buttonDialogAnimation.setDuration(200);
		} 
		return buttonDialogAnimation;
	} 
	 
	public static Animation getNewRecordAnimation(Context context) {
		if(newRecordAnimation == null) {
			newRecordAnimation = AnimationUtils.loadAnimation(context, R.anim.newrecord);
		} 
		return newRecordAnimation;
	} 
	 
4
CodeRank
This code example shows how to use the following methods:
	} 
	 
	public static Animation getButtonDialogAnimation(Context context) {
		if(buttonDialogAnimation == null) {
			buttonDialogAnimation = new ScaleAnimation(1.0f,1.2f,1.0f,1.2f,ScaleAnimation.RELATIVE_TO_SELF,0.5f,ScaleAnimation.RELATIVE_TO_SELF,0.5f);
			buttonDialogAnimation.setInterpolator(new BounceInterpolator());
			buttonDialogAnimation.setRepeatMode(Animation.REVERSE); 
			buttonDialogAnimation.setRepeatCount(Animation.INFINITE);
			buttonDialogAnimation.setDuration(200);
		} 
		return buttonDialogAnimation;
	} 
	 
	public static Animation getNewRecordAnimation(Context context) {
		if(newRecordAnimation == null) {
			newRecordAnimation = AnimationUtils.loadAnimation(context, R.anim.newrecord);
		} 
		return newRecordAnimation;
	} 
	 
4
CodeRank
This code example shows how to use the following methods:
		// Don't bounce if it's not fully opened 
		if (getScrollX() != openedX) 
			return; 
		 
		bounceAnimation = new TranslateAnimation(0, 40, 0, 0); 
		bounceAnimation.setInterpolator(new BounceInterpolator()); 
		bounceAnimation.setDuration(800); 
	    ScrollView.this.scrollTo(openedX + 40, 0); 
	    startAnimation(bounceAnimation); 
	    invalidate(); 
	} 
	 
	// Return true if we're scrolling in the x direction   
    class XScrollDetector extends SimpleOnGestureListener { 
    	@Override 
        public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { 
    		if(Math.abs(distanceY) < Math.abs(distanceX)) { 
                return true; 
            } 
            return false; 
4
CodeRank
This code example shows how to use the following methods:

Related Android BounceInterpolator Questions & Answers:

See Code Examples for Android BounceInterpolator Methods: