discord-jadx/app/src/main/java/com/discord/tooltips/SparkleView.java

65 lines
2.4 KiB
Java

package com.discord.tooltips;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
import c.a.i.n1;
import c.a.v.c;
import c.a.v.d;
import com.discord.R;
import d0.g;
import d0.z.d.m;
import kotlin.Lazy;
/* compiled from: SparkleView.kt */
public final class SparkleView extends FrameLayout {
public final n1 i;
public int j;
public final Lazy k;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public SparkleView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
m.checkNotNullParameter(context, "context");
LayoutInflater.from(getContext()).inflate(R.layout.sparkle_view, this);
ImageView imageView = (ImageView) findViewById(R.id.sparkle_view_image);
if (imageView != null) {
n1 n1Var = new n1(this, imageView);
m.checkNotNullExpressionValue(n1Var, "SparkleViewBinding.infla…ater.from(context), this)");
this.i = n1Var;
this.j = R.drawable.sparkle_animated_vector;
this.k = g.lazy(new c(this));
setLayoutParams(new FrameLayout.LayoutParams(-2, -2));
imageView.setImageDrawable(getSparkleDrawable());
AnimatedVectorDrawableCompat sparkleDrawable = getSparkleDrawable();
if (sparkleDrawable != null) {
sparkleDrawable.registerAnimationCallback(new d(this));
}
AnimatedVectorDrawableCompat sparkleDrawable2 = getSparkleDrawable();
if (sparkleDrawable2 != null) {
sparkleDrawable2.start();
return;
}
return;
}
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(R.id.sparkle_view_image)));
}
public static final /* synthetic */ AnimatedVectorDrawableCompat a(SparkleView sparkleView) {
return sparkleView.getSparkleDrawable();
}
private final AnimatedVectorDrawableCompat getSparkleDrawable() {
return (AnimatedVectorDrawableCompat) this.k.getValue();
}
public final void b() {
AnimatedVectorDrawableCompat sparkleDrawable = getSparkleDrawable();
if (sparkleDrawable != null) {
sparkleDrawable.stop();
}
}
}