Last active
August 18, 2019 12:33
-
-
Save patrick-elmquist/779f40697fa2f4d15b6869eb48cc6c5e to your computer and use it in GitHub Desktop.
Frame by frame #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private float calculateArcSize(float animationProgress) { | |
final double adjustedProgress = Math.sin(animationProgress * Math.PI); | |
// ARC_MAX_DEGREES is the maximum size the arc will have in degrees. | |
// ARC_MAX_DEGREES = 180 means that at it's largest it will cover | |
// half the circle. | |
return (float) adjustedProgress * -ARC_MAX_DEGREES; | |
} | |
private float calculateArcStart(float animationProgress) { | |
final float deceleratedProgress = mDecelerateInterpolator.getInterpolation(animationProgress); | |
// ARC_START_OFFSET_DEGREES is used to offset the starting position, | |
// -90 makes the top of the view the starting point. | |
return ARC_START_OFFSET_DEGREES + deceleratedProgress * DEGREES_IN_CIRCLE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment