182 lines
5.2 KiB
Java
182 lines
5.2 KiB
Java
package o;
|
|
|
|
import java.io.PrintStream;
|
|
import java.util.Arrays;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class Yrp {
|
|
String b = "identity";
|
|
private static Yrp d = new Yrp();
|
|
public static String[] a = {"standard", "accelerate", "decelerate", "linear"};
|
|
|
|
public double a(double d2) {
|
|
return 1.0d;
|
|
}
|
|
|
|
public double e(double d2) {
|
|
return d2;
|
|
}
|
|
|
|
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
|
public static Yrp a(String str) {
|
|
char c;
|
|
if (str == null) {
|
|
return null;
|
|
}
|
|
if (str.startsWith("cubic")) {
|
|
return new HBt(str);
|
|
}
|
|
if (str.startsWith("spline")) {
|
|
return new C7857cwJ(str);
|
|
}
|
|
if (str.startsWith("Schlick")) {
|
|
return new Eag(str);
|
|
}
|
|
str.hashCode();
|
|
switch (str.hashCode()) {
|
|
case -1354466595:
|
|
if (str.equals("accelerate")) {
|
|
c = 0;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1263948740:
|
|
if (str.equals("decelerate")) {
|
|
c = 1;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1197605014:
|
|
if (str.equals("anticipate")) {
|
|
c = 2;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -1102672091:
|
|
if (str.equals("linear")) {
|
|
c = 3;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case -749065269:
|
|
if (str.equals("overshoot")) {
|
|
c = 4;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
case 1312628413:
|
|
if (str.equals("standard")) {
|
|
c = 5;
|
|
break;
|
|
}
|
|
c = 65535;
|
|
break;
|
|
default:
|
|
c = 65535;
|
|
break;
|
|
}
|
|
if (c == 0) {
|
|
return new HBt("cubic(0.4, 0.05, 0.8, 0.7)");
|
|
}
|
|
if (c == 1) {
|
|
return new HBt("cubic(0.0, 0.0, 0.2, 0.95)");
|
|
}
|
|
if (c == 2) {
|
|
return new HBt("cubic(0.36, 0, 0.66, -0.56)");
|
|
}
|
|
if (c == 3) {
|
|
return new HBt("cubic(1, 1, 0, 0)");
|
|
}
|
|
if (c == 4) {
|
|
return new HBt("cubic(0.34, 1.56, 0.64, 1)");
|
|
}
|
|
if (c == 5) {
|
|
return new HBt("cubic(0.4, 0.0, 0.2, 1)");
|
|
}
|
|
PrintStream printStream = System.err;
|
|
StringBuilder sb = new StringBuilder("transitionEasing syntax error syntax:transitionEasing=\"cubic(1.0,0.5,0.0,0.6)\" or ");
|
|
sb.append(Arrays.toString(a));
|
|
printStream.println(sb.toString());
|
|
return d;
|
|
}
|
|
|
|
/* loaded from: classes.dex */
|
|
static class HBt extends Yrp {
|
|
private double c;
|
|
private double d;
|
|
private double e;
|
|
private double i;
|
|
|
|
HBt(String str) {
|
|
this.b = str;
|
|
int indexOf = str.indexOf(40);
|
|
int indexOf2 = str.indexOf(44, indexOf);
|
|
this.c = Double.parseDouble(str.substring(indexOf + 1, indexOf2).trim());
|
|
int i = indexOf2 + 1;
|
|
int indexOf3 = str.indexOf(44, i);
|
|
this.d = Double.parseDouble(str.substring(i, indexOf3).trim());
|
|
int i2 = indexOf3 + 1;
|
|
int indexOf4 = str.indexOf(44, i2);
|
|
this.e = Double.parseDouble(str.substring(i2, indexOf4).trim());
|
|
int i3 = indexOf4 + 1;
|
|
this.i = Double.parseDouble(str.substring(i3, str.indexOf(41, i3)).trim());
|
|
}
|
|
|
|
@Override // o.Yrp
|
|
public final double a(double d) {
|
|
double d2 = 0.5d;
|
|
double d3 = 0.5d;
|
|
while (d2 > 1.0E-4d) {
|
|
d2 *= 0.5d;
|
|
d3 = c(d3) < d ? d3 + d2 : d3 - d2;
|
|
}
|
|
double d4 = d3 - d2;
|
|
double d5 = d3 + d2;
|
|
return (d(d5) - d(d4)) / (c(d5) - c(d4));
|
|
}
|
|
|
|
@Override // o.Yrp
|
|
public final double e(double d) {
|
|
if (d <= 0.0d) {
|
|
return 0.0d;
|
|
}
|
|
if (d >= 1.0d) {
|
|
return 1.0d;
|
|
}
|
|
double d2 = 0.5d;
|
|
double d3 = 0.5d;
|
|
while (d2 > 0.01d) {
|
|
d2 *= 0.5d;
|
|
d3 = c(d3) < d ? d3 + d2 : d3 - d2;
|
|
}
|
|
double d4 = d3 - d2;
|
|
double c = c(d4);
|
|
double d5 = d3 + d2;
|
|
double c2 = c(d5);
|
|
double d6 = d(d4);
|
|
return (((d(d5) - d6) * (d - c)) / (c2 - c)) + d6;
|
|
}
|
|
|
|
private double d(double d) {
|
|
double d2 = 1.0d - d;
|
|
double d3 = 3.0d * d2;
|
|
return (this.d * d2 * d3 * d) + (this.i * d3 * d * d) + (d * d * d);
|
|
}
|
|
|
|
private double c(double d) {
|
|
double d2 = 1.0d - d;
|
|
double d3 = 3.0d * d2;
|
|
return (this.c * d2 * d3 * d) + (this.e * d3 * d * d) + (d * d * d);
|
|
}
|
|
}
|
|
|
|
public String toString() {
|
|
return this.b;
|
|
}
|
|
}
|