2021-06-27 20:44:35 +00:00
|
|
|
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.l.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) {
|
2021-07-03 23:36:06 +00:00
|
|
|
super(2131558941, widgetChatListAdapter);
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullParameter(widgetChatListAdapter, "adapter");
|
|
|
|
m.checkNotNullParameter(clock, "clock");
|
|
|
|
this.clock = clock;
|
|
|
|
View view = this.itemView;
|
2021-07-03 23:36:06 +00:00
|
|
|
int i = 2131363717;
|
|
|
|
TextView textView = (TextView) view.findViewById(2131363717);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (textView != null) {
|
2021-07-03 23:36:06 +00:00
|
|
|
i = 2131363718;
|
|
|
|
LinkifiedTextView linkifiedTextView = (LinkifiedTextView) view.findViewById(2131363718);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (linkifiedTextView != null) {
|
2021-07-03 23:36:06 +00:00
|
|
|
i = 2131363719;
|
|
|
|
LinkifiedTextView linkifiedTextView2 = (LinkifiedTextView) view.findViewById(2131363719);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (linkifiedTextView2 != null) {
|
2021-07-04 15:26:29 +00:00
|
|
|
i = 2131365633;
|
|
|
|
ChatActionItem chatActionItem = (ChatActionItem) view.findViewById(2131365633);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (chatActionItem != null) {
|
2021-07-04 15:26:29 +00:00
|
|
|
i = 2131365634;
|
|
|
|
ChatActionItem chatActionItem2 = (ChatActionItem) view.findViewById(2131365634);
|
2021-06-27 20:44:35 +00:00
|
|
|
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;
|
2021-07-03 23:36:06 +00:00
|
|
|
b.m(textView, 2131894720, new Object[]{guildWelcomeEntry.getGuildName()}, null, 4);
|
2021-06-27 20:44:35 +00:00
|
|
|
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 D = a.D(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");
|
2021-07-03 23:36:06 +00:00
|
|
|
b.m(linkifiedTextView, 2131894715, new Object[]{D}, null, 4);
|
2021-06-27 20:44:35 +00:00
|
|
|
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);
|
2021-06-27 20:53:42 +00:00
|
|
|
LinkifiedTextView linkifiedTextView3 = this.binding.f1734c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView3, "binding.itemGuildWelcomeSubheader");
|
2021-07-03 23:36:06 +00:00
|
|
|
b.m(linkifiedTextView3, z3 ? 2131894716 : guildWelcomeEntry.isOwner() ? 2131894718 : 2131894717, new Object[0], null, 4);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|