476 lines
11 KiB
Smali
476 lines
11 KiB
Smali
.class public Landroidx/appcompat/view/SupportMenuInflater;
|
|
.super Landroid/view/MenuInflater;
|
|
.source "SupportMenuInflater.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/appcompat/view/SupportMenuInflater$MenuState;,
|
|
Landroidx/appcompat/view/SupportMenuInflater$InflatedOnMenuItemClickListener;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE:[Ljava/lang/Class;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"[",
|
|
"Ljava/lang/Class<",
|
|
"*>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final ACTION_VIEW_CONSTRUCTOR_SIGNATURE:[Ljava/lang/Class;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"[",
|
|
"Ljava/lang/Class<",
|
|
"*>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final LOG_TAG:Ljava/lang/String; = "SupportMenuInflater"
|
|
|
|
.field public static final NO_ID:I = 0x0
|
|
|
|
.field public static final XML_GROUP:Ljava/lang/String; = "group"
|
|
|
|
.field public static final XML_ITEM:Ljava/lang/String; = "item"
|
|
|
|
.field public static final XML_MENU:Ljava/lang/String; = "menu"
|
|
|
|
|
|
# instance fields
|
|
.field public final mActionProviderConstructorArguments:[Ljava/lang/Object;
|
|
|
|
.field public final mActionViewConstructorArguments:[Ljava/lang/Object;
|
|
|
|
.field public mContext:Landroid/content/Context;
|
|
|
|
.field public mRealOwner:Ljava/lang/Object;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Ljava/lang/Class;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const-class v2, Landroid/content/Context;
|
|
|
|
aput-object v2, v0, v1
|
|
|
|
sput-object v0, Landroidx/appcompat/view/SupportMenuInflater;->ACTION_VIEW_CONSTRUCTOR_SIGNATURE:[Ljava/lang/Class;
|
|
|
|
sput-object v0, Landroidx/appcompat/view/SupportMenuInflater;->ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE:[Ljava/lang/Class;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 2
|
|
|
|
invoke-direct {p0, p1}, Landroid/view/MenuInflater;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/SupportMenuInflater;->mContext:Landroid/content/Context;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aput-object p1, v0, v1
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mActionViewConstructorArguments:[Ljava/lang/Object;
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mActionProviderConstructorArguments:[Ljava/lang/Object;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private findRealOwner(Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
instance-of v0, p1, Landroid/app/Activity;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
instance-of v0, p1, Landroid/content/ContextWrapper;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
check-cast p1, Landroid/content/ContextWrapper;
|
|
|
|
invoke-virtual {p1}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/appcompat/view/SupportMenuInflater;->findRealOwner(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_1
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private parseMenu(Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/view/Menu;)V
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/xmlpull/v1/XmlPullParserException;,
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/appcompat/view/SupportMenuInflater$MenuState;
|
|
|
|
invoke-direct {v0, p0, p3}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;-><init>(Landroidx/appcompat/view/SupportMenuInflater;Landroid/view/Menu;)V
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getEventType()I
|
|
|
|
move-result p3
|
|
|
|
:cond_0
|
|
const/4 v1, 0x2
|
|
|
|
const-string v2, "menu"
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-ne p3, v1, :cond_2
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I
|
|
|
|
move-result p3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Expecting menu, got "
|
|
|
|
invoke-static {p2, p3}, Lf/e/b/a/a;->p(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I
|
|
|
|
move-result p3
|
|
|
|
if-ne p3, v3, :cond_0
|
|
|
|
:goto_0
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v7, v4
|
|
|
|
:goto_1
|
|
if-nez v5, :cond_f
|
|
|
|
if-eq p3, v3, :cond_e
|
|
|
|
const-string v8, "item"
|
|
|
|
const-string v9, "group"
|
|
|
|
if-eq p3, v1, :cond_8
|
|
|
|
const/4 v10, 0x3
|
|
|
|
if-eq p3, v10, :cond_3
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_3
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
if-eqz v6, :cond_4
|
|
|
|
invoke-virtual {p3, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v10
|
|
|
|
if-eqz v10, :cond_4
|
|
|
|
const/4 p3, 0x0
|
|
|
|
move-object v7, v4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
invoke-virtual {p3, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v9
|
|
|
|
if-eqz v9, :cond_5
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->resetGroup()V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
invoke-virtual {p3, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_7
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->hasAddedItem()Z
|
|
|
|
move-result p3
|
|
|
|
if-nez p3, :cond_d
|
|
|
|
iget-object p3, v0, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->itemActionProvider:Landroidx/core/view/ActionProvider;
|
|
|
|
if-eqz p3, :cond_6
|
|
|
|
invoke-virtual {p3}, Landroidx/core/view/ActionProvider;->hasSubMenu()Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_6
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->addSubMenuItem()Landroid/view/SubMenu;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->addItem()V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_7
|
|
invoke-virtual {p3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_d
|
|
|
|
const/4 p3, 0x1
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_8
|
|
if-eqz v6, :cond_9
|
|
|
|
goto :goto_2
|
|
|
|
:cond_9
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p3, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v9
|
|
|
|
if-eqz v9, :cond_a
|
|
|
|
invoke-virtual {v0, p2}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->readGroup(Landroid/util/AttributeSet;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_a
|
|
invoke-virtual {p3, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_b
|
|
|
|
invoke-virtual {v0, p2}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->readItem(Landroid/util/AttributeSet;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_b
|
|
invoke-virtual {p3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_c
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/SupportMenuInflater$MenuState;->addSubMenuItem()Landroid/view/SubMenu;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/appcompat/view/SupportMenuInflater;->parseMenu(Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/view/Menu;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_c
|
|
const/4 v6, 0x1
|
|
|
|
move-object v7, p3
|
|
|
|
:cond_d
|
|
:goto_2
|
|
invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I
|
|
|
|
move-result p3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_e
|
|
new-instance p1, Ljava/lang/RuntimeException;
|
|
|
|
const-string p2, "Unexpected end of document"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_f
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getRealOwner()Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mRealOwner:Ljava/lang/Object;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mContext:Landroid/content/Context;
|
|
|
|
invoke-direct {p0, v0}, Landroidx/appcompat/view/SupportMenuInflater;->findRealOwner(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mRealOwner:Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/appcompat/view/SupportMenuInflater;->mRealOwner:Ljava/lang/Object;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public inflate(ILandroid/view/Menu;)V
|
|
.locals 3
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/LayoutRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
const-string v0, "Error inflating menu XML"
|
|
|
|
instance-of v1, p2, Landroidx/core/internal/view/SupportMenu;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
invoke-super {p0, p1, p2}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v2, p0, Landroidx/appcompat/view/SupportMenuInflater;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, p1}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, v1, p1, p2}, Landroidx/appcompat/view/SupportMenuInflater;->parseMenu(Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/view/Menu;)V
|
|
:try_end_0
|
|
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v1}, Landroid/content/res/XmlResourceParser;->close()V
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
:try_start_1
|
|
new-instance p2, Landroid/view/InflateException;
|
|
|
|
invoke-direct {p2, v0, p1}, Landroid/view/InflateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
new-instance p2, Landroid/view/InflateException;
|
|
|
|
invoke-direct {p2, v0, p1}, Landroid/view/InflateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
throw p2
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:goto_0
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v1}, Landroid/content/res/XmlResourceParser;->close()V
|
|
|
|
:cond_2
|
|
throw p1
|
|
.end method
|