package com.discord.widgets.stage.start; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.recyclerview.widget.RecyclerView; import c.a.k.b; import com.discord.databinding.StartStageHeaderItemBinding; import com.discord.databinding.StartStageListItemBinding; import com.discord.utilities.color.ColorCompatKt; import com.discord.utilities.mg_recycler.MGRecyclerAdapterSimple; import com.discord.utilities.mg_recycler.MGRecyclerViewHolder; import com.discord.widgets.stage.start.StartStageItem; import com.google.android.material.textview.MaterialTextView; import d0.z.d.m; import kotlin.Unit; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; /* compiled from: StartStageAdapter.kt */ public final class StartStageAdapter extends MGRecyclerAdapterSimple { private final Function1 onItemClicked; /* compiled from: StartStageAdapter.kt */ public abstract class CreateStageEventViewHolder extends MGRecyclerViewHolder { private final View rootView; public final /* synthetic */ StartStageAdapter this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public CreateStageEventViewHolder(StartStageAdapter startStageAdapter, View view) { super(view, startStageAdapter); m.checkNotNullParameter(view, "rootView"); this.this$0 = startStageAdapter; this.rootView = view; } public final View getRootView() { return this.rootView; } public void onConfigure(int i, StartStageItem startStageItem) { m.checkNotNullParameter(startStageItem, "data"); super.onConfigure(i, (int) startStageItem); this.rootView.setOnClickListener(new StartStageAdapter$CreateStageEventViewHolder$onConfigure$1(this, startStageItem)); } } /* compiled from: StartStageAdapter.kt */ public final class HeaderViewHolder extends CreateStageEventViewHolder { private final StartStageHeaderItemBinding binding; public final /* synthetic */ StartStageAdapter this$0; /* JADX WARNING: Illegal instructions before constructor call */ public HeaderViewHolder(StartStageAdapter startStageAdapter, StartStageHeaderItemBinding startStageHeaderItemBinding) { super(startStageAdapter, r0); m.checkNotNullParameter(startStageHeaderItemBinding, "binding"); this.this$0 = startStageAdapter; ConstraintLayout constraintLayout = startStageHeaderItemBinding.a; m.checkNotNullExpressionValue(constraintLayout, "binding.root"); this.binding = startStageHeaderItemBinding; } /* JADX WARNING: Illegal instructions before constructor call */ public HeaderViewHolder(StartStageAdapter startStageAdapter, StartStageHeaderItemBinding startStageHeaderItemBinding, int i, DefaultConstructorMarker defaultConstructorMarker) { this(startStageAdapter, startStageHeaderItemBinding); if ((i & 1) != 0) { View inflate = LayoutInflater.from(startStageAdapter.getContext()).inflate(2131558668, (ViewGroup) startStageAdapter.getRecycler(), false); int i2 = 2131365157; ImageView imageView = (ImageView) inflate.findViewById(2131365157); if (imageView != null) { i2 = 2131365172; TextView textView = (TextView) inflate.findViewById(2131365172); if (textView != null) { i2 = 2131365173; TextView textView2 = (TextView) inflate.findViewById(2131365173); if (textView2 != null) { StartStageHeaderItemBinding startStageHeaderItemBinding2 = new StartStageHeaderItemBinding((ConstraintLayout) inflate, imageView, textView, textView2); m.checkNotNullExpressionValue(startStageHeaderItemBinding2, "StartStageHeaderItemBind…ontext), recycler, false)"); startStageHeaderItemBinding = startStageHeaderItemBinding2; } } } throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2))); } } public final StartStageHeaderItemBinding getBinding() { return this.binding; } } /* compiled from: StartStageAdapter.kt */ public final class ListItemViewHolder extends CreateStageEventViewHolder { private final StartStageListItemBinding binding; public final /* synthetic */ StartStageAdapter this$0; /* JADX WARNING: Illegal instructions before constructor call */ public ListItemViewHolder(StartStageAdapter startStageAdapter, StartStageListItemBinding startStageListItemBinding) { super(startStageAdapter, r0); m.checkNotNullParameter(startStageListItemBinding, "binding"); this.this$0 = startStageAdapter; ConstraintLayout constraintLayout = startStageListItemBinding.a; m.checkNotNullExpressionValue(constraintLayout, "binding.root"); this.binding = startStageListItemBinding; } /* JADX WARNING: Illegal instructions before constructor call */ public ListItemViewHolder(StartStageAdapter startStageAdapter, StartStageListItemBinding startStageListItemBinding, int i, DefaultConstructorMarker defaultConstructorMarker) { this(startStageAdapter, startStageListItemBinding); if ((i & 1) != 0) { View inflate = LayoutInflater.from(startStageAdapter.getContext()).inflate(2131558669, (ViewGroup) startStageAdapter.getRecycler(), false); int i2 = 2131361984; ImageView imageView = (ImageView) inflate.findViewById(2131361984); if (imageView != null) { i2 = 2131363614; ImageView imageView2 = (ImageView) inflate.findViewById(2131363614); if (imageView2 != null) { i2 = 2131363615; ImageView imageView3 = (ImageView) inflate.findViewById(2131363615); if (imageView3 != null) { i2 = 2131365255; MaterialTextView materialTextView = (MaterialTextView) inflate.findViewById(2131365255); if (materialTextView != null) { i2 = 2131365427; MaterialTextView materialTextView2 = (MaterialTextView) inflate.findViewById(2131365427); if (materialTextView2 != null) { StartStageListItemBinding startStageListItemBinding2 = new StartStageListItemBinding((ConstraintLayout) inflate, imageView, imageView2, imageView3, materialTextView, materialTextView2); m.checkNotNullExpressionValue(startStageListItemBinding2, "StartStageListItemBindin…ontext), recycler, false)"); startStageListItemBinding = startStageListItemBinding2; } } } } } throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2))); } } public final StartStageListItemBinding getBinding() { return this.binding; } @Override // com.discord.widgets.stage.start.StartStageAdapter.CreateStageEventViewHolder public void onConfigure(int i, StartStageItem startStageItem) { m.checkNotNullParameter(startStageItem, "data"); super.onConfigure(i, startStageItem); StartStageItem.ListItem listItem = (StartStageItem.ListItem) startStageItem; this.binding.b.setImageResource(listItem.getIconRes()); ImageView imageView = this.binding.f1632c; m.checkNotNullExpressionValue(imageView, "binding.iconBg"); ColorCompatKt.tintWithColorResource(imageView, listItem.getIconBgColorRes()); MaterialTextView materialTextView = this.binding.e; m.checkNotNullExpressionValue(materialTextView, "binding.title"); materialTextView.setText(b.g(this.this$0.getContext(), listItem.getTitleRes(), new Object[0], null, 4)); MaterialTextView materialTextView2 = this.binding.d; m.checkNotNullExpressionValue(materialTextView2, "binding.subtitle"); materialTextView2.setText(b.g(this.this$0.getContext(), listItem.getSubtitleRes(), new Object[0], null, 4)); } } /* JADX DEBUG: Multi-variable search result rejected for r5v0, resolved type: kotlin.jvm.functions.Function1 */ /* JADX WARN: Multi-variable type inference failed */ /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public StartStageAdapter(RecyclerView recyclerView, Function1 function1) { super(recyclerView, false, 2, null); m.checkNotNullParameter(recyclerView, "recyclerView"); m.checkNotNullParameter(function1, "onItemClicked"); this.onItemClicked = function1; } public final Function1 getOnItemClicked() { return this.onItemClicked; } @Override // androidx.recyclerview.widget.RecyclerView.Adapter public MGRecyclerViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { m.checkNotNullParameter(viewGroup, "parent"); if (i == 0) { return new HeaderViewHolder(this, null, 1, null); } if (i == 1) { return new ListItemViewHolder(this, null, 1, null); } throw invalidViewTypeException(i); } }