2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.guilds.invite;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.content.res.TypedArray;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.appcompat.widget.LinearLayoutCompat;
|
|
|
|
import androidx.cardview.widget.CardView;
|
|
|
|
import c.a.l.b;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
|
|
import com.discord.R;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guild.Guild;
|
|
|
|
import com.discord.api.guild.GuildFeature;
|
|
|
|
import com.discord.api.user.User;
|
|
|
|
import com.discord.databinding.WidgetGuildInviteInfoBinding;
|
|
|
|
import com.discord.models.domain.ModelInvite;
|
|
|
|
import com.discord.models.user.CoreUser;
|
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.icon.IconUtils;
|
|
|
|
import com.discord.utilities.images.MGImages;
|
|
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
|
|
import com.discord.utilities.string.StringUtilsKt;
|
|
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.util.List;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
/* compiled from: WidgetInviteInfo.kt */
|
|
|
|
public final class WidgetInviteInfo extends LinearLayoutCompat {
|
|
|
|
private final WidgetGuildInviteInfoBinding binding;
|
|
|
|
|
|
|
|
public WidgetInviteInfo(Context context) {
|
|
|
|
this(context, null, 0, 6, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetInviteInfo(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 WidgetInviteInfo(Context context, AttributeSet attributeSet, int i) {
|
|
|
|
super(context, attributeSet, i);
|
|
|
|
m.checkNotNullParameter(context, "ctx");
|
2021-08-04 23:47:20 +00:00
|
|
|
LayoutInflater.from(getContext()).inflate(2131559074, this);
|
|
|
|
int i2 = 2131363815;
|
|
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(2131363815);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (simpleDraweeView != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363816;
|
|
|
|
SimpleDraweeView simpleDraweeView2 = (SimpleDraweeView) findViewById(2131363816);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (simpleDraweeView2 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363817;
|
|
|
|
CardView cardView = (CardView) findViewById(2131363817);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (cardView != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363818;
|
|
|
|
RelativeLayout relativeLayout = (RelativeLayout) findViewById(2131363818);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (relativeLayout != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363819;
|
|
|
|
RelativeLayout relativeLayout2 = (RelativeLayout) findViewById(2131363819);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (relativeLayout2 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363827;
|
|
|
|
ImageView imageView = (ImageView) findViewById(2131363827);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (imageView != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363830;
|
|
|
|
TextView textView = (TextView) findViewById(2131363830);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363831;
|
|
|
|
CardView cardView2 = (CardView) findViewById(2131363831);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (cardView2 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363832;
|
|
|
|
TextView textView2 = (TextView) findViewById(2131363832);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView2 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363833;
|
|
|
|
CardView cardView3 = (CardView) findViewById(2131363833);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (cardView3 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363834;
|
|
|
|
LinearLayout linearLayout = (LinearLayout) findViewById(2131363834);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (linearLayout != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363835;
|
|
|
|
TextView textView3 = (TextView) findViewById(2131363835);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView3 != null) {
|
2021-08-04 23:47:20 +00:00
|
|
|
i2 = 2131363842;
|
|
|
|
TextView textView4 = (TextView) findViewById(2131363842);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView4 != null) {
|
|
|
|
WidgetGuildInviteInfoBinding widgetGuildInviteInfoBinding = new WidgetGuildInviteInfoBinding(this, simpleDraweeView, simpleDraweeView2, cardView, relativeLayout, relativeLayout2, imageView, textView, cardView2, textView2, cardView3, linearLayout, textView3, textView4);
|
|
|
|
m.checkNotNullExpressionValue(widgetGuildInviteInfoBinding, "WidgetGuildInviteInfoBin…ater.from(context), this)");
|
|
|
|
this.binding = widgetGuildInviteInfoBinding;
|
|
|
|
Context context2 = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context2, "context");
|
|
|
|
parseAttributeSet(context2, attributeSet, i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i2)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
|
|
public /* synthetic */ WidgetInviteInfo(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetGuildInviteInfoBinding access$getBinding$p(WidgetInviteInfo widgetInviteInfo) {
|
|
|
|
return widgetInviteInfo.binding;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureForDirectFriend(ModelInvite modelInvite) {
|
|
|
|
SimpleDraweeView simpleDraweeView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.inviteAvatar");
|
|
|
|
User inviter = modelInvite.getInviter();
|
|
|
|
String str = null;
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView, inviter != null ? new CoreUser(inviter) : null, 2131165288, null, null, null, 56, null);
|
|
|
|
User inviter2 = modelInvite.getInviter();
|
|
|
|
String r = inviter2 != null ? inviter2.r() : null;
|
|
|
|
String str2 = "";
|
|
|
|
if (r == null) {
|
|
|
|
r = str2;
|
|
|
|
}
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
User inviter3 = modelInvite.getInviter();
|
|
|
|
String r2 = inviter3 != null ? inviter3.r() : null;
|
|
|
|
if (r2 == null) {
|
|
|
|
r2 = str2;
|
|
|
|
}
|
|
|
|
sb.append(r2);
|
|
|
|
sb.append("#");
|
|
|
|
User inviter4 = modelInvite.getInviter();
|
|
|
|
if (inviter4 != null) {
|
|
|
|
str = inviter4.f();
|
|
|
|
}
|
|
|
|
if (str != null) {
|
|
|
|
str2 = str;
|
|
|
|
}
|
|
|
|
sb.append(str2);
|
|
|
|
String sb2 = sb.toString();
|
2021-08-06 20:07:13 +00:00
|
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.f1822c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.inviteAvatarSmall");
|
|
|
|
simpleDraweeView2.setVisibility(8);
|
|
|
|
RelativeLayout relativeLayout = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.inviteAvatarSmallWrap");
|
|
|
|
relativeLayout.setVisibility(8);
|
|
|
|
CardView cardView = this.binding.d;
|
|
|
|
m.checkNotNullExpressionValue(cardView, "binding.inviteAvatarSmallCard");
|
|
|
|
cardView.setVisibility(8);
|
|
|
|
CardView cardView2 = this.binding.k;
|
|
|
|
m.checkNotNullExpressionValue(cardView2, "binding.inviteMembersTotalWrap");
|
|
|
|
cardView2.setVisibility(8);
|
|
|
|
CardView cardView3 = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(cardView3, "binding.inviteMembersOnlineWrap");
|
|
|
|
cardView3.setVisibility(8);
|
|
|
|
TextView textView = this.binding.n;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.inviteTitle");
|
|
|
|
textView.setText(getInviteTitleForDirectFriend(r));
|
|
|
|
this.binding.n.setTextSize(2, 26.0f);
|
|
|
|
TextView textView2 = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.inviteMessage");
|
|
|
|
textView2.setText(getInviteSubtitleForDirectFriend(sb2));
|
|
|
|
this.binding.m.setTextSize(2, 18.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:24:0x0069, code lost:
|
|
|
|
if ((r5.length() > 0) == true) goto L_0x006d;
|
|
|
|
*/
|
|
|
|
private final void configureForGDM(ModelInvite modelInvite) {
|
|
|
|
SimpleDraweeView simpleDraweeView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.inviteAvatar");
|
|
|
|
User inviter = modelInvite.getInviter();
|
|
|
|
String str = null;
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView, inviter != null ? new CoreUser(inviter) : null, 2131165288, null, null, null, 56, null);
|
|
|
|
Channel channel = modelInvite.getChannel();
|
|
|
|
User inviter2 = modelInvite.getInviter();
|
|
|
|
if (inviter2 != null) {
|
|
|
|
str = inviter2.r();
|
|
|
|
}
|
|
|
|
if (str == null) {
|
|
|
|
str = "";
|
|
|
|
}
|
|
|
|
m.checkNotNullExpressionValue(channel, "channel");
|
|
|
|
boolean z2 = true;
|
|
|
|
int i = 0;
|
|
|
|
String y0 = AnimatableValueParser.y0(channel).length() > 0 ? AnimatableValueParser.y0(channel) : str;
|
|
|
|
if (AnimatableValueParser.r1(channel) && (r5 = channel.g()) != null) {
|
|
|
|
}
|
|
|
|
z2 = false;
|
|
|
|
if (z2) {
|
2021-08-06 20:07:13 +00:00
|
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.f1822c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.inviteAvatarSmall");
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView2, channel, 2131165291, null, 8, null);
|
|
|
|
}
|
|
|
|
RelativeLayout relativeLayout = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.inviteAvatarSmallWrap");
|
|
|
|
if (!z2) {
|
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
relativeLayout.setVisibility(i);
|
|
|
|
TextView textView = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.inviteMessage");
|
|
|
|
textView.setText(getFormattedGuildName(y0));
|
|
|
|
TextView textView2 = this.binding.n;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.inviteTitle");
|
|
|
|
textView2.setText(getIntroTextForGroup(str, AnimatableValueParser.y0(channel)));
|
|
|
|
CardView cardView = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(cardView, "binding.inviteMembersOnlineWrap");
|
|
|
|
cardView.setVisibility(8);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureForGuild(ModelInvite modelInvite) {
|
|
|
|
List<GuildFeature> l;
|
|
|
|
List<GuildFeature> l2;
|
|
|
|
int i = 0;
|
|
|
|
boolean z2 = modelInvite.getInviter() != null && modelInvite.getApproximateMemberCount() < 200;
|
|
|
|
String str = null;
|
|
|
|
if (z2) {
|
|
|
|
SimpleDraweeView simpleDraweeView = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.inviteAvatar");
|
|
|
|
User inviter = modelInvite.getInviter();
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView, IconUtils.getForUser$default(inviter != null ? new CoreUser(inviter) : null, true, null, 4, null), 2131165288, (Function1) null, (MGImages.ChangeDetector) null, 24, (Object) null);
|
2021-08-06 20:07:13 +00:00
|
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.f1822c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.inviteAvatarSmall");
|
|
|
|
Guild guild = modelInvite.getGuild();
|
|
|
|
Long valueOf = guild != null ? Long.valueOf(guild.o()) : null;
|
|
|
|
Guild guild2 = modelInvite.getGuild();
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView2, IconUtils.getForGuild$default(valueOf, guild2 != null ? guild2.n() : null, "asset://asset/images/default_icon_selected.jpg", true, null, 16, null), 2131165291, (Function1) null, (MGImages.ChangeDetector) null, 24, (Object) null);
|
|
|
|
} else {
|
|
|
|
SimpleDraweeView simpleDraweeView3 = this.binding.b;
|
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.inviteAvatar");
|
|
|
|
Guild guild3 = modelInvite.getGuild();
|
|
|
|
Long valueOf2 = guild3 != null ? Long.valueOf(guild3.o()) : null;
|
|
|
|
Guild guild4 = modelInvite.getGuild();
|
|
|
|
IconUtils.setIcon$default(simpleDraweeView3, IconUtils.getForGuild$default(valueOf2, guild4 != null ? guild4.n() : null, "asset://asset/images/default_icon_selected.jpg", true, null, 16, null), 2131165288, (Function1) null, (MGImages.ChangeDetector) null, 24, (Object) null);
|
|
|
|
}
|
|
|
|
CardView cardView = this.binding.i;
|
|
|
|
m.checkNotNullExpressionValue(cardView, "binding.inviteMembersOnlineWrap");
|
|
|
|
cardView.setVisibility(z2 ^ true ? 0 : 8);
|
|
|
|
CardView cardView2 = this.binding.k;
|
|
|
|
m.checkNotNullExpressionValue(cardView2, "binding.inviteMembersTotalWrap");
|
|
|
|
cardView2.setVisibility(z2 ^ true ? 0 : 8);
|
|
|
|
RelativeLayout relativeLayout = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.inviteAvatarSmallWrap");
|
|
|
|
relativeLayout.setVisibility(z2 ? 0 : 8);
|
2021-08-06 20:07:13 +00:00
|
|
|
SimpleDraweeView simpleDraweeView4 = this.binding.f1822c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView4, "binding.inviteAvatarSmall");
|
|
|
|
if (!z2) {
|
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
simpleDraweeView4.setVisibility(i);
|
|
|
|
TextView textView = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.inviteMessage");
|
|
|
|
Guild guild5 = modelInvite.getGuild();
|
|
|
|
String u = guild5 != null ? guild5.u() : null;
|
|
|
|
if (u == null) {
|
|
|
|
u = "";
|
|
|
|
}
|
|
|
|
textView.setText(getFormattedGuildName(u));
|
|
|
|
Guild guild6 = modelInvite.getGuild();
|
|
|
|
if (guild6 == null || (l2 = guild6.l()) == null || !l2.contains(GuildFeature.VERIFIED)) {
|
|
|
|
Guild guild7 = modelInvite.getGuild();
|
|
|
|
if (!(guild7 == null || (l = guild7.l()) == null || !l.contains(GuildFeature.PARTNERED))) {
|
|
|
|
TextView textView2 = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.inviteMessage");
|
2021-08-04 23:47:20 +00:00
|
|
|
ViewExtensions.setCompoundDrawableWithIntrinsicBounds$default(textView2, 2131231857, 0, 0, 0, 14, null);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
TextView textView3 = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.inviteMessage");
|
2021-08-04 23:47:20 +00:00
|
|
|
ViewExtensions.setCompoundDrawableWithIntrinsicBounds$default(textView3, 2131232095, 0, 0, 0, 14, null);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
TextView textView4 = this.binding.n;
|
|
|
|
m.checkNotNullExpressionValue(textView4, "binding.inviteTitle");
|
|
|
|
User inviter2 = modelInvite.getInviter();
|
|
|
|
if (inviter2 != null) {
|
|
|
|
str = inviter2.r();
|
|
|
|
}
|
|
|
|
textView4.setText(getIntroText(str));
|
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getFormattedGuildName(String str) {
|
|
|
|
return b.l(a.t("**", str, "**"), new Object[0], null, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getIntroText(String str) {
|
2021-08-06 20:07:13 +00:00
|
|
|
return str == null ? b.j(this, 2131890681, new Object[0], null, 4) : b.j(this, 2131886769, new Object[]{str}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getIntroTextForGroup(String str, String str2) {
|
2021-08-06 20:07:13 +00:00
|
|
|
return str2.length() > 0 ? b.j(this, 2131886769, new Object[]{str}, null, 4) : b.j(this, 2131890683, new Object[0], null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getInviteSubtitleForDirectFriend(String str) {
|
2021-08-06 20:07:13 +00:00
|
|
|
return b.j(this, 2131890657, new Object[]{str}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getInviteTitleForDirectFriend(String str) {
|
2021-08-06 20:07:13 +00:00
|
|
|
return b.j(this, 2131890679, new Object[]{str}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getMembersCount(int i) {
|
|
|
|
Resources resources = getResources();
|
|
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
|
|
Context context = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
2021-08-06 20:07:13 +00:00
|
|
|
return b.j(this, 2131890668, new Object[]{StringResourceUtilsKt.getQuantityString(resources, context, 2131755201, i, Integer.valueOf(i))}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final CharSequence getMembersOnlineCount(int i) {
|
|
|
|
Context context = getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
2021-08-06 20:07:13 +00:00
|
|
|
return b.j(this, 2131890667, new Object[]{StringUtilsKt.format(i, context)}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void parseAttributeSet(Context context, AttributeSet attributeSet, int i) {
|
|
|
|
if (attributeSet != null) {
|
|
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.a.WidgetInviteInfo, i, 0);
|
|
|
|
m.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttr…iteInfo, defStyleAttr, 0)");
|
|
|
|
obtainStyledAttributes.recycle();
|
|
|
|
post(new WidgetInviteInfo$parseAttributeSet$1(this, (int) obtainStyledAttributes.getDimension(0, 0.0f), (int) obtainStyledAttributes.getDimension(1, 0.0f)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void configureUI(ModelInvite modelInvite) {
|
|
|
|
m.checkNotNullParameter(modelInvite, "model");
|
|
|
|
if (modelInvite.getGuild() == null && modelInvite.getChannel() == null && modelInvite.getInviter() != null) {
|
|
|
|
configureForDirectFriend(modelInvite);
|
|
|
|
} else if (modelInvite.getGuild() == null) {
|
|
|
|
configureForGDM(modelInvite);
|
|
|
|
} else {
|
|
|
|
configureForGuild(modelInvite);
|
|
|
|
}
|
|
|
|
LinearLayout linearLayout = this.binding.l;
|
|
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.inviteMembersWrap");
|
|
|
|
linearLayout.setVisibility(0);
|
|
|
|
TextView textView = this.binding.j;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.inviteMembersTotal");
|
|
|
|
textView.setText(getMembersCount(modelInvite.getApproximateMemberCount()));
|
|
|
|
TextView textView2 = this.binding.h;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.inviteMembersOnline");
|
|
|
|
textView2.setText(getMembersOnlineCount(modelInvite.getApproximatePresenceCount()));
|
|
|
|
RelativeLayout relativeLayout = this.binding.f;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.inviteAvatarWrap");
|
|
|
|
relativeLayout.setVisibility(0);
|
|
|
|
ImageView imageView = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.inviteExpiredImage");
|
|
|
|
imageView.setVisibility(8);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void configureUIFailure(Error error) {
|
2021-08-06 20:07:13 +00:00
|
|
|
this.binding.n.setText(2131890659);
|
|
|
|
this.binding.m.setText(2131890787);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (error != null) {
|
|
|
|
Error.Response response = error.getResponse();
|
|
|
|
m.checkNotNullExpressionValue(response, "e.response");
|
|
|
|
if (response.getCode() == 30001) {
|
2021-08-06 20:07:13 +00:00
|
|
|
this.binding.n.setText(2131894393);
|
|
|
|
this.binding.m.setText(2131894392);
|
2021-08-03 07:33:18 +00:00
|
|
|
this.binding.m.setTextSize(0, getResources().getDimension(2131165780));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TextView textView = this.binding.m;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.inviteMessage");
|
|
|
|
ViewExtensions.setCompoundDrawableWithIntrinsicBounds$default(textView, 0, 0, 0, 0, 15, null);
|
|
|
|
LinearLayout linearLayout = this.binding.l;
|
|
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.inviteMembersWrap");
|
|
|
|
linearLayout.setVisibility(8);
|
|
|
|
RelativeLayout relativeLayout = this.binding.f;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.inviteAvatarWrap");
|
|
|
|
relativeLayout.setVisibility(8);
|
|
|
|
RelativeLayout relativeLayout2 = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout2, "binding.inviteAvatarSmallWrap");
|
|
|
|
relativeLayout2.setVisibility(8);
|
|
|
|
CardView cardView = this.binding.d;
|
|
|
|
m.checkNotNullExpressionValue(cardView, "binding.inviteAvatarSmallCard");
|
|
|
|
cardView.setVisibility(8);
|
|
|
|
ImageView imageView = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.inviteExpiredImage");
|
|
|
|
imageView.setVisibility(0);
|
|
|
|
}
|
|
|
|
}
|