package com.vinfast.companion.core.base.ui.widget;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0010\b\u0016\u0018\u0000 \u001e2\u00020\u0001:\u0001\u001fB\u001b\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004¢\u0006\u0004\b\u0006\u0010\u0007B#\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004\u0012\u0006\u0010\t\u001a\u00020\b¢\u0006\u0004\b\u0006\u0010\nJ\u0019\u0010\f\u001a\u00020\u000b2\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0002¢\u0006\u0004\b\f\u0010\rJ\u000f\u0010\u000e\u001a\u00020\u000bH\u0002¢\u0006\u0004\b\u000e\u0010\u000fR*\u0010\u0018\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00108\u0006@FX\u0086\u000e¢\u0006\u0012\n\u0004\b\u0012\u0010\u0013\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R\u0016\u0010\u001b\u001a\u00020\b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0019\u0010\u001aR\u0016\u0010\u001d\u001a\u00020\b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001c\u0010\u001a¨\u0006 "}, d2 = {"Lcom/vinfast/companion/core/base/ui/widget/LottieAnimationViewWithLoading;", "Lcom/airbnb/lottie/LottieAnimationView;", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "", "defStyleAttr", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "", "v", "(Landroid/util/AttributeSet;)V", "w", "()V", "", "value", "p", "Z", "getOnLoading", "()Z", "setOnLoading", "(Z)V", "onLoading", "q", "I", "staticImageRes", "r", "loadingAnimationRes", "s", "Companion", "core_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public class LottieAnimationViewWithLoading extends com.airbnb.lottie.LottieAnimationView {

    /* JADX INFO: renamed from: p, reason: from kotlin metadata */
    private boolean onLoading;

    /* JADX INFO: renamed from: q, reason: from kotlin metadata */
    private int staticImageRes;

    /* JADX INFO: renamed from: r, reason: from kotlin metadata */
    private int loadingAnimationRes;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public LottieAnimationViewWithLoading(@org.jetbrains.annotations.NotNull android.content.Context context, @org.jetbrains.annotations.Nullable android.util.AttributeSet attributeSet) {
        super(context, attributeSet);
        kotlin.jvm.internal.Intrinsics.l(context, "context");
        this.staticImageRes = -1;
        this.loadingAnimationRes = com.vinfast.companion.core.R.raw.ic_loading_circle;
        v(attributeSet);
    }

    /* JADX WARN: Multi-variable type inference failed */
    private final void v(android.util.AttributeSet attrs) {
        if (attrs != null) {
            this.staticImageRes = attrs.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "src", -1);
            android.content.res.TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attrs, com.vinfast.companion.core.R.styleable.LottieAnimationViewWithLoading);
            kotlin.jvm.internal.Intrinsics.k(typedArrayObtainStyledAttributes, "obtainStyledAttributes(...)");
            this.loadingAnimationRes = typedArrayObtainStyledAttributes.getResourceId(com.vinfast.companion.core.R.styleable.LottieAnimationViewWithLoading_loadingAnimationRes, this.loadingAnimationRes);
            setOnLoading(typedArrayObtainStyledAttributes.getBoolean(com.vinfast.companion.core.R.styleable.LottieAnimationViewWithLoading_onLoading, this.onLoading));
            typedArrayObtainStyledAttributes.recycle();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    private final void w() {
        if (!this.onLoading) {
            int i = this.staticImageRes;
            if (i != -1) {
                setImageResource(i);
                return;
            }
            return;
        }
        com.airbnb.lottie.LottieDrawable lottieDrawable = new com.airbnb.lottie.LottieDrawable();
        lottieDrawable.t0((com.airbnb.lottie.LottieComposition) com.airbnb.lottie.LottieCompositionFactory.A(getContext(), this.loadingAnimationRes).b());
        lottieDrawable.T0(1.0f);
        lottieDrawable.Q0(-1);
        lottieDrawable.k0();
        setImageDrawable(lottieDrawable);
    }

    public final boolean getOnLoading() {
        return this.onLoading;
    }

    public final void setOnLoading(boolean z) {
        if (this.onLoading != z) {
            this.onLoading = z;
            w();
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public LottieAnimationViewWithLoading(@org.jetbrains.annotations.NotNull android.content.Context context, @org.jetbrains.annotations.Nullable android.util.AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        kotlin.jvm.internal.Intrinsics.l(context, "context");
        this.staticImageRes = -1;
        this.loadingAnimationRes = com.vinfast.companion.core.R.raw.ic_loading_circle;
        v(attributeSet);
    }
}
