508 lines
15 KiB
Smali
508 lines
15 KiB
Smali
.class public final Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetChatOverlay.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/chat/overlay/WidgetChatOverlay;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "TypingIndicatorViewHolder"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final parent:Landroid/view/ViewGroup;
|
|
|
|
.field public final slowmodeIcon:Landroid/widget/ImageView;
|
|
|
|
.field public final slowmodeTv:Landroid/widget/TextView;
|
|
|
|
.field public final typingDots:Lcom/discord/views/typing/TypingDots;
|
|
|
|
.field public final typingTv:Landroid/widget/TextView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/view/ViewGroup;)V
|
|
.locals 1
|
|
|
|
const-string v0, "parent"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const v0, 0x7f0a027b
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "parent.findViewById(R.id.chat_typing_users_typing)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingTv:Landroid/widget/TextView;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const v0, 0x7f0a0275
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "parent.findViewById(R.id.chat_overlay_typing_dots)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Lcom/discord/views/typing/TypingDots;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingDots:Lcom/discord/views/typing/TypingDots;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const v0, 0x7f0a0279
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "parent.findViewById(R.id\u2026at_typing_users_slowmode)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->slowmodeTv:Landroid/widget/TextView;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const v0, 0x7f0a027a
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "parent.findViewById(R.id\u2026ping_users_slowmode_icon)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/ImageView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->slowmodeIcon:Landroid/widget/ImageView;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final configureTyping(Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;)V
|
|
.locals 7
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getTypingUsers()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
const/16 v1, 0x8
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getChannelRateLimit()I
|
|
|
|
move-result v0
|
|
|
|
if-gtz v0, :cond_0
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingDots:Lcom/discord/views/typing/TypingDots;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/views/typing/TypingDots;->c()V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {p1, v1}, Landroid/view/ViewGroup;->setVisibility(I)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, v2}, Landroid/view/ViewGroup;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, "parent.resources"
|
|
|
|
invoke-static {v0, v3}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getTypingUsers()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {p0, v0, v3}, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->getTypingString(Landroid/content/res/Resources;Ljava/util/List;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getCooldownSecs()I
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getChannelRateLimit()I
|
|
|
|
move-result v4
|
|
|
|
invoke-static {v0}, Ly/t/k;->isBlank(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v5
|
|
|
|
const/4 v6, 0x1
|
|
|
|
xor-int/2addr v5, v6
|
|
|
|
invoke-direct {p0, v3, v4, v5}, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->getSlowmodeText(IIZ)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingTv:Landroid/widget/TextView;
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/textprocessing/Parsers;->parseBoldMarkdown(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v4, v0}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingDots:Lcom/discord/views/typing/TypingDots;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getTypingUsers()Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v4
|
|
|
|
xor-int/2addr v4, v6
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/16 v4, 0x8
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->typingDots:Lcom/discord/views/typing/TypingDots;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getTypingUsers()Ljava/util/List;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v4
|
|
|
|
xor-int/2addr v4, v6
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-static {v0, v2, v6}, Lcom/discord/views/typing/TypingDots;->b(Lcom/discord/views/typing/TypingDots;ZI)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-virtual {v0}, Lcom/discord/views/typing/TypingDots;->c()V
|
|
|
|
:goto_1
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->slowmodeTv:Landroid/widget/TextView;
|
|
|
|
invoke-static {v0, v3}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->slowmodeIcon:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;->getChannelRateLimit()I
|
|
|
|
move-result p1
|
|
|
|
if-lez p1, :cond_3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v6, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v6, :cond_4
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:cond_4
|
|
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getSlowmodeText(IIZ)Ljava/lang/CharSequence;
|
|
.locals 6
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
int-to-long p1, p1
|
|
|
|
const-wide/16 v1, 0x3e8
|
|
|
|
mul-long v1, v1, p1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/utilities/time/TimeUtils;->toFriendlyStringSimple$default(Lcom/discord/utilities/time/TimeUtils;JLjava/lang/String;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
if-lez p2, :cond_1
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f12044c
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "parent.resources.getStri\u2026nnel_slowmode_desc_short)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const-string p1, ""
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final getTypingString(Landroid/content/res/Resources;Ljava/util/List;)Ljava/lang/String;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/res/Resources;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;)",
|
|
"Ljava/lang/String;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-interface {p2}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
const-string v1, "java.lang.String.format(format, *args)"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eq v0, v3, :cond_2
|
|
|
|
const/4 v4, 0x2
|
|
|
|
if-eq v0, v4, :cond_1
|
|
|
|
const/4 v5, 0x3
|
|
|
|
if-eq v0, v5, :cond_0
|
|
|
|
const p2, 0x7f12162a
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "resources.getString(R.string.several_users_typing)"
|
|
|
|
invoke-static {p1, p2}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const v0, 0x7f1217bb
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "resources.getString(R.string.three_users_typing)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-array v0, v5, [Ljava/lang/Object;
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
aput-object v6, v0, v2
|
|
|
|
invoke-interface {p2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, v0, v3
|
|
|
|
invoke-interface {p2, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v0, v4
|
|
|
|
invoke-static {v0, v5, p1, v1}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const v0, 0x7f121838
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "resources.getString(R.string.two_users_typing)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-array v0, v4, [Ljava/lang/Object;
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
aput-object v5, v0, v2
|
|
|
|
invoke-interface {p2, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v0, v3
|
|
|
|
invoke-static {v0, v4, p1, v1}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const v0, 0x7f1211a5
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "resources.getString(R.string.one_user_typing)"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-array v0, v3, [Ljava/lang/Object;
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v0, v2
|
|
|
|
invoke-static {v0, v3, p1, v1}, Lf/e/c/a/a;->B([Ljava/lang/Object;ILjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const-string p1, ""
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final configureUI(Lcom/discord/widgets/chat/overlay/ChatTypingModel;)V
|
|
.locals 1
|
|
|
|
const-string v0, "model"
|
|
|
|
invoke-static {p1, v0}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
instance-of v0, p1, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Hide;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
const/16 v0, 0x8
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->setVisibility(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
instance-of v0, p1, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
check-cast p1, Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->configureTyping(Lcom/discord/widgets/chat/overlay/ChatTypingModel$Typing;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final getParent()Landroid/view/ViewGroup;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/overlay/WidgetChatOverlay$TypingIndicatorViewHolder;->parent:Landroid/view/ViewGroup;
|
|
|
|
return-object v0
|
|
.end method
|