mirror of
https://github.com/wesaphzt/privatelock.git
synced 2025-05-25 19:29:25 +00:00
26 lines
No EOL
709 B
Java
26 lines
No EOL
709 B
Java
package com.wesaphzt.privatelock.animation;
|
|
|
|
import android.view.animation.Animation;
|
|
import android.view.animation.Transformation;
|
|
|
|
public class CircleAngleAnimation extends Animation {
|
|
|
|
private Circle circle;
|
|
|
|
private float oldAngle;
|
|
private float newAngle;
|
|
|
|
public CircleAngleAnimation(Circle circle, int newAngle) {
|
|
this.oldAngle = circle.getAngle();
|
|
this.newAngle = newAngle;
|
|
this.circle = circle;
|
|
}
|
|
|
|
@Override
|
|
protected void applyTransformation(float interpolatedTime, Transformation transformation) {
|
|
float angle = oldAngle + ((newAngle - oldAngle) * interpolatedTime);
|
|
|
|
circle.setAngle(angle);
|
|
circle.requestLayout();
|
|
}
|
|
} |