2021-08-10 21:19:22 +00:00
|
|
|
package com.discord.widgets.guild_role_subscriptions;
|
|
|
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import com.discord.databinding.DialogSimpleSelectorItemBinding;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.t.n;
|
|
|
|
import d0.z.d.m;
|
2021-08-10 21:19:22 +00:00
|
|
|
import java.util.List;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: WidgetPriceTierPickerBottomSheet.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-08-10 21:19:22 +00:00
|
|
|
public final class PriceTierPickerAdapter extends RecyclerView.Adapter<PriceTierViewHolder> {
|
|
|
|
private final Function1<Integer, Unit> itemClickListener;
|
|
|
|
private List<Integer> items = n.emptyList();
|
|
|
|
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public PriceTierPickerAdapter(Function1<? super Integer, Unit> function1) {
|
|
|
|
m.checkNotNullParameter(function1, "itemClickListener");
|
|
|
|
this.itemClickListener = function1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
|
|
public int getItemCount() {
|
|
|
|
return this.items.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onBindViewHolder(PriceTierViewHolder priceTierViewHolder, int i) {
|
|
|
|
m.checkNotNullParameter(priceTierViewHolder, "holder");
|
|
|
|
priceTierViewHolder.configureUI(this.items.get(i).intValue(), this.itemClickListener);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
|
|
public PriceTierViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
|
|
DialogSimpleSelectorItemBinding a = DialogSimpleSelectorItemBinding.a(LayoutInflater.from(viewGroup.getContext()), viewGroup, false);
|
|
|
|
m.checkNotNullExpressionValue(a, "DialogSimpleSelectorItem…rent,\n false\n )");
|
|
|
|
return new PriceTierViewHolder(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void setItems(List<Integer> list) {
|
|
|
|
m.checkNotNullParameter(list, "newItems");
|
|
|
|
this.items = list;
|
|
|
|
notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
}
|