163 lines
7.1 KiB
Java
163 lines
7.1 KiB
Java
|
package com.discord.widgets.servers.premiumguild;
|
||
|
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.TextView;
|
||
|
import androidx.annotation.DrawableRes;
|
||
|
import androidx.recyclerview.widget.RecyclerView;
|
||
|
import c.d.b.a.a;
|
||
|
import com.discord.databinding.ViewNitroBoostPerksListItemBinding;
|
||
|
import com.discord.utilities.drawable.DrawableCompat;
|
||
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapterSimple;
|
||
|
import com.discord.utilities.mg_recycler.MGRecyclerDataPayload;
|
||
|
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder;
|
||
|
import d0.z.d.m;
|
||
|
import java.util.List;
|
||
|
import java.util.Objects;
|
||
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||
|
/* compiled from: PremiumGuildSubscriptionPerkViewAdapter.kt */
|
||
|
public final class PremiumGuildSubscriptionPerkViewAdapter extends MGRecyclerAdapterSimple<PremiumGuildSubscriptionPerkViewListItem> {
|
||
|
|
||
|
/* compiled from: PremiumGuildSubscriptionPerkViewAdapter.kt */
|
||
|
public static final class PerkViewHolder extends MGRecyclerViewHolder<PremiumGuildSubscriptionPerkViewAdapter, PremiumGuildSubscriptionPerkViewListItem> {
|
||
|
private final ViewNitroBoostPerksListItemBinding binding;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public PerkViewHolder(PremiumGuildSubscriptionPerkViewAdapter premiumGuildSubscriptionPerkViewAdapter) {
|
||
|
super(2131558777, premiumGuildSubscriptionPerkViewAdapter);
|
||
|
m.checkNotNullParameter(premiumGuildSubscriptionPerkViewAdapter, "adapter");
|
||
|
View view = this.itemView;
|
||
|
Objects.requireNonNull(view, "rootView");
|
||
|
TextView textView = (TextView) view;
|
||
|
ViewNitroBoostPerksListItemBinding viewNitroBoostPerksListItemBinding = new ViewNitroBoostPerksListItemBinding(textView, textView);
|
||
|
m.checkNotNullExpressionValue(viewNitroBoostPerksListItemBinding, "ViewNitroBoostPerksListItemBinding.bind(itemView)");
|
||
|
this.binding = viewNitroBoostPerksListItemBinding;
|
||
|
}
|
||
|
|
||
|
public void onConfigure(int i, PremiumGuildSubscriptionPerkViewListItem premiumGuildSubscriptionPerkViewListItem) {
|
||
|
m.checkNotNullParameter(premiumGuildSubscriptionPerkViewListItem, "data");
|
||
|
super.onConfigure(i, (int) premiumGuildSubscriptionPerkViewListItem);
|
||
|
TextView textView = this.binding.b;
|
||
|
m.checkNotNullExpressionValue(textView, "binding.perkViewContentListItem");
|
||
|
textView.setText(premiumGuildSubscriptionPerkViewListItem.getText());
|
||
|
TextView textView2 = this.binding.b;
|
||
|
m.checkNotNullExpressionValue(textView2, "binding.perkViewContentListItem");
|
||
|
DrawableCompat.setCompoundDrawablesCompat$default(textView2, premiumGuildSubscriptionPerkViewListItem.getIconResId(), 0, 0, 0, 14, (Object) null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* compiled from: PremiumGuildSubscriptionPerkViewAdapter.kt */
|
||
|
public static final class PremiumGuildSubscriptionPerkViewListItem implements MGRecyclerDataPayload {
|
||
|
public static final Companion Companion = new Companion(null);
|
||
|
public static final int TYPE_LIST_ITEM = 1;
|
||
|
private final int iconResId;
|
||
|
private final String key;
|
||
|
private final CharSequence text;
|
||
|
private final int type = 1;
|
||
|
|
||
|
/* compiled from: PremiumGuildSubscriptionPerkViewAdapter.kt */
|
||
|
public static final class Companion {
|
||
|
private Companion() {
|
||
|
}
|
||
|
|
||
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||
|
this();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public PremiumGuildSubscriptionPerkViewListItem(@DrawableRes int i, CharSequence charSequence) {
|
||
|
m.checkNotNullParameter(charSequence, "text");
|
||
|
this.iconResId = i;
|
||
|
this.text = charSequence;
|
||
|
this.key = charSequence.toString();
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ PremiumGuildSubscriptionPerkViewListItem copy$default(PremiumGuildSubscriptionPerkViewListItem premiumGuildSubscriptionPerkViewListItem, int i, CharSequence charSequence, int i2, Object obj) {
|
||
|
if ((i2 & 1) != 0) {
|
||
|
i = premiumGuildSubscriptionPerkViewListItem.iconResId;
|
||
|
}
|
||
|
if ((i2 & 2) != 0) {
|
||
|
charSequence = premiumGuildSubscriptionPerkViewListItem.text;
|
||
|
}
|
||
|
return premiumGuildSubscriptionPerkViewListItem.copy(i, charSequence);
|
||
|
}
|
||
|
|
||
|
public final int component1() {
|
||
|
return this.iconResId;
|
||
|
}
|
||
|
|
||
|
public final CharSequence component2() {
|
||
|
return this.text;
|
||
|
}
|
||
|
|
||
|
public final PremiumGuildSubscriptionPerkViewListItem copy(@DrawableRes int i, CharSequence charSequence) {
|
||
|
m.checkNotNullParameter(charSequence, "text");
|
||
|
return new PremiumGuildSubscriptionPerkViewListItem(i, charSequence);
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (!(obj instanceof PremiumGuildSubscriptionPerkViewListItem)) {
|
||
|
return false;
|
||
|
}
|
||
|
PremiumGuildSubscriptionPerkViewListItem premiumGuildSubscriptionPerkViewListItem = (PremiumGuildSubscriptionPerkViewListItem) obj;
|
||
|
return this.iconResId == premiumGuildSubscriptionPerkViewListItem.iconResId && m.areEqual(this.text, premiumGuildSubscriptionPerkViewListItem.text);
|
||
|
}
|
||
|
|
||
|
public final int getIconResId() {
|
||
|
return this.iconResId;
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
||
|
public String getKey() {
|
||
|
return this.key;
|
||
|
}
|
||
|
|
||
|
public final CharSequence getText() {
|
||
|
return this.text;
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
||
|
public int getType() {
|
||
|
return this.type;
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
int i = this.iconResId * 31;
|
||
|
CharSequence charSequence = this.text;
|
||
|
return i + (charSequence != null ? charSequence.hashCode() : 0);
|
||
|
}
|
||
|
|
||
|
public String toString() {
|
||
|
StringBuilder K = a.K("PremiumGuildSubscriptionPerkViewListItem(iconResId=");
|
||
|
K.append(this.iconResId);
|
||
|
K.append(", text=");
|
||
|
K.append(this.text);
|
||
|
K.append(")");
|
||
|
return K.toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public PremiumGuildSubscriptionPerkViewAdapter(RecyclerView recyclerView) {
|
||
|
super(recyclerView, false, 2, null);
|
||
|
m.checkNotNullParameter(recyclerView, "recycler");
|
||
|
}
|
||
|
|
||
|
public final void configure(List<PremiumGuildSubscriptionPerkViewListItem> list) {
|
||
|
m.checkNotNullParameter(list, "perkItems");
|
||
|
setData(list);
|
||
|
}
|
||
|
|
||
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
||
|
public PerkViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
||
|
m.checkNotNullParameter(viewGroup, "parent");
|
||
|
if (i == 1) {
|
||
|
return new PerkViewHolder(this);
|
||
|
}
|
||
|
throw invalidViewTypeException(i);
|
||
|
}
|
||
|
}
|