119 lines
6 KiB
Java
119 lines
6 KiB
Java
package com.discord.widgets.guildscheduledevent;
|
|
|
|
import android.text.format.DateUtils;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import com.discord.databinding.GuildScheduledEventListItemBinding;
|
|
import com.discord.utilities.color.ColorCompatKt;
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapterSimple;
|
|
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.widgets.guildscheduledevent.GuildScheduledEventListItem;
|
|
import d0.z.d.m;
|
|
/* compiled from: GuildScheduledEventListAdapter.kt */
|
|
public final class GuildScheduledEventListAdapter extends MGRecyclerAdapterSimple<GuildScheduledEventListItem> {
|
|
|
|
/* compiled from: GuildScheduledEventListAdapter.kt */
|
|
public final class EventViewHolder extends MGRecyclerViewHolder<GuildScheduledEventListAdapter, GuildScheduledEventListItem> {
|
|
private final GuildScheduledEventListItemBinding binding;
|
|
|
|
public EventViewHolder() {
|
|
super(2131558518, GuildScheduledEventListAdapter.this);
|
|
View view = this.itemView;
|
|
int i = 2131363505;
|
|
ImageView imageView = (ImageView) view.findViewById(2131363505);
|
|
if (imageView != null) {
|
|
i = 2131363506;
|
|
TextView textView = (TextView) view.findViewById(2131363506);
|
|
if (textView != null) {
|
|
i = 2131363507;
|
|
TextView textView2 = (TextView) view.findViewById(2131363507);
|
|
if (textView2 != null) {
|
|
i = 2131363508;
|
|
TextView textView3 = (TextView) view.findViewById(2131363508);
|
|
if (textView3 != null) {
|
|
i = 2131363509;
|
|
ImageView imageView2 = (ImageView) view.findViewById(2131363509);
|
|
if (imageView2 != null) {
|
|
i = 2131363510;
|
|
TextView textView4 = (TextView) view.findViewById(2131363510);
|
|
if (textView4 != null) {
|
|
i = 2131363511;
|
|
ImageView imageView3 = (ImageView) view.findViewById(2131363511);
|
|
if (imageView3 != null) {
|
|
i = 2131363512;
|
|
TextView textView5 = (TextView) view.findViewById(2131363512);
|
|
if (textView5 != null) {
|
|
GuildScheduledEventListItemBinding guildScheduledEventListItemBinding = new GuildScheduledEventListItemBinding((ConstraintLayout) view, imageView, textView, textView2, textView3, imageView2, textView4, imageView3, textView5);
|
|
m.checkNotNullExpressionValue(guildScheduledEventListItemBinding, "GuildScheduledEventListItemBinding.bind(itemView)");
|
|
this.binding = guildScheduledEventListItemBinding;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
|
|
}
|
|
|
|
public final GuildScheduledEventListItemBinding getBinding() {
|
|
return this.binding;
|
|
}
|
|
|
|
public void onConfigure(int i, GuildScheduledEventListItem guildScheduledEventListItem) {
|
|
int i2;
|
|
m.checkNotNullParameter(guildScheduledEventListItem, "data");
|
|
super.onConfigure(i, (int) guildScheduledEventListItem);
|
|
GuildScheduledEventListItem.Event event = (GuildScheduledEventListItem.Event) guildScheduledEventListItem;
|
|
ImageView imageView = this.binding.e;
|
|
imageView.setImageResource(2131231601);
|
|
ColorCompatKt.tintWithColorResource(imageView, 2131099761);
|
|
TextView textView = this.binding.d;
|
|
Integer e = event.getEvent().e();
|
|
int i3 = 0;
|
|
if (e != null) {
|
|
textView.setText(String.valueOf(e.intValue()));
|
|
i2 = 0;
|
|
} else {
|
|
i2 = 4;
|
|
}
|
|
textView.setVisibility(i2);
|
|
Integer e2 = event.getEvent().e();
|
|
if (e2 != null) {
|
|
i3 = e2.intValue();
|
|
}
|
|
textView.setText(String.valueOf(i3));
|
|
TextView textView2 = this.binding.b;
|
|
textView2.setText(DateUtils.formatDateTime(textView2.getContext(), event.getEvent().d().f(), 524310));
|
|
TextView textView3 = this.binding.f;
|
|
m.checkNotNullExpressionValue(textView3, "binding.guildScheduledEventListItemTitleText");
|
|
textView3.setText(event.getEvent().c());
|
|
TextView textView4 = this.binding.f1613c;
|
|
m.checkNotNullExpressionValue(textView4, "binding.guildScheduledEventListItemDescText");
|
|
ViewExtensions.setTextAndVisibilityBy(textView4, event.getEvent().a());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GuildScheduledEventListAdapter(RecyclerView recyclerView) {
|
|
super(recyclerView, false, 2, null);
|
|
m.checkNotNullParameter(recyclerView, "recyclerView");
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
public MGRecyclerViewHolder<?, GuildScheduledEventListItem> onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
if (i == 0) {
|
|
return new EventViewHolder();
|
|
}
|
|
throw invalidViewTypeException(i);
|
|
}
|
|
}
|