apkfuckery/com.discord/smali/com/discord/widgets/servers/NotificationMuteSettingsView.smali
2019-12-12 09:58:10 +01:00

443 lines
13 KiB
Smali

.class public final Lcom/discord/widgets/servers/NotificationMuteSettingsView;
.super Landroid/widget/LinearLayout;
.source "NotificationMuteSettingsView.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;
}
.end annotation
# static fields
.field public static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
# instance fields
.field public final muteItem$delegate:Lkotlin/properties/ReadOnlyProperty;
.field public final muteItemDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
.field public final muteItemStatus$delegate:Lkotlin/properties/ReadOnlyProperty;
# direct methods
.method public static constructor <clinit>()V
.locals 6
const/4 v0, 0x3
new-array v0, v0, [Lkotlin/reflect/KProperty;
new-instance v1, Lm/u/b/u;
const-class v2, Lcom/discord/widgets/servers/NotificationMuteSettingsView;
invoke-static {v2}, Lm/u/b/w;->getOrCreateKotlinClass(Ljava/lang/Class;)Lm/y/b;
move-result-object v2
const-string v3, "muteItem"
const-string v4, "getMuteItem()Lcom/discord/app/AppTextView;"
invoke-direct {v1, v2, v3, v4}, Lm/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
sget-object v2, Lm/u/b/w;->a:Lm/u/b/x;
invoke-virtual {v2, v1}, Lm/u/b/x;->property1(Lm/u/b/t;)Lm/y/d;
const/4 v2, 0x0
aput-object v1, v0, v2
const/4 v1, 0x1
new-instance v2, Lm/u/b/u;
const-class v3, Lcom/discord/widgets/servers/NotificationMuteSettingsView;
invoke-static {v3}, Lm/u/b/w;->getOrCreateKotlinClass(Ljava/lang/Class;)Lm/y/b;
move-result-object v3
const-string v4, "muteItemStatus"
const-string v5, "getMuteItemStatus()Landroid/widget/TextView;"
invoke-direct {v2, v3, v4, v5}, Lm/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
sget-object v3, Lm/u/b/w;->a:Lm/u/b/x;
invoke-virtual {v3, v2}, Lm/u/b/x;->property1(Lm/u/b/t;)Lm/y/d;
aput-object v2, v0, v1
const/4 v1, 0x2
new-instance v2, Lm/u/b/u;
const-class v3, Lcom/discord/widgets/servers/NotificationMuteSettingsView;
invoke-static {v3}, Lm/u/b/w;->getOrCreateKotlinClass(Ljava/lang/Class;)Lm/y/b;
move-result-object v3
const-string v4, "muteItemDescription"
const-string v5, "getMuteItemDescription()Landroid/widget/TextView;"
invoke-direct {v2, v3, v4, v5}, Lm/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
sget-object v3, Lm/u/b/w;->a:Lm/u/b/x;
invoke-virtual {v3, v2}, Lm/u/b/x;->property1(Lm/u/b/t;)Lm/y/d;
aput-object v2, v0, v1
sput-object v0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
const/4 v0, 0x0
if-eqz p1, :cond_1
if-eqz p2, :cond_0
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const p2, 0x7f0a04c5
invoke-static {p0, p2}, Le/k/a/b/e/p/g;->a(Landroid/view/View;I)Lkotlin/properties/ReadOnlyProperty;
move-result-object p2
iput-object p2, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItem$delegate:Lkotlin/properties/ReadOnlyProperty;
const p2, 0x7f0a04c7
invoke-static {p0, p2}, Le/k/a/b/e/p/g;->a(Landroid/view/View;I)Lkotlin/properties/ReadOnlyProperty;
move-result-object p2
iput-object p2, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItemStatus$delegate:Lkotlin/properties/ReadOnlyProperty;
const p2, 0x7f0a04c6
invoke-static {p0, p2}, Le/k/a/b/e/p/g;->a(Landroid/view/View;I)Lkotlin/properties/ReadOnlyProperty;
move-result-object p2
iput-object p2, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItemDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
const p2, 0x7f0d004e
invoke-static {p1, p2, p0}, Landroid/widget/LinearLayout;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
return-void
:cond_0
const-string p1, "attrs"
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_1
const-string p1, "context"
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method private final getMuteItem()Lcom/discord/app/AppTextView;
.locals 3
iget-object v0, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItem$delegate:Lkotlin/properties/ReadOnlyProperty;
sget-object v1, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
const/4 v2, 0x0
aget-object v1, v1, v2
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/discord/app/AppTextView;
return-object v0
.end method
.method private final getMuteItemDescription()Landroid/widget/TextView;
.locals 3
iget-object v0, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItemDescription$delegate:Lkotlin/properties/ReadOnlyProperty;
sget-object v1, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
const/4 v2, 0x2
aget-object v1, v1, v2
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
return-object v0
.end method
.method private final getMuteItemStatus()Landroid/widget/TextView;
.locals 3
iget-object v0, p0, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->muteItemStatus$delegate:Lkotlin/properties/ReadOnlyProperty;
sget-object v1, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
const/4 v2, 0x1
aget-object v1, v1, v2
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
return-object v0
.end method
# virtual methods
.method public final updateView(Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)V
.locals 15
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;",
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
">;",
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
">;)V"
}
.end annotation
move-object/from16 v0, p2
move-object/from16 v1, p3
const/4 v2, 0x0
if-eqz p1, :cond_6
if-eqz v0, :cond_5
if-eqz v1, :cond_4
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getRawMuteText()Ljava/lang/String;
move-result-object v3
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->isMuted()Z
move-result v4
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getMuteEndTime()Ljava/lang/String;
move-result-object v6
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getMuteDescriptionText()Ljava/lang/String;
move-result-object v13
if-eqz v4, :cond_0
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getRawUnmuteText()Ljava/lang/String;
move-result-object v3
:cond_0
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItem()Lcom/discord/app/AppTextView;
move-result-object v5
const/4 v14, 0x0
new-array v7, v14, [Ljava/lang/Object;
invoke-virtual {v5, v3, v7}, Lcom/discord/app/AppTextView;->a(Ljava/lang/String;[Ljava/lang/Object;)V
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItem()Lcom/discord/app/AppTextView;
move-result-object v3
new-instance v5, Lcom/discord/widgets/servers/NotificationMuteSettingsView$updateView$1;
invoke-direct {v5, v4, v1, v0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$updateView$1;-><init>(ZLkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)V
invoke-virtual {v3, v5}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
const/4 v0, 0x1
const-string v1, "context"
if-eqz v4, :cond_2
if-eqz v6, :cond_1
sget-object v5, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
move-result-object v7
invoke-static {v7, v1}, Lm/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const/4 v8, 0x0
const/4 v9, 0x2
const/4 v10, 0x3
const/4 v11, 0x4
const/4 v12, 0x0
invoke-static/range {v5 .. v12}, Lcom/discord/utilities/time/TimeUtils;->renderUtcDateTime$default(Lcom/discord/utilities/time/TimeUtils;Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;IIILjava/lang/Object;)Ljava/lang/String;
move-result-object v3
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getRawMutedUntilStatusResId()I
move-result v5
new-array v6, v0, [Ljava/lang/Object;
aput-object v3, v6, v14
move-object v3, p0
invoke-static {p0, v5, v6}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v5
goto :goto_0
:cond_1
move-object v3, p0
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/servers/NotificationMuteSettingsView$ViewState;->getRawMutedStatusText()Ljava/lang/String;
move-result-object v5
goto :goto_0
:cond_2
move-object v3, p0
const-string v5, ""
:goto_0
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItemStatus()Landroid/widget/TextView;
move-result-object v6
sget-object v7, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
move-result-object v8
invoke-static {v8, v1}, Lm/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {p0}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
move-result-object v1
const v9, 0x7f06002c
invoke-static {v1, v9}, Lcom/discord/utilities/color/ColorCompat;->getColor(Landroid/content/Context;I)I
move-result v1
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v7, v8, v5, v1}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;)Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v6, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItemStatus()Landroid/widget/TextView;
move-result-object v1
const/4 v5, 0x2
invoke-static {v1, v4, v14, v5, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItemDescription()Landroid/widget/TextView;
move-result-object v1
if-eqz v13, :cond_3
goto :goto_1
:cond_3
const/4 v0, 0x0
:goto_1
invoke-static {v1, v0, v14, v5, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
invoke-direct {p0}, Lcom/discord/widgets/servers/NotificationMuteSettingsView;->getMuteItemDescription()Landroid/widget/TextView;
move-result-object v0
invoke-virtual {v0, v13}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
return-void
:cond_4
move-object v3, p0
const-string v0, "onUnmute"
invoke-static {v0}, Lm/u/b/j;->a(Ljava/lang/String;)V
throw v2
:cond_5
move-object v3, p0
const-string v0, "onMute"
invoke-static {v0}, Lm/u/b/j;->a(Ljava/lang/String;)V
throw v2
:cond_6
move-object v3, p0
const-string v0, "viewState"
invoke-static {v0}, Lm/u/b/j;->a(Ljava/lang/String;)V
throw v2
.end method