discord-jadx/app/src/main/java/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterItemGu...

111 lines
6.5 KiB
Java

package com.discord.widgets.chat.list.adapter;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import c.a.d.f;
import c.a.k.b;
import c.d.b.a.a;
import com.discord.databinding.WidgetChatListAdapterItemGuildWelcomeBinding;
import com.discord.utilities.time.Clock;
import com.discord.utilities.time.ClockFactory;
import com.discord.utilities.view.text.LinkifiedTextView;
import com.discord.views.ChatActionItem;
import com.discord.widgets.chat.list.entries.ChatListEntry;
import com.discord.widgets.chat.list.entries.GuildWelcomeEntry;
import d0.z.d.m;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: WidgetChatListAdapterItemGuildWelcome.kt */
public final class WidgetChatListAdapterItemGuildWelcome extends WidgetChatListItem {
private final WidgetChatListAdapterItemGuildWelcomeBinding binding;
private final Clock clock;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChatListAdapterItemGuildWelcome(WidgetChatListAdapter widgetChatListAdapter, Clock clock) {
super(2131558949, widgetChatListAdapter);
m.checkNotNullParameter(widgetChatListAdapter, "adapter");
m.checkNotNullParameter(clock, "clock");
this.clock = clock;
View view = this.itemView;
int i = 2131363768;
TextView textView = (TextView) view.findViewById(2131363768);
if (textView != null) {
i = 2131363769;
LinkifiedTextView linkifiedTextView = (LinkifiedTextView) view.findViewById(2131363769);
if (linkifiedTextView != null) {
i = 2131363770;
LinkifiedTextView linkifiedTextView2 = (LinkifiedTextView) view.findViewById(2131363770);
if (linkifiedTextView2 != null) {
i = 2131365724;
ChatActionItem chatActionItem = (ChatActionItem) view.findViewById(2131365724);
if (chatActionItem != null) {
i = 2131365725;
ChatActionItem chatActionItem2 = (ChatActionItem) view.findViewById(2131365725);
if (chatActionItem2 != null) {
WidgetChatListAdapterItemGuildWelcomeBinding widgetChatListAdapterItemGuildWelcomeBinding = new WidgetChatListAdapterItemGuildWelcomeBinding((LinearLayout) view, textView, linkifiedTextView, linkifiedTextView2, chatActionItem, chatActionItem2);
m.checkNotNullExpressionValue(widgetChatListAdapterItemGuildWelcomeBinding, "WidgetChatListAdapterIte…omeBinding.bind(itemView)");
this.binding = widgetChatListAdapterItemGuildWelcomeBinding;
return;
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ WidgetChatListAdapterItemGuildWelcome(WidgetChatListAdapter widgetChatListAdapter, Clock clock, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(widgetChatListAdapter, (i & 2) != 0 ? ClockFactory.get() : clock);
}
public static final /* synthetic */ WidgetChatListAdapter access$getAdapter$p(WidgetChatListAdapterItemGuildWelcome widgetChatListAdapterItemGuildWelcome) {
return (WidgetChatListAdapter) widgetChatListAdapterItemGuildWelcome.adapter;
}
@Override // com.discord.widgets.chat.list.adapter.WidgetChatListItem
public void onConfigure(int i, ChatListEntry chatListEntry) {
m.checkNotNullParameter(chatListEntry, "data");
super.onConfigure(i, chatListEntry);
if (chatListEntry instanceof GuildWelcomeEntry) {
TextView textView = this.binding.b;
m.checkNotNullExpressionValue(textView, "binding.itemGuildWelcomeHeader");
boolean z2 = true;
GuildWelcomeEntry guildWelcomeEntry = (GuildWelcomeEntry) chatListEntry;
b.m(textView, 2131894853, new Object[]{guildWelcomeEntry.getGuildName()}, null, 4);
boolean z3 = (guildWelcomeEntry.getGuildId() >>> 22) + 1420070400000L < this.clock.currentTimeMillis() - 2592000000L;
ChatActionItem chatActionItem = this.binding.f;
m.checkNotNullExpressionValue(chatActionItem, "binding.welcomeCardUploadIcon");
int i2 = 8;
chatActionItem.setVisibility(!guildWelcomeEntry.getGuildHasIcon() && guildWelcomeEntry.isOwner() ? 0 : 8);
this.binding.f.setOnClickListener(new WidgetChatListAdapterItemGuildWelcome$onConfigure$1(chatListEntry));
ChatActionItem chatActionItem2 = this.binding.e;
m.checkNotNullExpressionValue(chatActionItem2, "binding.welcomeCardInviteFriends");
chatActionItem2.setVisibility(guildWelcomeEntry.getCanInvite() ? 0 : 8);
this.binding.e.setOnClickListener(new WidgetChatListAdapterItemGuildWelcome$onConfigure$2(this, chatListEntry));
String C = a.C(new StringBuilder(), f.a.a(360045138571L, null), "?utm_source=discord&utm_medium=blog&utm_campaign=2020-06_help-new-user&utm_content=--t%3Apm");
LinkifiedTextView linkifiedTextView = this.binding.d;
m.checkNotNullExpressionValue(linkifiedTextView, "binding.itemGuildWelcomeSubheaderIntro");
b.m(linkifiedTextView, 2131894848, new Object[]{C}, null, 4);
LinkifiedTextView linkifiedTextView2 = this.binding.d;
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.itemGuildWelcomeSubheaderIntro");
ChatActionItem chatActionItem3 = this.binding.f;
m.checkNotNullExpressionValue(chatActionItem3, "binding.welcomeCardUploadIcon");
if (!(chatActionItem3.getVisibility() == 0)) {
ChatActionItem chatActionItem4 = this.binding.e;
m.checkNotNullExpressionValue(chatActionItem4, "binding.welcomeCardInviteFriends");
if (!(chatActionItem4.getVisibility() == 0)) {
z2 = false;
}
}
if (z2) {
i2 = 0;
}
linkifiedTextView2.setVisibility(i2);
LinkifiedTextView linkifiedTextView3 = this.binding.f1742c;
m.checkNotNullExpressionValue(linkifiedTextView3, "binding.itemGuildWelcomeSubheader");
b.m(linkifiedTextView3, z3 ? 2131894849 : guildWelcomeEntry.isOwner() ? 2131894851 : 2131894850, new Object[0], null, 4);
}
}
}