2021-08-04 23:47:20 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2021-09-08 17:58:48 +00:00
|
|
|
import android.text.TextUtils;
|
2021-08-04 23:47:20 +00:00
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
2021-09-08 17:58:48 +00:00
|
|
|
import androidx.constraintlayout.widget.Barrier;
|
2021-08-04 23:47:20 +00:00
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import androidx.core.content.ContextCompat;
|
2021-08-11 06:37:47 +00:00
|
|
|
import c.a.k.b;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.g;
|
|
|
|
import c0.z.d.m;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-04 23:47:20 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
2021-09-27 20:31:35 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventStatus;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.databinding.GuildScheduledEventBottomButtonViewBinding;
|
2021-08-04 23:47:20 +00:00
|
|
|
import com.discord.databinding.GuildScheduledEventItemViewBinding;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.models.guild.Guild;
|
2021-08-26 06:35:19 +00:00
|
|
|
import com.discord.utilities.color.ColorCompat;
|
2021-09-27 20:31:35 +00:00
|
|
|
import com.discord.utilities.dimen.DimenUtils;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.utilities.extensions.SimpleDraweeViewExtensionsKt;
|
|
|
|
import com.discord.utilities.icon.IconUtils;
|
2021-10-08 22:11:56 +00:00
|
|
|
import com.discord.utilities.string.StringUtilsKt;
|
2021-09-15 06:33:54 +00:00
|
|
|
import com.discord.utilities.textview.TextViewFadeHelper;
|
2021-09-16 17:51:42 +00:00
|
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
2021-08-14 06:40:53 +00:00
|
|
|
import com.discord.utilities.view.text.LinkifiedTextView;
|
2021-09-15 06:33:54 +00:00
|
|
|
import com.discord.widgets.guildscheduledevent.GuildScheduledEventBottomButtonView;
|
2021-08-04 23:47:20 +00:00
|
|
|
import com.discord.widgets.guildscheduledevent.GuildScheduledEventListItem;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
2021-09-27 20:31:35 +00:00
|
|
|
import java.util.Objects;
|
2021-08-31 06:34:54 +00:00
|
|
|
import kotlin.Lazy;
|
2021-08-04 23:47:20 +00:00
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: GuildScheduledEventItemView.kt */
|
|
|
|
public final class GuildScheduledEventItemView extends ConstraintLayout {
|
|
|
|
private final GuildScheduledEventItemViewBinding binding;
|
2021-08-31 06:34:54 +00:00
|
|
|
private final Lazy descriptionParser$delegate;
|
2021-09-27 20:31:35 +00:00
|
|
|
private final Lazy locationParser$delegate;
|
2021-08-04 23:47:20 +00:00
|
|
|
|
|
|
|
public GuildScheduledEventItemView(Context context) {
|
|
|
|
this(context, null, 0, 6, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public GuildScheduledEventItemView(Context context, AttributeSet attributeSet) {
|
|
|
|
this(context, attributeSet, 0, 4, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public GuildScheduledEventItemView(Context context, AttributeSet attributeSet, int i) {
|
|
|
|
super(context, attributeSet, i);
|
|
|
|
m.checkNotNullParameter(context, "context");
|
2021-08-09 22:51:56 +00:00
|
|
|
View inflate = LayoutInflater.from(context).inflate(R.layout.guild_scheduled_event_item_view, (ViewGroup) this, false);
|
2021-08-04 23:47:20 +00:00
|
|
|
addView(inflate);
|
2021-08-20 02:22:46 +00:00
|
|
|
int i2 = R.id.guild_scheduled_event_list_item_buttom_view;
|
|
|
|
GuildScheduledEventBottomButtonView guildScheduledEventBottomButtonView = (GuildScheduledEventBottomButtonView) inflate.findViewById(R.id.guild_scheduled_event_list_item_buttom_view);
|
|
|
|
if (guildScheduledEventBottomButtonView != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_channel_guild_container;
|
|
|
|
ConstraintLayout constraintLayout = (ConstraintLayout) inflate.findViewById(R.id.guild_scheduled_event_list_item_channel_guild_container);
|
|
|
|
if (constraintLayout != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_date_view;
|
|
|
|
GuildScheduledEventDateView guildScheduledEventDateView = (GuildScheduledEventDateView) inflate.findViewById(R.id.guild_scheduled_event_list_item_date_view);
|
|
|
|
if (guildScheduledEventDateView != null) {
|
2021-08-10 21:19:22 +00:00
|
|
|
i2 = R.id.guild_scheduled_event_list_item_desc_text;
|
2021-08-14 06:40:53 +00:00
|
|
|
LinkifiedTextView linkifiedTextView = (LinkifiedTextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_desc_text);
|
|
|
|
if (linkifiedTextView != null) {
|
2021-08-20 02:22:46 +00:00
|
|
|
i2 = R.id.guild_scheduled_event_list_item_guild_channel_name;
|
|
|
|
TextView textView = (TextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_guild_channel_name);
|
|
|
|
if (textView != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_guild_icon;
|
|
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) inflate.findViewById(R.id.guild_scheduled_event_list_item_guild_icon);
|
|
|
|
if (simpleDraweeView != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_guild_icon_placeholder_text;
|
|
|
|
TextView textView2 = (TextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_guild_icon_placeholder_text);
|
|
|
|
if (textView2 != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_guild_name;
|
|
|
|
TextView textView3 = (TextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_guild_name);
|
|
|
|
if (textView3 != null) {
|
|
|
|
i2 = R.id.guild_scheduled_event_list_item_rsvp_text;
|
|
|
|
TextView textView4 = (TextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_rsvp_text);
|
|
|
|
if (textView4 != null) {
|
2021-08-20 05:39:29 +00:00
|
|
|
i2 = R.id.guild_scheduled_event_list_item_title_text;
|
|
|
|
TextView textView5 = (TextView) inflate.findViewById(R.id.guild_scheduled_event_list_item_title_text);
|
|
|
|
if (textView5 != null) {
|
2021-09-08 17:58:48 +00:00
|
|
|
i2 = R.id.header_barrier;
|
|
|
|
Barrier barrier = (Barrier) inflate.findViewById(R.id.header_barrier);
|
|
|
|
if (barrier != null) {
|
|
|
|
i2 = R.id.standalone_channel_icon;
|
|
|
|
ImageView imageView = (ImageView) inflate.findViewById(R.id.standalone_channel_icon);
|
|
|
|
if (imageView != null) {
|
|
|
|
i2 = R.id.standalone_channel_name;
|
2021-09-27 20:31:35 +00:00
|
|
|
LinkifiedTextView linkifiedTextView2 = (LinkifiedTextView) inflate.findViewById(R.id.standalone_channel_name);
|
|
|
|
if (linkifiedTextView2 != null) {
|
|
|
|
GuildScheduledEventItemViewBinding guildScheduledEventItemViewBinding = new GuildScheduledEventItemViewBinding((ConstraintLayout) inflate, guildScheduledEventBottomButtonView, constraintLayout, guildScheduledEventDateView, linkifiedTextView, textView, simpleDraweeView, textView2, textView3, textView4, textView5, barrier, imageView, linkifiedTextView2);
|
2021-09-08 17:58:48 +00:00
|
|
|
m.checkNotNullExpressionValue(guildScheduledEventItemViewBinding, "GuildScheduledEventItemV…rom(context), this, true)");
|
|
|
|
this.binding = guildScheduledEventItemViewBinding;
|
|
|
|
this.descriptionParser$delegate = g.lazy(new GuildScheduledEventItemView$descriptionParser$2(this));
|
2021-09-27 20:31:35 +00:00
|
|
|
this.locationParser$delegate = g.lazy(GuildScheduledEventItemView$locationParser$2.INSTANCE);
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.guildScheduledEventListItemDescText");
|
|
|
|
new TextViewFadeHelper(linkifiedTextView).registerFadeHelper();
|
2021-09-08 17:58:48 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-08-13 06:23:11 +00:00
|
|
|
}
|
2021-08-10 21:19:22 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-04 23:47:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
|
|
public /* synthetic */ GuildScheduledEventItemView(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
|
|
|
}
|
|
|
|
|
2021-08-31 06:34:54 +00:00
|
|
|
public static final /* synthetic */ GuildScheduledEventItemViewBinding access$getBinding$p(GuildScheduledEventItemView guildScheduledEventItemView) {
|
|
|
|
return guildScheduledEventItemView.binding;
|
2021-08-14 06:40:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureDescription(String str) {
|
2021-08-31 06:34:54 +00:00
|
|
|
getDescriptionParser().configureDescription(str);
|
2021-08-14 06:40:53 +00:00
|
|
|
}
|
|
|
|
|
2021-10-27 06:38:20 +00:00
|
|
|
public static /* synthetic */ void configureInChatList$default(GuildScheduledEventItemView guildScheduledEventItemView, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, Function0 function0, Function0 function02, Function0 function03, Function0 function04, int i, Object obj) {
|
|
|
|
guildScheduledEventItemView.configureInChatList(guildScheduledEvent, channel, guild, z2, z3, z4, z5, z6, function0, (i & 512) != 0 ? GuildScheduledEventItemView$configureInChatList$1.INSTANCE : function02, (i & 1024) != 0 ? GuildScheduledEventItemView$configureInChatList$2.INSTANCE : function03, function04);
|
2021-08-04 23:47:20 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
private final void configureInternal(GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03, Function0<Unit> function04, Function0<Unit> function05) {
|
2021-10-08 22:11:56 +00:00
|
|
|
String str;
|
2021-08-20 02:22:46 +00:00
|
|
|
GuildScheduledEventBottomButtonView guildScheduledEventBottomButtonView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(guildScheduledEventBottomButtonView, "binding.guildScheduledEventListItemButtomView");
|
2021-10-07 06:22:31 +00:00
|
|
|
guildScheduledEventBottomButtonView.setVisibility(new GuildScheduledEventBottomButtonView.VisibilityInfo(guildScheduledEvent, z3, z5, z4, z6, z7, false, 64, null).isAnyButtonVisible() ? 0 : 8);
|
|
|
|
GuildScheduledEventBottomButtonView.configure$default(this.binding.b, guildScheduledEvent, z2, z3, z5, z4, z6, z7, function02, function03, function04, function05, null, 2048, null);
|
2021-08-20 02:22:46 +00:00
|
|
|
TextView textView = this.binding.j;
|
2021-09-16 17:51:42 +00:00
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEventListItemRsvpText");
|
2021-08-20 02:22:46 +00:00
|
|
|
Integer l = guildScheduledEvent.l();
|
2021-10-08 22:11:56 +00:00
|
|
|
if (l != null) {
|
|
|
|
int intValue = l.intValue();
|
|
|
|
Context context = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
|
|
str = StringUtilsKt.format(intValue, context);
|
|
|
|
} else {
|
|
|
|
str = null;
|
|
|
|
}
|
|
|
|
ViewExtensions.setTextAndVisibilityBy(textView, str);
|
2021-08-28 06:29:07 +00:00
|
|
|
this.binding.d.configure(guildScheduledEvent);
|
2021-08-20 05:39:29 +00:00
|
|
|
TextView textView2 = this.binding.k;
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.guildScheduledEventListItemTitleText");
|
|
|
|
textView2.setText(guildScheduledEvent.h());
|
2021-08-14 06:40:53 +00:00
|
|
|
configureDescription(guildScheduledEvent.c());
|
2021-08-20 05:39:29 +00:00
|
|
|
configureLocation(guildScheduledEventLocationInfo, guild);
|
2021-09-15 06:33:54 +00:00
|
|
|
if (function0 != null) {
|
2021-09-24 06:27:57 +00:00
|
|
|
this.binding.a.setOnClickListener(new GuildScheduledEventItemView$configureInternal$5(function0));
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public static /* synthetic */ void configureInternal$default(GuildScheduledEventItemView guildScheduledEventItemView, GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, Function0 function0, Function0 function02, Function0 function03, Function0 function04, Function0 function05, int i, Object obj) {
|
|
|
|
guildScheduledEventItemView.configureInternal(guildScheduledEvent, guildScheduledEventLocationInfo, guild, z2, z3, z4, z5, z6, z7, function0, (i & 1024) != 0 ? GuildScheduledEventItemView$configureInternal$1.INSTANCE : function02, (i & 2048) != 0 ? GuildScheduledEventItemView$configureInternal$2.INSTANCE : function03, (i & 4096) != 0 ? GuildScheduledEventItemView$configureInternal$3.INSTANCE : function04, (i & 8192) != 0 ? GuildScheduledEventItemView$configureInternal$4.INSTANCE : function05);
|
2021-08-04 23:47:20 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 05:39:29 +00:00
|
|
|
private final void configureLocation(GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild) {
|
|
|
|
int i = 8;
|
2021-09-08 17:58:48 +00:00
|
|
|
if (guildScheduledEventLocationInfo == null) {
|
2021-10-28 19:31:20 +00:00
|
|
|
ConstraintLayout constraintLayout = this.binding.f2033c;
|
2021-08-20 05:39:29 +00:00
|
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.guildScheduledEv…ItemChannelGuildContainer");
|
2021-09-08 17:58:48 +00:00
|
|
|
constraintLayout.setVisibility(8);
|
|
|
|
} else if (guild != null) {
|
2021-10-28 19:31:20 +00:00
|
|
|
ConstraintLayout constraintLayout2 = this.binding.f2033c;
|
2021-09-08 17:58:48 +00:00
|
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.guildScheduledEv…ItemChannelGuildContainer");
|
|
|
|
constraintLayout2.setVisibility(0);
|
2021-08-20 05:39:29 +00:00
|
|
|
ImageView imageView = this.binding.l;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.standaloneChannelIcon");
|
|
|
|
imageView.setVisibility(8);
|
2021-09-27 20:31:35 +00:00
|
|
|
LinkifiedTextView linkifiedTextView = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.standaloneChannelName");
|
|
|
|
linkifiedTextView.setVisibility(8);
|
2021-08-20 05:39:29 +00:00
|
|
|
SimpleDraweeView simpleDraweeView = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.guildScheduledEventListItemGuildIcon");
|
|
|
|
simpleDraweeView.setVisibility(0);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView = this.binding.h;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEv…mGuildIconPlaceholderText");
|
|
|
|
textView.setVisibility(0);
|
|
|
|
TextView textView2 = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.guildScheduledEventListItemGuildName");
|
2021-08-20 05:39:29 +00:00
|
|
|
textView2.setVisibility(0);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView3 = this.binding.f;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.guildScheduledEv…tListItemGuildChannelName");
|
2021-08-20 05:39:29 +00:00
|
|
|
textView3.setVisibility(0);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView4 = this.binding.h;
|
|
|
|
textView4.setText(guild.getShortName());
|
2021-08-20 05:39:29 +00:00
|
|
|
if (!guild.hasIcon()) {
|
|
|
|
i = 0;
|
|
|
|
}
|
2021-09-27 20:31:35 +00:00
|
|
|
textView4.setVisibility(i);
|
2021-08-20 05:39:29 +00:00
|
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.guildScheduledEventListItemGuildIcon");
|
|
|
|
SimpleDraweeViewExtensionsKt.setGuildIcon$default(simpleDraweeView2, true, guild, (float) getResources().getDimensionPixelSize(R.dimen.guild_scheduled_event_icon_corner_radius), Integer.valueOf(IconUtils.getMediaProxySize(getResources().getDimensionPixelSize(R.dimen.avatar_size_standard))), null, null, null, false, null, 496, null);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView5 = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(textView5, "binding.guildScheduledEventListItemGuildName");
|
|
|
|
textView5.setText(guild.getName());
|
|
|
|
TextView textView6 = this.binding.f;
|
|
|
|
m.checkNotNullExpressionValue(textView6, "binding.guildScheduledEv…tListItemGuildChannelName");
|
|
|
|
GuildScheduledEventExternalLocationParser locationParser = getLocationParser();
|
|
|
|
Context context = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
|
|
textView6.setText(locationParser.getTextFromLocation(context, guildScheduledEventLocationInfo));
|
|
|
|
this.binding.f.setCompoundDrawablesWithIntrinsicBounds(guildScheduledEventLocationInfo.getLocationIconSmall(), 0, 0, 0);
|
2021-09-08 17:58:48 +00:00
|
|
|
} else {
|
2021-10-28 19:31:20 +00:00
|
|
|
ConstraintLayout constraintLayout3 = this.binding.f2033c;
|
2021-09-08 17:58:48 +00:00
|
|
|
m.checkNotNullExpressionValue(constraintLayout3, "binding.guildScheduledEv…ItemChannelGuildContainer");
|
|
|
|
constraintLayout3.setVisibility(0);
|
|
|
|
SimpleDraweeView simpleDraweeView3 = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.guildScheduledEventListItemGuildIcon");
|
|
|
|
simpleDraweeView3.setVisibility(8);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView7 = this.binding.h;
|
|
|
|
m.checkNotNullExpressionValue(textView7, "binding.guildScheduledEv…mGuildIconPlaceholderText");
|
|
|
|
textView7.setVisibility(8);
|
|
|
|
TextView textView8 = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(textView8, "binding.guildScheduledEventListItemGuildName");
|
2021-09-08 17:58:48 +00:00
|
|
|
textView8.setVisibility(8);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView9 = this.binding.f;
|
|
|
|
m.checkNotNullExpressionValue(textView9, "binding.guildScheduledEv…tListItemGuildChannelName");
|
2021-09-08 17:58:48 +00:00
|
|
|
textView9.setVisibility(8);
|
|
|
|
ImageView imageView2 = this.binding.l;
|
|
|
|
imageView2.setVisibility(0);
|
|
|
|
imageView2.setImageResource(guildScheduledEventLocationInfo.getLocationIcon());
|
2021-09-27 20:31:35 +00:00
|
|
|
LinkifiedTextView linkifiedTextView2 = this.binding.m;
|
|
|
|
linkifiedTextView2.setVisibility(0);
|
|
|
|
GuildScheduledEventExternalLocationParser locationParser2 = getLocationParser();
|
|
|
|
Context context2 = linkifiedTextView2.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context2, "context");
|
|
|
|
linkifiedTextView2.setText(locationParser2.getTextFromLocation(context2, guildScheduledEventLocationInfo));
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.standaloneChanne…xt, locationInfo)\n }");
|
2021-08-20 05:39:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ void configureLocation$default(GuildScheduledEventItemView guildScheduledEventItemView, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, int i, Object obj) {
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
guild = null;
|
|
|
|
}
|
|
|
|
guildScheduledEventItemView.configureLocation(guildScheduledEventLocationInfo, guild);
|
2021-08-11 06:37:47 +00:00
|
|
|
}
|
|
|
|
|
2021-09-15 06:33:54 +00:00
|
|
|
private final GuildScheduledEventDescriptionParser getDescriptionParser() {
|
|
|
|
return (GuildScheduledEventDescriptionParser) this.descriptionParser$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
private final GuildScheduledEventExternalLocationParser getLocationParser() {
|
|
|
|
return (GuildScheduledEventExternalLocationParser) this.locationParser$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
2021-08-10 21:19:22 +00:00
|
|
|
public final void configureAsPreview(GuildScheduledEventModel guildScheduledEventModel, Channel channel) {
|
2021-08-04 23:47:20 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEventModel, "eventModel");
|
2021-08-20 02:22:46 +00:00
|
|
|
long millis = GuildScheduledEventPickerDateTime.INSTANCE.toMillis(guildScheduledEventModel.getStartDate(), guildScheduledEventModel.getStartTime());
|
2021-08-04 23:47:20 +00:00
|
|
|
ConstraintLayout constraintLayout = this.binding.a;
|
|
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.root");
|
2021-09-15 06:33:54 +00:00
|
|
|
constraintLayout.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_floating));
|
2021-08-26 06:35:19 +00:00
|
|
|
TextView textView = this.binding.j;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEventListItemRsvpText");
|
2021-09-15 06:33:54 +00:00
|
|
|
textView.setBackgroundTintList(ColorCompat.INSTANCE.createDefaultColorStateList(ColorCompat.getThemedColor(getContext(), (int) R.attr.colorBackgroundTertiary)));
|
2021-08-26 06:35:19 +00:00
|
|
|
TextView textView2 = this.binding.j;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.guildScheduledEventListItemRsvpText");
|
2021-09-16 17:51:42 +00:00
|
|
|
Integer userCount = guildScheduledEventModel.getUserCount();
|
|
|
|
ViewExtensions.setTextAndVisibilityBy(textView2, userCount != null ? String.valueOf(userCount.intValue()) : null);
|
2021-08-20 02:22:46 +00:00
|
|
|
GuildScheduledEventBottomButtonView guildScheduledEventBottomButtonView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(guildScheduledEventBottomButtonView, "binding.guildScheduledEventListItemButtomView");
|
|
|
|
guildScheduledEventBottomButtonView.setVisibility(8);
|
2021-09-16 17:51:42 +00:00
|
|
|
TextView textView3 = this.binding.k;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.guildScheduledEventListItemTitleText");
|
|
|
|
textView3.setText(guildScheduledEventModel.getName());
|
2021-08-14 06:40:53 +00:00
|
|
|
configureDescription(guildScheduledEventModel.getDescription());
|
2021-08-20 02:22:46 +00:00
|
|
|
this.binding.d.configure(millis);
|
2021-08-20 05:39:29 +00:00
|
|
|
configureLocation$default(this, GuildScheduledEventLocationInfo.Companion.buildLocationInfo(guildScheduledEventModel, channel), null, 2, null);
|
2021-08-04 23:47:20 +00:00
|
|
|
}
|
2021-08-11 06:37:47 +00:00
|
|
|
|
2021-10-27 06:38:20 +00:00
|
|
|
public final void configureInChatList(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03, Function0<Unit> function04) {
|
2021-08-12 06:36:45 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullParameter(function02, "rsvpButtonClickListener");
|
|
|
|
m.checkNotNullParameter(function03, "joinServerButtonClickListener");
|
|
|
|
m.checkNotNullParameter(function04, "shareButtonClickListener");
|
2021-10-27 06:38:20 +00:00
|
|
|
configureInternal(guildScheduledEvent, GuildScheduledEventLocationInfo.Companion.buildLocationInfo(guildScheduledEvent, channel), guild, z3, true, false, z6, z4, z5, function0, function02, function03, function04, function03);
|
2021-08-11 06:37:47 +00:00
|
|
|
ConstraintLayout constraintLayout = this.binding.a;
|
|
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.root");
|
2021-09-27 20:31:35 +00:00
|
|
|
constraintLayout.setBackground((!z4 || guildScheduledEvent.k() != GuildScheduledEventStatus.ACTIVE) ? ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_secondary) : ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_connected_secondary));
|
2021-08-26 06:35:19 +00:00
|
|
|
TextView textView = this.binding.j;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEventListItemRsvpText");
|
2021-09-15 06:33:54 +00:00
|
|
|
textView.setBackgroundTintList(ColorCompat.INSTANCE.createDefaultColorStateList(ColorCompat.getThemedColor(getContext(), (int) R.attr.colorBackgroundTertiary)));
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView2 = this.binding.k;
|
|
|
|
ViewGroup.LayoutParams layoutParams = textView2.getLayoutParams();
|
|
|
|
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.view.ViewGroup.MarginLayoutParams");
|
|
|
|
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams;
|
|
|
|
int i = 8;
|
|
|
|
marginLayoutParams.topMargin = DimenUtils.dpToPixels(8);
|
|
|
|
textView2.setLayoutParams(marginLayoutParams);
|
2021-08-20 02:22:46 +00:00
|
|
|
GuildScheduledEventBottomButtonViewBinding binding = this.binding.b.getBinding();
|
2021-09-18 07:43:22 +00:00
|
|
|
TextView textView3 = binding.g;
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullExpressionValue(textView3, "buttonBinding.startEventButtonText");
|
2021-09-27 20:31:35 +00:00
|
|
|
Context context = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
|
|
textView3.setText(b.h(context, R.string.guild_event_invite_embed_join_server_button_label, new Object[0], null, 4));
|
|
|
|
TextView textView4 = binding.g;
|
|
|
|
m.checkNotNullExpressionValue(textView4, "buttonBinding.startEventButtonText");
|
|
|
|
textView4.setVisibility(z2 ^ true ? 0 : 8);
|
2021-09-18 07:43:22 +00:00
|
|
|
ImageView imageView = binding.f;
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullExpressionValue(imageView, "buttonBinding.startEventButton");
|
2021-08-11 06:37:47 +00:00
|
|
|
imageView.setVisibility(z2 ^ true ? 0 : 8);
|
2021-10-28 19:31:20 +00:00
|
|
|
ImageView imageView2 = binding.f2031c;
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullExpressionValue(imageView2, "buttonBinding.interestedButton");
|
|
|
|
imageView2.setVisibility(z2 ? 0 : 8);
|
2021-09-27 20:31:35 +00:00
|
|
|
TextView textView5 = binding.d;
|
|
|
|
m.checkNotNullExpressionValue(textView5, "buttonBinding.interestedButtonText");
|
|
|
|
if (z2) {
|
|
|
|
i = 0;
|
2021-08-11 06:37:47 +00:00
|
|
|
}
|
2021-09-27 20:31:35 +00:00
|
|
|
textView5.setVisibility(i);
|
2021-08-11 06:37:47 +00:00
|
|
|
}
|
|
|
|
|
2021-09-24 06:27:57 +00:00
|
|
|
public final void configureInEventList(GuildScheduledEventListItem.Event event, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03, Function0<Unit> function04, Function0<Unit> function05) {
|
2021-08-11 06:37:47 +00:00
|
|
|
m.checkNotNullParameter(event, "item");
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullParameter(function0, "cardClickListener");
|
|
|
|
m.checkNotNullParameter(function02, "rsvpButtonClickListener");
|
|
|
|
m.checkNotNullParameter(function03, "eventStartButtonClickListener");
|
|
|
|
m.checkNotNullParameter(function04, "shareButtonClickListener");
|
2021-09-18 07:43:22 +00:00
|
|
|
m.checkNotNullParameter(function05, "joinButtonClickListener");
|
2021-10-07 06:22:31 +00:00
|
|
|
configureInternal(event.getEvent(), GuildScheduledEventLocationInfo.Companion.buildLocationInfo(event.getEvent(), event.getChannel()), null, event.isRsvped(), true, event.getCanStartEvent(), event.getCanShare(), event.isConnected(), event.getCanConnect(), function0, function02, function03, function04, function05);
|
2021-09-27 20:31:35 +00:00
|
|
|
ConstraintLayout constraintLayout = this.binding.a;
|
|
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.root");
|
|
|
|
constraintLayout.setBackground((!event.isConnected() || event.getEvent().k() != GuildScheduledEventStatus.ACTIVE) ? ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_primary) : ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_connected_primary));
|
2021-09-08 17:58:48 +00:00
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
public final void configureInVoiceChannel(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, Function0<Unit> function0, Function0<Unit> function02) {
|
2021-09-08 17:58:48 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullParameter(function0, "onCardClicked");
|
|
|
|
m.checkNotNullParameter(function02, "onStartEventButtonClicked");
|
2021-10-07 06:22:31 +00:00
|
|
|
configureInternal(guildScheduledEvent, null, null, false, false, z2, false, z4, false, function0, GuildScheduledEventItemView$configureInVoiceChannel$1.INSTANCE, function02, GuildScheduledEventItemView$configureInVoiceChannel$2.INSTANCE, GuildScheduledEventItemView$configureInVoiceChannel$3.INSTANCE);
|
2021-09-08 17:58:48 +00:00
|
|
|
ConstraintLayout constraintLayout = this.binding.a;
|
|
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.root");
|
2021-09-27 20:31:35 +00:00
|
|
|
constraintLayout.setBackground((!z4 || guildScheduledEvent.k() != GuildScheduledEventStatus.ACTIVE) ? ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_secondary) : ContextCompat.getDrawable(getContext(), R.drawable.bg_guild_scheduled_event_list_item_connected_secondary));
|
2021-09-08 17:58:48 +00:00
|
|
|
TextView textView = this.binding.j;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEventListItemRsvpText");
|
|
|
|
int i = 8;
|
|
|
|
textView.setVisibility(8);
|
2021-09-21 06:31:55 +00:00
|
|
|
if (z3) {
|
|
|
|
LinkifiedTextView linkifiedTextView = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.guildScheduledEventListItemDescText");
|
|
|
|
linkifiedTextView.setVisibility(8);
|
|
|
|
}
|
|
|
|
GuildScheduledEventBottomButtonView guildScheduledEventBottomButtonView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(guildScheduledEventBottomButtonView, "binding.guildScheduledEventListItemButtomView");
|
|
|
|
if (z2 && !z3) {
|
2021-09-08 17:58:48 +00:00
|
|
|
i = 0;
|
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
guildScheduledEventBottomButtonView.setVisibility(i);
|
2021-09-08 17:58:48 +00:00
|
|
|
TextView textView2 = this.binding.k;
|
|
|
|
if (z3) {
|
|
|
|
textView2.setMaxLines(Integer.MAX_VALUE);
|
|
|
|
textView2.setEllipsize(null);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
textView2.setMaxLines(1);
|
|
|
|
textView2.setEllipsize(TextUtils.TruncateAt.END);
|
2021-08-11 06:37:47 +00:00
|
|
|
}
|
2021-08-04 23:47:20 +00:00
|
|
|
}
|