Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import androidx.interpolator.view.animation.FastOutLinearInInterpolator;
|
||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
|
||||
import androidx.interpolator.view.animation.LinearOutSlowInInterpolator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AnimationUtils {
|
||||
public static final TimeInterpolator a = new LinearInterpolator();
|
||||
public static final TimeInterpolator b = new FastOutSlowInInterpolator();
|
||||
public static final TimeInterpolator c = new FastOutLinearInInterpolator();
|
||||
public static final TimeInterpolator d = new LinearOutSlowInInterpolator();
|
||||
public static final TimeInterpolator e = new DecelerateInterpolator();
|
||||
|
||||
public static float a(float f, float f2, float f3) {
|
||||
return f + (f3 * (f2 - f));
|
||||
}
|
||||
|
||||
public static int a(int i, int i2, float f) {
|
||||
return i + Math.round(f * (i2 - i));
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ValueAnimator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AnimatorSetCompat {
|
||||
public static void a(AnimatorSet animatorSet, List<Animator> list) {
|
||||
int size = list.size();
|
||||
long j = 0;
|
||||
for (int i = 0; i < size; i++) {
|
||||
Animator animator = list.get(i);
|
||||
j = Math.max(j, animator.getStartDelay() + animator.getDuration());
|
||||
}
|
||||
ValueAnimator ofInt = ValueAnimator.ofInt(0, 0);
|
||||
ofInt.setDuration(j);
|
||||
list.add(0, ofInt);
|
||||
animatorSet.playTogether(list);
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.TypeEvaluator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ArgbEvaluatorCompat implements TypeEvaluator<Integer> {
|
||||
private static final ArgbEvaluatorCompat a = new ArgbEvaluatorCompat();
|
||||
|
||||
public static ArgbEvaluatorCompat a() {
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override // android.animation.TypeEvaluator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Integer evaluate(float f, Integer num, Integer num2) {
|
||||
int intValue = num.intValue();
|
||||
float f2 = ((intValue >> 24) & 255) / 255.0f;
|
||||
int intValue2 = num2.intValue();
|
||||
float pow = (float) Math.pow(((intValue >> 16) & 255) / 255.0f, 2.2d);
|
||||
float pow2 = (float) Math.pow(((intValue >> 8) & 255) / 255.0f, 2.2d);
|
||||
float pow3 = (float) Math.pow((intValue & 255) / 255.0f, 2.2d);
|
||||
float pow4 = (float) Math.pow(((intValue2 >> 16) & 255) / 255.0f, 2.2d);
|
||||
float f3 = f2 + (((((intValue2 >> 24) & 255) / 255.0f) - f2) * f);
|
||||
float pow5 = pow2 + ((((float) Math.pow(((intValue2 >> 8) & 255) / 255.0f, 2.2d)) - pow2) * f);
|
||||
float pow6 = pow3 + (f * (((float) Math.pow((intValue2 & 255) / 255.0f, 2.2d)) - pow3));
|
||||
return Integer.valueOf((Math.round(((float) Math.pow(pow + ((pow4 - pow) * f), 0.45454545454545453d)) * 255.0f) << 16) | (Math.round(f3 * 255.0f) << 24) | (Math.round(((float) Math.pow(pow5, 0.45454545454545453d)) * 255.0f) << 8) | Math.round(((float) Math.pow(pow6, 0.45454545454545453d)) * 255.0f));
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.util.Property;
|
||||
import android.view.ViewGroup;
|
||||
import com.google.android.material.R$id;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ChildrenAlphaProperty extends Property<ViewGroup, Float> {
|
||||
public static final Property<ViewGroup, Float> a = new ChildrenAlphaProperty("childrenAlpha");
|
||||
|
||||
private ChildrenAlphaProperty(String str) {
|
||||
super(Float.class, str);
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Float get(ViewGroup viewGroup) {
|
||||
Float f = (Float) viewGroup.getTag(R$id.mtrl_internal_children_alpha_tag);
|
||||
return f != null ? f : Float.valueOf(1.0f);
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void set(ViewGroup viewGroup, Float f) {
|
||||
float floatValue = f.floatValue();
|
||||
viewGroup.setTag(R$id.mtrl_internal_children_alpha_tag, Float.valueOf(floatValue));
|
||||
int childCount = viewGroup.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
viewGroup.getChildAt(i).setAlpha(floatValue);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Property;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DrawableAlphaProperty extends Property<Drawable, Integer> {
|
||||
public static final Property<Drawable, Integer> b = new DrawableAlphaProperty();
|
||||
private final WeakHashMap<Drawable, Integer> a;
|
||||
|
||||
private DrawableAlphaProperty() {
|
||||
super(Integer.class, "drawableAlphaCompat");
|
||||
this.a = new WeakHashMap<>();
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Integer get(Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return Integer.valueOf(drawable.getAlpha());
|
||||
}
|
||||
if (this.a.containsKey(drawable)) {
|
||||
return this.a.get(drawable);
|
||||
}
|
||||
return 255;
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void set(Drawable drawable, Integer num) {
|
||||
if (Build.VERSION.SDK_INT < 19) {
|
||||
this.a.put(drawable, num);
|
||||
}
|
||||
drawable.setAlpha(num.intValue());
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.graphics.Matrix;
|
||||
import android.util.Property;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ImageMatrixProperty extends Property<ImageView, Matrix> {
|
||||
private final Matrix a;
|
||||
|
||||
public ImageMatrixProperty() {
|
||||
super(Matrix.class, "imageMatrixProperty");
|
||||
this.a = new Matrix();
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public void set(ImageView imageView, Matrix matrix) {
|
||||
imageView.setImageMatrix(matrix);
|
||||
}
|
||||
|
||||
@Override // android.util.Property
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Matrix get(ImageView imageView) {
|
||||
this.a.set(imageView.getImageMatrix());
|
||||
return this.a;
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.TypeEvaluator;
|
||||
import android.graphics.Matrix;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MatrixEvaluator implements TypeEvaluator<Matrix> {
|
||||
private final float[] a = new float[9];
|
||||
private final float[] b = new float[9];
|
||||
private final Matrix c = new Matrix();
|
||||
|
||||
@Override // android.animation.TypeEvaluator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public Matrix evaluate(float f, Matrix matrix, Matrix matrix2) {
|
||||
matrix.getValues(this.a);
|
||||
matrix2.getValues(this.b);
|
||||
for (int i = 0; i < 9; i++) {
|
||||
float[] fArr = this.b;
|
||||
float f2 = fArr[i];
|
||||
float[] fArr2 = this.a;
|
||||
fArr[i] = fArr2[i] + ((f2 - fArr2[i]) * f);
|
||||
}
|
||||
this.c.setValues(this.b);
|
||||
return this.c;
|
||||
}
|
||||
}
|
@@ -0,0 +1,96 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorInflater;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MotionSpec {
|
||||
private final SimpleArrayMap<String, MotionTiming> a = new SimpleArrayMap<>();
|
||||
|
||||
public MotionTiming a(String str) {
|
||||
if (b(str)) {
|
||||
return this.a.get(str);
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public boolean b(String str) {
|
||||
return this.a.get(str) != null;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || MotionSpec.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return this.a.equals(((MotionSpec) obj).a);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.a.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return '\n' + MotionSpec.class.getName() + '{' + Integer.toHexString(System.identityHashCode(this)) + " timings: " + this.a + "}\n";
|
||||
}
|
||||
|
||||
public void a(String str, MotionTiming motionTiming) {
|
||||
this.a.put(str, motionTiming);
|
||||
}
|
||||
|
||||
public long a() {
|
||||
int size = this.a.size();
|
||||
long j = 0;
|
||||
for (int i = 0; i < size; i++) {
|
||||
MotionTiming d = this.a.d(i);
|
||||
j = Math.max(j, d.a() + d.b());
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
public static MotionSpec a(Context context, int i) {
|
||||
try {
|
||||
Animator loadAnimator = AnimatorInflater.loadAnimator(context, i);
|
||||
if (loadAnimator instanceof AnimatorSet) {
|
||||
return a(((AnimatorSet) loadAnimator).getChildAnimations());
|
||||
}
|
||||
if (loadAnimator == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(loadAnimator);
|
||||
return a(arrayList);
|
||||
} catch (Exception e) {
|
||||
Log.w("MotionSpec", "Can't load animation resource ID #0x" + Integer.toHexString(i), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static MotionSpec a(List<Animator> list) {
|
||||
MotionSpec motionSpec = new MotionSpec();
|
||||
int size = list.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
a(motionSpec, list.get(i));
|
||||
}
|
||||
return motionSpec;
|
||||
}
|
||||
|
||||
private static void a(MotionSpec motionSpec, Animator animator) {
|
||||
if (animator instanceof ObjectAnimator) {
|
||||
ObjectAnimator objectAnimator = (ObjectAnimator) animator;
|
||||
motionSpec.a(objectAnimator.getPropertyName(), MotionTiming.a((ValueAnimator) objectAnimator));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Animator must be an ObjectAnimator: " + animator);
|
||||
}
|
||||
}
|
||||
}
|
104
sources/com/google/android/material/animation/MotionTiming.java
Normal file
104
sources/com/google/android/material/animation/MotionTiming.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MotionTiming {
|
||||
private long a;
|
||||
private long b;
|
||||
private TimeInterpolator c;
|
||||
private int d;
|
||||
private int e;
|
||||
|
||||
public MotionTiming(long j, long j2) {
|
||||
this.a = 0L;
|
||||
this.b = 300L;
|
||||
this.c = null;
|
||||
this.d = 0;
|
||||
this.e = 1;
|
||||
this.a = j;
|
||||
this.b = j2;
|
||||
}
|
||||
|
||||
public void a(Animator animator) {
|
||||
animator.setStartDelay(a());
|
||||
animator.setDuration(b());
|
||||
animator.setInterpolator(c());
|
||||
if (animator instanceof ValueAnimator) {
|
||||
ValueAnimator valueAnimator = (ValueAnimator) animator;
|
||||
valueAnimator.setRepeatCount(d());
|
||||
valueAnimator.setRepeatMode(e());
|
||||
}
|
||||
}
|
||||
|
||||
public long b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public TimeInterpolator c() {
|
||||
TimeInterpolator timeInterpolator = this.c;
|
||||
return timeInterpolator != null ? timeInterpolator : AnimationUtils.b;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public int e() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || MotionTiming.class != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MotionTiming motionTiming = (MotionTiming) obj;
|
||||
if (a() == motionTiming.a() && b() == motionTiming.b() && d() == motionTiming.d() && e() == motionTiming.e()) {
|
||||
return c().getClass().equals(motionTiming.c().getClass());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (((((((((int) (a() ^ (a() >>> 32))) * 31) + ((int) (b() ^ (b() >>> 32)))) * 31) + c().getClass().hashCode()) * 31) + d()) * 31) + e();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return '\n' + MotionTiming.class.getName() + '{' + Integer.toHexString(System.identityHashCode(this)) + " delay: " + a() + " duration: " + b() + " interpolator: " + c().getClass() + " repeatCount: " + d() + " repeatMode: " + e() + "}\n";
|
||||
}
|
||||
|
||||
private static TimeInterpolator b(ValueAnimator valueAnimator) {
|
||||
TimeInterpolator interpolator = valueAnimator.getInterpolator();
|
||||
return ((interpolator instanceof AccelerateDecelerateInterpolator) || interpolator == null) ? AnimationUtils.b : interpolator instanceof AccelerateInterpolator ? AnimationUtils.c : interpolator instanceof DecelerateInterpolator ? AnimationUtils.d : interpolator;
|
||||
}
|
||||
|
||||
public long a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
static MotionTiming a(ValueAnimator valueAnimator) {
|
||||
MotionTiming motionTiming = new MotionTiming(valueAnimator.getStartDelay(), valueAnimator.getDuration(), b(valueAnimator));
|
||||
motionTiming.d = valueAnimator.getRepeatCount();
|
||||
motionTiming.e = valueAnimator.getRepeatMode();
|
||||
return motionTiming;
|
||||
}
|
||||
|
||||
public MotionTiming(long j, long j2, TimeInterpolator timeInterpolator) {
|
||||
this.a = 0L;
|
||||
this.b = 300L;
|
||||
this.c = null;
|
||||
this.d = 0;
|
||||
this.e = 1;
|
||||
this.a = j;
|
||||
this.b = j2;
|
||||
this.c = timeInterpolator;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.google.android.material.animation;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Positioning {
|
||||
public final int a;
|
||||
public final float b;
|
||||
public final float c;
|
||||
|
||||
public Positioning(int i, float f, float f2) {
|
||||
this.a = i;
|
||||
this.b = f;
|
||||
this.c = f2;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user