package com.vinfast.companion.main.widget.remotecontrol;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u00002\u00020\u0001B\u0011\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0004\b\u0004\u0010\u0005B\u001b\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006¢\u0006\u0004\b\u0004\u0010\bB#\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006\u0012\u0006\u0010\n\u001a\u00020\t¢\u0006\u0004\b\u0004\u0010\u000bJ\u000f\u0010\r\u001a\u00020\fH\u0002¢\u0006\u0004\b\r\u0010\u000eJ\u001b\u0010\u0012\u001a\u00020\f2\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00100\u000f¢\u0006\u0004\b\u0012\u0010\u0013J!\u0010\u0016\u001a\u00020\f2\u0012\u0010\u0015\u001a\u000e\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\f0\u0014¢\u0006\u0004\b\u0016\u0010\u0017J\u0015\u0010\u0019\u001a\u00020\f2\u0006\u0010\u0018\u001a\u00020\t¢\u0006\u0004\b\u0019\u0010\u001aJ\r\u0010\u001c\u001a\u00020\u001b¢\u0006\u0004\b\u001c\u0010\u001dR\u0016\u0010!\u001a\u00020\u001e8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b\u001f\u0010 R$\u0010$\u001a\u0010\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\f\u0018\u00010\u00148\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\"\u0010#¨\u0006%"}, d2 = {"Lcom/vinfast/companion/main/widget/remotecontrol/RemoteControlView;", "Landroidx/recyclerview/widget/RecyclerView;", "Landroid/content/Context;", "context", "<init>", "(Landroid/content/Context;)V", "Landroid/util/AttributeSet;", "attrs", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "defStyleAttr", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Q", "()V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/main/ui/home/model/RemoteControl;", "items", "setItems", "(Ljava/util/List;)V", "Lkotlin/Function1;", "listener", "setOnClickItemListener", "(Lkotlin/jvm/functions/Function1;)V", "position", "T", "(I)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "S", "()Z", "Lcom/vinfast/companion/main/widget/remotecontrol/RemoteControlAdapter;", "a", "Lcom/vinfast/companion/main/widget/remotecontrol/RemoteControlAdapter;", "remoteControlAdapter", "b", "Lkotlin/jvm/functions/Function1;", "onClickItemListener", "main_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class RemoteControlView extends androidx.recyclerview.widget.RecyclerView {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter remoteControlAdapter;

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private kotlin.jvm.functions.Function1 onClickItemListener;

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public RemoteControlView(@org.jetbrains.annotations.NotNull android.content.Context context) {
        this(context, null);
        kotlin.jvm.internal.Intrinsics.l(context, "context");
    }

    /* JADX WARN: Multi-variable type inference failed */
    private final void Q() {
        setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext(), 0, false));
        com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter remoteControlAdapter = new com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter(new kotlin.jvm.functions.Function1() { // from class: k4.a
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.companion.main.widget.remotecontrol.RemoteControlView.R(this.a, ((java.lang.Integer) obj).intValue());
            }
        });
        this.remoteControlAdapter = remoteControlAdapter;
        setAdapter(remoteControlAdapter);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final kotlin.Unit R(com.vinfast.companion.main.widget.remotecontrol.RemoteControlView remoteControlView, int i) {
        kotlin.jvm.functions.Function1 function1 = remoteControlView.onClickItemListener;
        if (function1 != null) {
            function1.invoke(java.lang.Integer.valueOf(i));
        }
        return kotlin.Unit.a;
    }

    public final boolean S() {
        com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter remoteControlAdapter = this.remoteControlAdapter;
        if (remoteControlAdapter == null) {
            kotlin.jvm.internal.Intrinsics.C("remoteControlAdapter");
            remoteControlAdapter = null;
        }
        return remoteControlAdapter.h();
    }

    public final void T(int position) {
        com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter remoteControlAdapter = this.remoteControlAdapter;
        if (remoteControlAdapter == null) {
            kotlin.jvm.internal.Intrinsics.C("remoteControlAdapter");
            remoteControlAdapter = null;
        }
        remoteControlAdapter.notifyItemChanged(position, 2);
    }

    public final void setItems(@org.jetbrains.annotations.NotNull java.util.List<com.vinfast.companion.main.ui.home.model.RemoteControl> items) {
        kotlin.jvm.internal.Intrinsics.l(items, "items");
        com.vinfast.companion.main.widget.remotecontrol.RemoteControlAdapter remoteControlAdapter = this.remoteControlAdapter;
        if (remoteControlAdapter == null) {
            kotlin.jvm.internal.Intrinsics.C("remoteControlAdapter");
            remoteControlAdapter = null;
        }
        remoteControlAdapter.l(items);
    }

    public final void setOnClickItemListener(@org.jetbrains.annotations.NotNull kotlin.jvm.functions.Function1<? super java.lang.Integer, kotlin.Unit> listener) {
        kotlin.jvm.internal.Intrinsics.l(listener, "listener");
        this.onClickItemListener = listener;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public RemoteControlView(@org.jetbrains.annotations.NotNull android.content.Context context, @org.jetbrains.annotations.Nullable android.util.AttributeSet attributeSet) {
        this(context, attributeSet, 0);
        kotlin.jvm.internal.Intrinsics.l(context, "context");
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public RemoteControlView(@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");
        Q();
    }
}
