2021-08-03 07:33:18 +00:00
|
|
|
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");
|
2021-08-03 17:47:25 +00:00
|
|
|
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(2131559168, viewGroup, false);
|
|
|
|
int i2 = 2131364408;
|
|
|
|
TextView textView = (TextView) inflate.findViewById(2131364408);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView != null) {
|
|
|
|
ConstraintLayout constraintLayout = (ConstraintLayout) inflate;
|
2021-08-03 17:47:25 +00:00
|
|
|
TextView textView2 = (TextView) inflate.findViewById(2131364410);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView2 != null) {
|
|
|
|
WidgetPhoneCountryCodeListItemBinding widgetPhoneCountryCodeListItemBinding = new WidgetPhoneCountryCodeListItemBinding(constraintLayout, textView, constraintLayout, textView2);
|
|
|
|
m.checkNotNullExpressionValue(widgetPhoneCountryCodeListItemBinding, "WidgetPhoneCountryCodeLi….context), parent, false)");
|
|
|
|
return new PhoneCountryCodeAdapterItem(this, widgetPhoneCountryCodeListItemBinding);
|
|
|
|
}
|
2021-08-03 17:47:25 +00:00
|
|
|
i2 = 2131364410;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
|
|
|
|
}
|
|
|
|
}
|