368 lines
11 KiB
Smali
368 lines
11 KiB
Smali
.class public final Lcom/discord/widgets/user/presence/ViewHolderGameRichPresence;
|
|
.super Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
.source "ViewHolderGameRichPresence.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public final containerView:Landroid/view/View;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;-><init>(Landroid/view/View;I)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/user/presence/ViewHolderGameRichPresence;->containerView:Landroid/view/View;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "containerView"
|
|
|
|
invoke-static {p1}, Lz/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public configureTextUi(Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/utilities/streams/StreamContext;)V
|
|
.locals 8
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getState()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getParty()Lcom/discord/models/domain/activity/ModelActivityParty;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/activity/ModelActivityParty;->getMaxSize()J
|
|
|
|
move-result-wide v2
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
cmp-long v6, v2, v4
|
|
|
|
if-nez v6, :cond_1
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v2, p0, Lcom/discord/widgets/user/presence/ViewHolderGameRichPresence;->containerView:Landroid/view/View;
|
|
|
|
invoke-virtual {v2}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const v3, 0x7f12150c
|
|
|
|
const/4 v4, 0x2
|
|
|
|
new-array v4, v4, [Ljava/lang/Object;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/activity/ModelActivityParty;->getCurrentSize()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
aput-object v6, v4, v5
|
|
|
|
const/4 v5, 0x1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/activity/ModelActivityParty;->getMaxSize()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v4, v5
|
|
|
|
invoke-virtual {v2, v3, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
if-eqz v1, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const-string v1, ""
|
|
|
|
:goto_1
|
|
const-string v2, "model.party?.run {\n \u2026)\n }\n } ?: \"\""
|
|
|
|
invoke-static {v1, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const/16 p2, 0x20
|
|
|
|
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-static {p2}, Lz/a0/u;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
new-instance p1, Lz/l;
|
|
|
|
const-string p2, "null cannot be cast to non-null type kotlin.CharSequence"
|
|
|
|
invoke-direct {p1, p2}, Lz/l;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
move-object p2, v0
|
|
|
|
:goto_2
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getHeaderTv()Landroid/widget/TextView;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "headerTv"
|
|
|
|
invoke-static {v1, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getHeaderTv()Landroid/widget/TextView;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "headerTv.context"
|
|
|
|
invoke-static {v2, v3}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v2, p1}, Lcom/discord/utilities/presence/PresenceUtils;->getActivityHeader(Landroid/content/Context;Lcom/discord/models/domain/activity/ModelActivity;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getTitleTv()Landroid/widget/TextView;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "titleTv"
|
|
|
|
invoke-static {v1, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getDetailsTv()Landroid/widget/TextView;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "detailsTv"
|
|
|
|
invoke-static {v1, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getDetails()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v1, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getStateTv()Landroid/widget/TextView;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "stateTv"
|
|
|
|
invoke-static {v1, v2}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1, p2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getTimeTv()Landroid/widget/TextView;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "timeTv"
|
|
|
|
invoke-static {p2, v1}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getTimestamps()Lcom/discord/models/domain/activity/ModelActivityTimestamps;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->friendlyTime(Lcom/discord/models/domain/activity/ModelActivityTimestamps;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_5
|
|
invoke-static {p2, v0}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "model must not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public configureUi(Lcom/discord/widgets/user/presence/ModelRichPresence;Lcom/discord/utilities/streams/StreamContext;ZLcom/discord/models/domain/ModelUser;)V
|
|
.locals 9
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
.end annotation
|
|
|
|
invoke-super {p0, p1, p2, p3, p4}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->configureUi(Lcom/discord/widgets/user/presence/ModelRichPresence;Lcom/discord/utilities/streams/StreamContext;ZLcom/discord/models/domain/ModelUser;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getLargeIv()Lcom/facebook/drawee/view/SimpleDraweeView;
|
|
|
|
move-result-object p2
|
|
|
|
const-string p3, "largeIv"
|
|
|
|
invoke-static {p2, p3}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Landroid/widget/ImageView;->getVisibility()I
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/user/presence/ModelRichPresence;->getPrimaryApplication()Lcom/discord/models/domain/ModelApplication;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/utilities/icon/IconUtils;->INSTANCE:Lcom/discord/utilities/icon/IconUtils;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelApplication;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelApplication;->getIcon()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string p1, ""
|
|
|
|
:goto_0
|
|
move-object v3, p1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/utilities/icon/IconUtils;->getApplicationIcon$default(Lcom/discord/utilities/icon/IconUtils;JLjava/lang/String;IILjava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
:goto_1
|
|
move-object v1, p1
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getLargeIv()Lcom/facebook/drawee/view/SimpleDraweeView;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, p3}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setVisibility(I)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getLargeIv()Lcom/facebook/drawee/view/SimpleDraweeView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, p3}, Lz/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/16 v7, 0x7c
|
|
|
|
const/4 v8, 0x0
|
|
|
|
invoke-static/range {v0 .. v8}, Lcom/discord/utilities/images/MGImages;->setImage$default(Landroid/widget/ImageView;Ljava/lang/String;IIZLkotlin/jvm/functions/Function1;Lcom/discord/utilities/images/MGImages$ChangeDetector;ILjava/lang/Object;)V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|