360 lines
10 KiB
Smali
360 lines
10 KiB
Smali
.class public Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;
|
|
.super Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;
|
|
.source "WidgetSearchSuggestionsAdapter.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x9
|
|
name = "FilterViewHolder"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder<",
|
|
"Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public answerTextView:Landroid/widget/TextView;
|
|
|
|
.field public container:Landroid/view/View;
|
|
|
|
.field public filterTextView:Landroid/widget/TextView;
|
|
|
|
.field public icon:Landroid/widget/ImageView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;)V
|
|
.locals 1
|
|
|
|
const v0, 0x7f0d01e0
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;-><init>(ILcom/discord/utilities/mg_recycler/MGRecyclerAdapter;)V
|
|
|
|
iget-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0833
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->container:Landroid/view/View;
|
|
|
|
iget-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0835
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/ImageView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->icon:Landroid/widget/ImageView;
|
|
|
|
iget-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0834
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->filterTextView:Landroid/widget/TextView;
|
|
|
|
iget-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0832
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->answerTextView:Landroid/widget/TextView;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private getAnswerText(Lcom/discord/utilities/search/query/FilterType;)I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/StringRes;
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const p1, 0x7f12104a
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const p1, 0x7f1210b4
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
const p1, 0x7f1210ad
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
const p1, 0x7f1210b6
|
|
|
|
return p1
|
|
|
|
:cond_3
|
|
const p1, 0x7f1210ac
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private getFilterText(Lcom/discord/utilities/search/query/FilterType;)I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/StringRes;
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const p1, 0x7f12104a
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const p1, 0x7f1210c7
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
const p1, 0x7f1210c6
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
const p1, 0x7f1210c9
|
|
|
|
return p1
|
|
|
|
:cond_3
|
|
const p1, 0x7f1210c5
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private getIconSrc(Lcom/discord/utilities/search/query/FilterType;)I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const p1, 0x7f0404bd
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
const p1, 0x7f0404bc
|
|
|
|
return p1
|
|
|
|
:cond_2
|
|
const p1, 0x7f0404c3
|
|
|
|
return p1
|
|
|
|
:cond_3
|
|
const p1, 0x7f0404c4
|
|
|
|
return p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public synthetic a(Lcom/discord/utilities/search/query/FilterType;Landroid/view/View;)V
|
|
.locals 0
|
|
|
|
iget-object p2, p0, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;->adapter:Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
check-cast p2, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;
|
|
|
|
invoke-static {p2}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;->access$000(Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter;)Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$OnSuggestionClickedListener;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p2, p1}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$OnSuggestionClickedListener;->onFilterClicked(Lcom/discord/utilities/search/query/FilterType;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onConfigure(ILcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;)V
|
|
.locals 4
|
|
|
|
invoke-super {p0, p1, p2}, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;->onConfigure(ILjava/lang/Object;)V
|
|
|
|
check-cast p2, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterItem;
|
|
|
|
iget-object p1, p2, Lcom/discord/utilities/mg_recycler/SingleTypePayload;->data:Ljava/lang/Object;
|
|
|
|
check-cast p1, Lcom/discord/utilities/search/suggestion/entries/FilterSuggestion;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/search/suggestion/entries/FilterSuggestion;->getFilterType()Lcom/discord/utilities/search/query/FilterType;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->getIconSrc(Lcom/discord/utilities/search/query/FilterType;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->getFilterText(Lcom/discord/utilities/search/query/FilterType;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->getAnswerText(Lcom/discord/utilities/search/query/FilterType;)I
|
|
|
|
move-result v1
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->filterTextView:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v2}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->answerTextView:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v2}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->container:Landroid/view/View;
|
|
|
|
new-instance v3, Le/a/k/d/p/c;
|
|
|
|
invoke-direct {v3, p0, p1}, Le/a/k/d/p/c;-><init>(Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;Lcom/discord/utilities/search/query/FilterType;)V
|
|
|
|
invoke-virtual {v2, v3}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->icon:Landroid/widget/ImageView;
|
|
|
|
invoke-static {p1, p2}, Lcom/discord/utilities/drawable/DrawableCompat;->getThemedDrawableRes(Landroid/view/View;I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->filterTextView:Landroid/widget/TextView;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "**"
|
|
|
|
invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "**:"
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Le/a/g/a/b/b;->a(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->answerTextView:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public bridge synthetic onConfigure(ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p2, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/search/suggestions/WidgetSearchSuggestionsAdapter$FilterViewHolder;->onConfigure(ILcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;)V
|
|
|
|
return-void
|
|
.end method
|