247 lines
6.6 KiB
Smali
247 lines
6.6 KiB
Smali
.class public final Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "ViewHolderUserRichPresence.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final createRPView(Landroid/view/ViewGroup;I)Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
.locals 5
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const v2, 0x7f0d0270
|
|
|
|
const-string v3, "inflater.inflate(\n \u2026 parent\n )"
|
|
|
|
if-eq p2, v1, :cond_3
|
|
|
|
const/4 v1, 0x2
|
|
|
|
if-eq p2, v1, :cond_2
|
|
|
|
const/4 v4, 0x3
|
|
|
|
if-eq p2, v4, :cond_1
|
|
|
|
const/4 v4, 0x4
|
|
|
|
if-eq p2, v4, :cond_0
|
|
|
|
new-instance p2, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
|
|
invoke-virtual {v0, v2, p1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-direct {p2, p1, v0, v1, v2}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;-><init>(Landroid/view/View;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p2, Lcom/discord/widgets/user/presence/ViewHolderStreamRichPresence;
|
|
|
|
const v1, 0x7f0d025a
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/user/presence/ViewHolderStreamRichPresence;-><init>(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p2, Lcom/discord/widgets/user/presence/ViewHolderPlatformRichPresence;
|
|
|
|
const v1, 0x7f0d01ec
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/user/presence/ViewHolderPlatformRichPresence;-><init>(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
new-instance p2, Lcom/discord/widgets/user/presence/ViewHolderMusicRichPresence;
|
|
|
|
const v1, 0x7f0d01dc
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/user/presence/ViewHolderMusicRichPresence;-><init>(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
new-instance p2, Lcom/discord/widgets/user/presence/ViewHolderGameRichPresence;
|
|
|
|
invoke-virtual {v0, v2, p1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/user/presence/ViewHolderGameRichPresence;-><init>(Landroid/view/View;)V
|
|
|
|
:goto_0
|
|
return-object p2
|
|
.end method
|
|
|
|
.method private final getRPViewHolderType(Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/utilities/streams/StreamContext;)I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->isGamePlatform()Z
|
|
|
|
move-result p2
|
|
|
|
if-ne p2, v0, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->isGameActivity()Z
|
|
|
|
move-result p2
|
|
|
|
if-ne p2, v0, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/activity/ModelActivity;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
const-string p2, "spotify"
|
|
|
|
invoke-static {p1, p2, v0}, Ly/a0/p;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
const/4 v0, 0x2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
const/4 v0, 0x0
|
|
|
|
:goto_1
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final setRichPresence(Landroid/view/ViewGroup;Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/utilities/streams/StreamContext;Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;)Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-direct {p0, p2, p3}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence$Companion;->getRPViewHolderType(Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/utilities/streams/StreamContext;)I
|
|
|
|
move-result p2
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
invoke-virtual {p4}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->getRichPresenceType()I
|
|
|
|
move-result p3
|
|
|
|
if-eq p2, p3, :cond_1
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->removeAllViews()V
|
|
|
|
sget-object p3, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;->Companion:Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence$Companion;
|
|
|
|
invoke-direct {p3, p1, p2}, Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence$Companion;->createRPView(Landroid/view/ViewGroup;I)Lcom/discord/widgets/user/presence/ViewHolderUserRichPresence;
|
|
|
|
move-result-object p4
|
|
|
|
:cond_1
|
|
return-object p4
|
|
|
|
:cond_2
|
|
const-string p1, "parent"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|