59 lines
2.8 KiB
Java
59 lines
2.8 KiB
Java
package com.discord.widgets.phone;
|
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.TextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import com.discord.databinding.WidgetPhoneCountryCodeListItemBinding;
|
|
import com.discord.models.phone.PhoneCountryCode;
|
|
import d0.t.n;
|
|
import d0.z.d.m;
|
|
import java.util.List;
|
|
/* compiled from: PhoneCountryCodeAdapter.kt */
|
|
public final class PhoneCountryCodeAdapter extends RecyclerView.Adapter<PhoneCountryCodeAdapterItem> {
|
|
private List<PhoneCountryCode> items = n.emptyList();
|
|
private OnCountryCodeSelectedListener onCountryCodeSelectedListener;
|
|
|
|
public final void configure(List<PhoneCountryCode> list, OnCountryCodeSelectedListener onCountryCodeSelectedListener) {
|
|
m.checkNotNullParameter(list, "countryCodes");
|
|
m.checkNotNullParameter(onCountryCodeSelectedListener, "onCountryCodeSelectedListener");
|
|
this.items = list;
|
|
this.onCountryCodeSelectedListener = onCountryCodeSelectedListener;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
public int getItemCount() {
|
|
return this.items.size();
|
|
}
|
|
|
|
public final OnCountryCodeSelectedListener getOnCountryCodeSelectedListener() {
|
|
return this.onCountryCodeSelectedListener;
|
|
}
|
|
|
|
public void onBindViewHolder(PhoneCountryCodeAdapterItem phoneCountryCodeAdapterItem, int i) {
|
|
m.checkNotNullParameter(phoneCountryCodeAdapterItem, "holder");
|
|
phoneCountryCodeAdapterItem.bind(this.items.get(i));
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
public PhoneCountryCodeAdapterItem onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(2131559113, viewGroup, false);
|
|
int i2 = 2131364252;
|
|
TextView textView = (TextView) inflate.findViewById(2131364252);
|
|
if (textView != null) {
|
|
ConstraintLayout constraintLayout = (ConstraintLayout) inflate;
|
|
TextView textView2 = (TextView) inflate.findViewById(2131364254);
|
|
if (textView2 != null) {
|
|
WidgetPhoneCountryCodeListItemBinding widgetPhoneCountryCodeListItemBinding = new WidgetPhoneCountryCodeListItemBinding(constraintLayout, textView, constraintLayout, textView2);
|
|
m.checkNotNullExpressionValue(widgetPhoneCountryCodeListItemBinding, "WidgetPhoneCountryCodeLi….context), parent, false)");
|
|
return new PhoneCountryCodeAdapterItem(this, widgetPhoneCountryCodeListItemBinding);
|
|
}
|
|
i2 = 2131364254;
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
|
|
}
|
|
}
|