package com.vinfast.companion.notification.ui.theftalert.images.adapter;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
@kotlin.Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0016\u0018\u00002\u00020\u0001:\u0002\u0006\u0007B\u000f\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005¨\u0006\b"}, d2 = {"Lcom/vinfast/companion/notification/ui/theftalert/images/adapter/TheftAlertImageViewHolder;", "Landroidx/recyclerview/widget/RecyclerView$ViewHolder;", "itemView", "Landroid/view/View;", "<init>", "(Landroid/view/View;)V", "Item", "Loading", "notification_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public class TheftAlertImageViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder {

    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000V\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B=\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0018\u0010\u0007\u001a\u0014\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\u0004\u0012\u0012\u0010\t\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\b¢\u0006\u0004\b\n\u0010\u000bJ%\u0010\u0011\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\f2\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u000f0\u000eH\u0002¢\u0006\u0004\b\u0011\u0010\u0012J\u0017\u0010\u0013\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\fH\u0002¢\u0006\u0004\b\u0013\u0010\u0014J3\u0010\u0018\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\f2\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u000f0\u000e2\u0006\u0010\u0016\u001a\u00020\u00152\u0006\u0010\u0017\u001a\u00020\u0015¢\u0006\u0004\b\u0018\u0010\u0019J\u0015\u0010\u001b\u001a\u00020\u00062\u0006\u0010\u001a\u001a\u00020\u0015¢\u0006\u0004\b\u001b\u0010\u001cJ\u0015\u0010\u001d\u001a\u00020\u00062\u0006\u0010\u0017\u001a\u00020\u0015¢\u0006\u0004\b\u001d\u0010\u001cR\u0014\u0010!\u001a\u00020\u001e8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001f\u0010 R&\u0010'\u001a\u0012\u0012\u0004\u0012\u00020#0\"j\b\u0012\u0004\u0012\u00020#`$8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b%\u0010&¨\u0006("}, d2 = {"Lcom/vinfast/companion/notification/ui/theftalert/images/adapter/TheftAlertImageViewHolder$Item;", "Lcom/vinfast/companion/notification/ui/theftalert/images/adapter/TheftAlertImageViewHolder;", "Landroid/view/View;", "itemView", "Lkotlin/Function2;", "", "", "onClickImageListener", "Lkotlin/Function1;", "onClickSelectListener", "<init>", "(Landroid/view/View;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;)V", "Lcom/vinfast/companion/notificationkit/domain/model/TheftAlertImageBundle;", "theftAlertImageBundle", "", "Lcom/vinfast/companion/notificationkit/domain/model/TheftAlertImagePosition;", "imageTypes", "n", "(Lcom/vinfast/companion/notificationkit/domain/model/TheftAlertImageBundle;Ljava/util/List;)V", "q", "(Lcom/vinfast/companion/notificationkit/domain/model/TheftAlertImageBundle;)V", "", "selectMode", "selected", "m", "(Lcom/vinfast/companion/notificationkit/domain/model/TheftAlertImageBundle;Ljava/util/List;ZZ)V", "selectedMode", "o", "(Z)V", "p", "Lcom/vinfast/companion/notification/databinding/ItemTheftAlertImageBinding;", "a", "Lcom/vinfast/companion/notification/databinding/ItemTheftAlertImageBinding;", "viewBinding", "Ljava/util/ArrayList;", "Lcom/vinfast/companion/core/widget/LoadingImageView;", "Lkotlin/collections/ArrayList;", "b", "Ljava/util/ArrayList;", "imageViews", "notification_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
    @kotlin.jvm.internal.SourceDebugExtension
    public static final class Item extends com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder {

        /* JADX INFO: renamed from: a, reason: from kotlin metadata */
        private final com.vinfast.companion.notification.databinding.ItemTheftAlertImageBinding viewBinding;

        /* JADX INFO: renamed from: b, reason: from kotlin metadata */
        private java.util.ArrayList imageViews;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public Item(android.view.View view, final kotlin.jvm.functions.Function2 function2, final kotlin.jvm.functions.Function1 function1) {
            super(view);
            kotlin.jvm.internal.Intrinsics.l(view, "itemView");
            kotlin.jvm.internal.Intrinsics.l(function2, "onClickImageListener");
            kotlin.jvm.internal.Intrinsics.l(function1, "onClickSelectListener");
            com.vinfast.companion.notification.databinding.ItemTheftAlertImageBinding itemTheftAlertImageBindingA = com.vinfast.companion.notification.databinding.ItemTheftAlertImageBinding.a(view);
            kotlin.jvm.internal.Intrinsics.k(itemTheftAlertImageBindingA, "bind(...)");
            this.viewBinding = itemTheftAlertImageBindingA;
            com.vinfast.companion.core.widget.LoadingImageView loadingImageView = itemTheftAlertImageBindingA.c;
            kotlin.jvm.internal.Intrinsics.k(loadingImageView, "imv0");
            com.vinfast.companion.core.widget.LoadingImageView loadingImageView2 = itemTheftAlertImageBindingA.d;
            kotlin.jvm.internal.Intrinsics.k(loadingImageView2, "imv1");
            com.vinfast.companion.core.widget.LoadingImageView loadingImageView3 = itemTheftAlertImageBindingA.e;
            kotlin.jvm.internal.Intrinsics.k(loadingImageView3, "imv2");
            com.vinfast.companion.core.widget.LoadingImageView loadingImageView4 = itemTheftAlertImageBindingA.f;
            kotlin.jvm.internal.Intrinsics.k(loadingImageView4, "imv3");
            com.vinfast.companion.core.widget.LoadingImageView loadingImageView5 = itemTheftAlertImageBindingA.g;
            kotlin.jvm.internal.Intrinsics.k(loadingImageView5, "imv4");
            this.imageViews = kotlin.collections.CollectionsKt.h(new com.vinfast.companion.core.widget.LoadingImageView[]{loadingImageView, loadingImageView2, loadingImageView3, loadingImageView4, loadingImageView5});
            itemTheftAlertImageBindingA.c.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.a
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.h(function2, this, view2);
                }
            });
            itemTheftAlertImageBindingA.d.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.b
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.i(function2, this, view2);
                }
            });
            itemTheftAlertImageBindingA.e.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.c
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.j(function2, this, view2);
                }
            });
            itemTheftAlertImageBindingA.f.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.d
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.k(function2, this, view2);
                }
            });
            itemTheftAlertImageBindingA.g.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.e
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.l(function2, this, view2);
                }
            });
            android.widget.ImageButton imageButton = itemTheftAlertImageBindingA.b;
            com.vinfast.companion.core.extensions.ViewExtensionKt.i(imageButton, 0.0f, 0.0f, 0.0f, 0.0f, 15, (java.lang.Object) null);
            imageButton.setOnClickListener(new android.view.View.OnClickListener() { // from class: t4.f
                @Override // android.view.View.OnClickListener
                public final void onClick(android.view.View view2) {
                    com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item.g(function1, this, view2);
                }
            });
        }

        public static void g(kotlin.jvm.functions.Function1 function1, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function1.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()));
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void h(kotlin.jvm.functions.Function2 function2, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function2.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()), 0);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void i(kotlin.jvm.functions.Function2 function2, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function2.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()), 1);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void j(kotlin.jvm.functions.Function2 function2, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function2.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()), 2);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void k(kotlin.jvm.functions.Function2 function2, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function2.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()), 3);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static final void l(kotlin.jvm.functions.Function2 function2, com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder.Item item, android.view.View view) {
            function2.invoke(java.lang.Integer.valueOf(item.getBindingAdapterPosition()), 4);
        }

        private final void n(com.vinfast.companion.notificationkit.domain.model.TheftAlertImageBundle theftAlertImageBundle, java.util.List imageTypes) {
            int i = 0;
            for (java.lang.Object obj : this.imageViews) {
                int i2 = i + 1;
                if (i < 0) {
                    kotlin.collections.CollectionsKt.y();
                }
                com.vinfast.companion.core.widget.LoadingImageView loadingImageView = (com.vinfast.companion.core.widget.LoadingImageView) obj;
                if (i < 0 || i >= imageTypes.size()) {
                    loadingImageView.setVisibility(8);
                } else {
                    com.vinfast.companion.notificationkit.domain.model.TheftAlertImagePosition theftAlertImagePosition = (com.vinfast.companion.notificationkit.domain.model.TheftAlertImagePosition) imageTypes.get(i);
                    loadingImageView.setTag(theftAlertImagePosition);
                    loadingImageView.setVisibility(0);
                    com.vinfast.companion.notificationkit.domain.model.TheftAlertImage theftAlertImage = (com.vinfast.companion.notificationkit.domain.model.TheftAlertImage) theftAlertImageBundle.b().get(theftAlertImagePosition);
                    loadingImageView.setImageSource(theftAlertImage != null ? theftAlertImage.d() : null);
                }
                i = i2;
            }
        }

        private final void q(com.vinfast.companion.notificationkit.domain.model.TheftAlertImageBundle theftAlertImageBundle) {
            java.util.Date dateA;
            android.widget.TextView textView = this.viewBinding.h;
            com.vinfast.companion.core.utils.TimeUtils timeUtils = com.vinfast.companion.core.utils.TimeUtils.a;
            android.content.Context context = ((androidx.recyclerview.widget.RecyclerView.ViewHolder) this).itemView.getContext();
            kotlin.jvm.internal.Intrinsics.k(context, "getContext(...)");
            com.vinfast.companion.notificationkit.domain.model.TheftAlertImage theftAlertImageA = theftAlertImageBundle.a();
            java.lang.Long lValueOf = (theftAlertImageA == null || (dateA = theftAlertImageA.a()) == null) ? null : java.lang.Long.valueOf(dateA.getTime());
            android.content.Context context2 = ((androidx.recyclerview.widget.RecyclerView.ViewHolder) this).itemView.getContext();
            kotlin.jvm.internal.Intrinsics.k(context2, "getContext(...)");
            textView.setText(timeUtils.f0(context, lValueOf, com.vinfast.companion.core.utils.localehelper.LocaleHelperExtensionsKt.b(context2)));
        }

        public final void m(com.vinfast.companion.notificationkit.domain.model.TheftAlertImageBundle theftAlertImageBundle, java.util.List imageTypes, boolean selectMode, boolean selected) {
            kotlin.jvm.internal.Intrinsics.l(theftAlertImageBundle, "theftAlertImageBundle");
            kotlin.jvm.internal.Intrinsics.l(imageTypes, "imageTypes");
            q(theftAlertImageBundle);
            n(theftAlertImageBundle, imageTypes);
            o(selectMode);
            p(selected);
        }

        public final void o(boolean selectedMode) {
            android.widget.ImageButton imageButton = this.viewBinding.b;
            kotlin.jvm.internal.Intrinsics.k(imageButton, "imbSelected");
            imageButton.setVisibility(selectedMode ? 0 : 8);
        }

        public final void p(boolean selected) {
            if (selected) {
                this.viewBinding.b.setImageResource(com.vinfast.companion.notification.R.drawable.ic_checkbox_circle_selected);
            } else {
                this.viewBinding.b.setImageResource(com.vinfast.companion.notification.R.drawable.ic_checkbox_circle_unselected);
            }
        }
    }

    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005¨\u0006\u0006"}, d2 = {"Lcom/vinfast/companion/notification/ui/theftalert/images/adapter/TheftAlertImageViewHolder$Loading;", "Lcom/vinfast/companion/notification/ui/theftalert/images/adapter/TheftAlertImageViewHolder;", "itemView", "Landroid/view/View;", "<init>", "(Landroid/view/View;)V", "notification_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
    public static final class Loading extends com.vinfast.companion.notification.ui.theftalert.images.adapter.TheftAlertImageViewHolder {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public Loading(android.view.View view) {
            super(view);
            kotlin.jvm.internal.Intrinsics.l(view, "itemView");
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public TheftAlertImageViewHolder(android.view.View view) {
        super(view);
        kotlin.jvm.internal.Intrinsics.l(view, "itemView");
    }
}
