257 lines
8 KiB
Smali
257 lines
8 KiB
Smali
|
.class public final Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;
|
||
|
.super Landroidx/core/view/AccessibilityDelegateCompat;
|
||
|
.source "ChatListItemMessageAccessibilityDelegate.kt"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final nameView:Landroid/widget/TextView;
|
||
|
|
||
|
.field public final tagView:Landroid/widget/TextView;
|
||
|
|
||
|
.field public final textView:Landroid/widget/TextView;
|
||
|
|
||
|
.field public final timestampView:Landroid/widget/TextView;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>(Landroid/widget/TextView;Landroid/widget/TextView;Landroid/widget/TextView;Landroid/widget/TextView;)V
|
||
|
.locals 1
|
||
|
|
||
|
const-string v0, "textView"
|
||
|
|
||
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0}, Landroidx/core/view/AccessibilityDelegateCompat;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->textView:Landroid/widget/TextView;
|
||
|
|
||
|
iput-object p2, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->nameView:Landroid/widget/TextView;
|
||
|
|
||
|
iput-object p3, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->tagView:Landroid/widget/TextView;
|
||
|
|
||
|
iput-object p4, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->timestampView:Landroid/widget/TextView;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public onInitializeAccessibilityNodeInfo(Landroid/view/View;Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat;)V
|
||
|
.locals 13
|
||
|
|
||
|
invoke-super {p0, p1, p2}, Landroidx/core/view/AccessibilityDelegateCompat;->onInitializeAccessibilityNodeInfo(Landroid/view/View;Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat;)V
|
||
|
|
||
|
if-eqz p2, :cond_b
|
||
|
|
||
|
if-nez p1, :cond_0
|
||
|
|
||
|
goto/16 :goto_2
|
||
|
|
||
|
:cond_0
|
||
|
new-instance v0, Landroid/text/SpannableStringBuilder;
|
||
|
|
||
|
iget-object v1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->textView:Landroid/widget/TextView;
|
||
|
|
||
|
invoke-virtual {v1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-direct {v0, v1}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/text/SpannableStringBuilder;->length()I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
const-class v2, LSpoilerSpan;
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
invoke-virtual {v0, v3, v1, v2}, Landroid/text/SpannableStringBuilder;->getSpans(IILjava/lang/Class;)[Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, [LSpoilerSpan;
|
||
|
|
||
|
array-length v2, v1
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
if-ge v4, v2, :cond_2
|
||
|
|
||
|
aget-object v5, v1, v4
|
||
|
|
||
|
iget-boolean v6, v5, LSpoilerSpan;->f:Z
|
||
|
|
||
|
if-nez v6, :cond_1
|
||
|
|
||
|
invoke-virtual {v0, v5}, Landroid/text/SpannableStringBuilder;->getSpanStart(Ljava/lang/Object;)I
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
invoke-virtual {v0, v5}, Landroid/text/SpannableStringBuilder;->getSpanEnd(Ljava/lang/Object;)I
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
const v7, 0x7f121530
|
||
|
|
||
|
invoke-static {p1, v7}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-virtual {v0, v6, v5, v7}, Landroid/text/SpannableStringBuilder;->replace(IILjava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
|
||
|
|
||
|
:cond_1
|
||
|
add-int/lit8 v4, v4, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_2
|
||
|
new-instance v5, Ljava/util/ArrayList;
|
||
|
|
||
|
invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V
|
||
|
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->nameView:Landroid/widget/TextView;
|
||
|
|
||
|
if-eqz p1, :cond_3
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const-string v1, "nameView.text"
|
||
|
|
||
|
invoke-static {p1, v1}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-interface {v5, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
:cond_3
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->tagView:Landroid/widget/TextView;
|
||
|
|
||
|
if-eqz p1, :cond_5
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/view/View;->getVisibility()I
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
if-nez p1, :cond_4
|
||
|
|
||
|
const/4 p1, 0x1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_4
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
:goto_1
|
||
|
if-eqz p1, :cond_5
|
||
|
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->tagView:Landroid/widget/TextView;
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const-string v1, "tagView.text"
|
||
|
|
||
|
invoke-static {p1, v1}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-interface {v5, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
:cond_5
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->timestampView:Landroid/widget/TextView;
|
||
|
|
||
|
if-eqz p1, :cond_6
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const-string v1, "timestampView.text"
|
||
|
|
||
|
invoke-static {p1, v1}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-interface {v5, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
:cond_6
|
||
|
invoke-interface {v5}, Ljava/util/Collection;->isEmpty()Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
xor-int/lit8 p1, p1, 0x1
|
||
|
|
||
|
if-eqz p1, :cond_7
|
||
|
|
||
|
new-instance p1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const/4 v7, 0x0
|
||
|
|
||
|
const/4 v8, 0x0
|
||
|
|
||
|
const/4 v9, 0x0
|
||
|
|
||
|
const/4 v10, 0x0
|
||
|
|
||
|
const/4 v11, 0x0
|
||
|
|
||
|
const/16 v12, 0x3e
|
||
|
|
||
|
const-string v6, ", "
|
||
|
|
||
|
invoke-static/range {v5 .. v12}, Lk0/i/f;->joinToString$default(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const-string v2, "\n"
|
||
|
|
||
|
invoke-static {p1, v1, v2}, Lf/e/b/a/a;->w(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {v0, v3, v3, p1}, Landroid/text/SpannableStringBuilder;->replace(IILjava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
|
||
|
|
||
|
:cond_7
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->nameView:Landroid/widget/TextView;
|
||
|
|
||
|
const/4 v1, 0x4
|
||
|
|
||
|
if-eqz p1, :cond_8
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setImportantForAccessibility(I)V
|
||
|
|
||
|
:cond_8
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->tagView:Landroid/widget/TextView;
|
||
|
|
||
|
if-eqz p1, :cond_9
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setImportantForAccessibility(I)V
|
||
|
|
||
|
:cond_9
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->timestampView:Landroid/widget/TextView;
|
||
|
|
||
|
if-eqz p1, :cond_a
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setImportantForAccessibility(I)V
|
||
|
|
||
|
:cond_a
|
||
|
iget-object p1, p0, Lcom/discord/widgets/chat/list/ChatListItemMessageAccessibilityDelegate;->textView:Landroid/widget/TextView;
|
||
|
|
||
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setImportantForAccessibility(I)V
|
||
|
|
||
|
invoke-virtual {p2, v0}, Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat;->setText(Ljava/lang/CharSequence;)V
|
||
|
|
||
|
sget-object p1, Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat$AccessibilityActionCompat;->ACTION_CLICK:Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat$AccessibilityActionCompat;
|
||
|
|
||
|
invoke-virtual {p2, p1}, Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat;->removeAction(Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat$AccessibilityActionCompat;)Z
|
||
|
|
||
|
const/16 p1, 0xf
|
||
|
|
||
|
invoke-virtual {p2, p1}, Landroidx/core/view/accessibility/AccessibilityNodeInfoCompat;->setMovementGranularities(I)V
|
||
|
|
||
|
:cond_b
|
||
|
:goto_2
|
||
|
return-void
|
||
|
.end method
|