apkfuckery/com.discord/smali/androidx/browser/browseractions/BrowserActionsFallbackMenuAdapter.smali

243 lines
7.9 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;
.super Landroid/widget/BaseAdapter;
.source "BrowserActionsFallbackMenuAdapter.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;
}
.end annotation
2020-07-08 16:44:49 +00:00
.annotation runtime Ljava/lang/Deprecated;
.end annotation
2020-05-17 12:40:10 +00:00
# instance fields
.field public final mContext:Landroid/content/Context;
.field public final mMenuItems:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Landroidx/browser/browseractions/BrowserActionItem;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Ljava/util/List;Landroid/content/Context;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/browser/browseractions/BrowserActionItem;",
">;",
"Landroid/content/Context;",
")V"
}
.end annotation
invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V
iput-object p1, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mMenuItems:Ljava/util/List;
iput-object p2, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mContext:Landroid/content/Context;
return-void
.end method
# virtual methods
.method public getCount()I
.locals 1
iget-object v0, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mMenuItems:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
return v0
.end method
.method public getItem(I)Ljava/lang/Object;
.locals 1
iget-object v0, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mMenuItems:Ljava/util/List;
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object p1
return-object p1
.end method
.method public getItemId(I)J
.locals 2
int-to-long v0, p1
return-wide v0
.end method
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
.locals 3
iget-object p3, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mMenuItems:Ljava/util/List;
invoke-interface {p3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroidx/browser/browseractions/BrowserActionItem;
const/4 p3, 0x0
2020-07-08 16:44:49 +00:00
if-nez p2, :cond_1
2020-05-17 12:40:10 +00:00
iget-object p2, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mContext:Landroid/content/Context;
invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object p2
sget v0, Landroidx/browser/R$layout;->browser_actions_context_menu_row:I
invoke-virtual {p2, v0, p3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object p2
2020-07-08 16:44:49 +00:00
sget v0, Landroidx/browser/R$id;->browser_actions_menu_item_icon:I
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
check-cast v0, Landroid/widget/ImageView;
2020-05-17 12:40:10 +00:00
sget v1, Landroidx/browser/R$id;->browser_actions_menu_item_text:I
invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v1
check-cast v1, Landroid/widget/TextView;
2020-07-08 16:44:49 +00:00
if-eqz v0, :cond_0
if-eqz v1, :cond_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
new-instance v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;
invoke-direct {v2, v0, v1}, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;-><init>(Landroid/widget/ImageView;Landroid/widget/TextView;)V
invoke-virtual {p2, v2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V
2020-05-17 12:40:10 +00:00
goto :goto_0
:cond_0
2020-07-08 16:44:49 +00:00
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Browser Actions fallback UI does not contain necessary Views."
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
2020-05-17 12:40:10 +00:00
invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v0
2020-07-08 16:44:49 +00:00
move-object v2, v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
check-cast v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:goto_0
2020-05-17 12:40:10 +00:00
invoke-virtual {p1}, Landroidx/browser/browseractions/BrowserActionItem;->getTitle()Ljava/lang/String;
2020-07-08 16:44:49 +00:00
move-result-object v0
iget-object v1, v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;->mText:Landroid/widget/TextView;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
2020-05-17 12:40:10 +00:00
invoke-virtual {p1}, Landroidx/browser/browseractions/BrowserActionItem;->getIconId()I
move-result v1
2020-07-08 16:44:49 +00:00
if-eqz v1, :cond_2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
iget-object v0, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mContext:Landroid/content/Context;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
invoke-virtual {p1}, Landroidx/browser/browseractions/BrowserActionItem;->getIconId()I
move-result p1
2020-07-08 16:44:49 +00:00
invoke-static {v0, p1, p3}, Landroidx/core/content/res/ResourcesCompat;->getDrawable(Landroid/content/res/Resources;ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
2020-05-17 12:40:10 +00:00
move-result-object p1
2020-07-08 16:44:49 +00:00
iget-object p3, v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;->mIcon:Landroid/widget/ImageView;
2020-05-17 12:40:10 +00:00
invoke-virtual {p3, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
goto :goto_1
2020-07-08 16:44:49 +00:00
:cond_2
invoke-virtual {p1}, Landroidx/browser/browseractions/BrowserActionItem;->getIconUri()Landroid/net/Uri;
move-result-object v1
if-eqz v1, :cond_3
iget-object p3, p0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;->mContext:Landroid/content/Context;
invoke-virtual {p3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object p3
invoke-virtual {p1}, Landroidx/browser/browseractions/BrowserActionItem;->getIconUri()Landroid/net/Uri;
move-result-object p1
2020-07-23 01:06:17 +00:00
invoke-static {p3, p1}, Landroidx/browser/browseractions/BrowserServiceFileProvider;->loadBitmap(Landroid/content/ContentResolver;Landroid/net/Uri;)Lf/h/b/a/a/a;
2020-07-08 16:44:49 +00:00
move-result-object p1
new-instance p3, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$1;
2020-07-23 01:06:17 +00:00
invoke-direct {p3, p0, v0, v2, p1}, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$1;-><init>(Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;Ljava/lang/String;Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;Lf/h/b/a/a/a;)V
2020-07-08 16:44:49 +00:00
new-instance v0, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$2;
invoke-direct {v0, p0}, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$2;-><init>(Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter;)V
2020-07-23 01:06:17 +00:00
invoke-interface {p1, p3, v0}, Lf/h/b/a/a/a;->addListener(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V
2020-07-08 16:44:49 +00:00
goto :goto_1
:cond_3
iget-object p1, v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;->mIcon:Landroid/widget/ImageView;
invoke-virtual {p1, p3}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
iget-object p1, v2, Landroidx/browser/browseractions/BrowserActionsFallbackMenuAdapter$ViewHolderItem;->mIcon:Landroid/widget/ImageView;
const/4 p3, 0x4
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p1, p3}, Landroid/widget/ImageView;->setVisibility(I)V
2020-05-17 12:40:10 +00:00
:goto_1
return-object p2
.end method