1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| package com.yalantis.ucrop.util;
|
| public final class CubicEasing {
|
| public static float easeOut(float time, float start, float end, float duration) {
| return end * ((time = time / duration - 1.0f) * time * time + 1.0f) + start;
| }
|
| public static float easeIn(float time, float start, float end, float duration) {
| return end * (time /= duration) * time * time + start;
| }
|
| public static float easeInOut(float time, float start, float end, float duration) {
| return (time /= duration / 2.0f) < 1.0f ? end / 2.0f * time * time * time + start : end / 2.0f * ((time -= 2.0f) * time * time + 2.0f) + start;
| }
|
| }
|
|