alexandroid/decompiled/jadx/sources/com/google/android/material/animation/MotionTiming.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

100 lines
3.6 KiB
Java

package com.google.android.material.animation;
import android.animation.Animator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes7.dex */
public class MotionTiming {
private long delay;
private long duration;
@Nullable
private TimeInterpolator interpolator;
private int repeatCount;
private int repeatMode;
public MotionTiming(long j, long j2) {
this.interpolator = null;
this.repeatCount = 0;
this.repeatMode = 1;
this.delay = j;
this.duration = j2;
}
@NonNull
public static MotionTiming createFromAnimator(@NonNull ValueAnimator valueAnimator) {
MotionTiming motionTiming = new MotionTiming(valueAnimator.getStartDelay(), valueAnimator.getDuration(), valueAnimator.getInterpolator());
motionTiming.repeatCount = valueAnimator.getRepeatCount();
motionTiming.repeatMode = valueAnimator.getRepeatMode();
return motionTiming;
}
public void apply(@NonNull Animator animator) {
animator.setStartDelay(getDelay());
animator.setDuration(getDuration());
animator.setInterpolator(getInterpolator());
if (animator instanceof ValueAnimator) {
ValueAnimator valueAnimator = (ValueAnimator) animator;
valueAnimator.setRepeatCount(getRepeatCount());
valueAnimator.setRepeatMode(getRepeatMode());
}
}
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof MotionTiming)) {
return false;
}
MotionTiming motionTiming = (MotionTiming) obj;
if (getDelay() == motionTiming.getDelay() && getDuration() == motionTiming.getDuration() && getRepeatCount() == motionTiming.getRepeatCount() && getRepeatMode() == motionTiming.getRepeatMode()) {
return getInterpolator().getClass().equals(motionTiming.getInterpolator().getClass());
}
return false;
}
public long getDelay() {
return this.delay;
}
public long getDuration() {
return this.duration;
}
@Nullable
public TimeInterpolator getInterpolator() {
TimeInterpolator timeInterpolator = this.interpolator;
return timeInterpolator != null ? timeInterpolator : AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR;
}
public int getRepeatCount() {
return this.repeatCount;
}
public int getRepeatMode() {
return this.repeatMode;
}
public int hashCode() {
return getRepeatMode() + ((getRepeatCount() + ((getInterpolator().getClass().hashCode() + (((((int) (getDelay() ^ (getDelay() >>> 32))) * 31) + ((int) (getDuration() ^ (getDuration() >>> 32)))) * 31)) * 31)) * 31);
}
@NonNull
public String toString() {
return "\n" + getClass().getName() + AbstractJsonLexerKt.BEGIN_OBJ + Integer.toHexString(System.identityHashCode(this)) + " delay: " + getDelay() + " duration: " + getDuration() + " interpolator: " + getInterpolator().getClass() + " repeatCount: " + getRepeatCount() + " repeatMode: " + getRepeatMode() + "}\n";
}
public MotionTiming(long j, long j2, @NonNull TimeInterpolator timeInterpolator) {
this.repeatCount = 0;
this.repeatMode = 1;
this.delay = j;
this.duration = j2;
this.interpolator = timeInterpolator;
}
}