76 lines
2.5 KiB
Java
76 lines
2.5 KiB
Java
package com.discord.rlottie;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import androidx.appcompat.widget.AppCompatImageView;
|
|
import com.discord.rlottie.RLottieDrawable;
|
|
import d0.z.d.m;
|
|
/* compiled from: RLottieImageView.kt */
|
|
public final class RLottieImageView extends AppCompatImageView {
|
|
public RLottieDrawable i;
|
|
public boolean j;
|
|
public boolean k;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public RLottieImageView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
m.checkNotNullParameter(context, "context");
|
|
RLottieDrawable.PlaybackMode playbackMode = RLottieDrawable.PlaybackMode.FREEZE;
|
|
}
|
|
|
|
public final void a() {
|
|
RLottieDrawable rLottieDrawable = this.i;
|
|
if (rLottieDrawable != null) {
|
|
this.k = true;
|
|
if (this.j && rLottieDrawable != null) {
|
|
rLottieDrawable.start();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.ImageView, android.view.View
|
|
public void onAttachedToWindow() {
|
|
RLottieDrawable rLottieDrawable;
|
|
super.onAttachedToWindow();
|
|
this.j = true;
|
|
if (this.k && (rLottieDrawable = this.i) != null) {
|
|
rLottieDrawable.start();
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.ImageView, android.view.View
|
|
public void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
this.j = false;
|
|
RLottieDrawable rLottieDrawable = this.i;
|
|
if (rLottieDrawable != null) {
|
|
rLottieDrawable.O = false;
|
|
}
|
|
}
|
|
|
|
public final void setPlaybackMode(RLottieDrawable.PlaybackMode playbackMode) {
|
|
m.checkNotNullParameter(playbackMode, "playbackMode");
|
|
RLottieDrawable rLottieDrawable = this.i;
|
|
if (rLottieDrawable != null) {
|
|
rLottieDrawable.f(playbackMode);
|
|
}
|
|
}
|
|
|
|
public final void setProgress(float f) {
|
|
RLottieDrawable rLottieDrawable = this.i;
|
|
if (rLottieDrawable != null) {
|
|
if (f < 0.0f) {
|
|
f = 0.0f;
|
|
} else if (f > 1.0f) {
|
|
f = 1.0f;
|
|
}
|
|
rLottieDrawable.H = (int) (((float) rLottieDrawable.q[0]) * f);
|
|
rLottieDrawable.f2086y = false;
|
|
rLottieDrawable.F = false;
|
|
if (!rLottieDrawable.d()) {
|
|
rLottieDrawable.G = true;
|
|
}
|
|
rLottieDrawable.invalidateSelf();
|
|
}
|
|
}
|
|
}
|