discord-jadx/app/src/main/java/com/discord/widgets/phone/PhoneCountryCodeAdapter.java

60 lines
3.0 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.R;
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(R.layout.widget_phone_country_code_list_item, viewGroup, false);
int i2 = R.id.phone_country_code_code;
TextView textView = (TextView) inflate.findViewById(R.id.phone_country_code_code);
if (textView != null) {
ConstraintLayout constraintLayout = (ConstraintLayout) inflate;
TextView textView2 = (TextView) inflate.findViewById(R.id.phone_country_code_name);
if (textView2 != null) {
WidgetPhoneCountryCodeListItemBinding widgetPhoneCountryCodeListItemBinding = new WidgetPhoneCountryCodeListItemBinding(constraintLayout, textView, constraintLayout, textView2);
m.checkNotNullExpressionValue(widgetPhoneCountryCodeListItemBinding, "WidgetPhoneCountryCodeLi….context), parent, false)");
return new PhoneCountryCodeAdapterItem(this, widgetPhoneCountryCodeListItemBinding);
}
i2 = R.id.phone_country_code_name;
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
}
}