281 lines
8.5 KiB
Smali
281 lines
8.5 KiB
Smali
|
|
.class public Lcom/google/android/material/bottomnavigation/BottomNavigationView;
|
||
|
|
.super Lcom/google/android/material/navigation/NavigationBarView;
|
||
|
|
.source "BottomNavigationView.java"
|
||
|
|
|
||
|
|
|
||
|
|
# annotations
|
||
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
|
value = {
|
||
|
|
Lcom/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemReselectedListener;,
|
||
|
|
Lcom/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemSelectedListener;
|
||
|
|
}
|
||
|
|
.end annotation
|
||
|
|
|
||
|
|
|
||
|
|
# static fields
|
||
|
|
.field static final MAX_ITEM_COUNT:I = 0x5
|
||
|
|
|
||
|
|
|
||
|
|
# direct methods
|
||
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
const/4 v0, 0x0
|
||
|
|
|
||
|
|
.line 89
|
||
|
|
invoke-direct {p0, p1, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
.line 93
|
||
|
|
sget v0, Lcom/google/android/material/R$attr;->bottomNavigationStyle:I
|
||
|
|
|
||
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
.line 98
|
||
|
|
sget v0, Lcom/google/android/material/R$style;->Widget_Design_BottomNavigationView:I
|
||
|
|
|
||
|
|
invoke-direct {p0, p1, p2, p3, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
||
|
|
.locals 6
|
||
|
|
|
||
|
|
.line 103
|
||
|
|
invoke-direct {p0, p1, p2, p3, p4}, Lcom/google/android/material/navigation/NavigationBarView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
||
|
|
|
||
|
|
.line 106
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getContext()Landroid/content/Context;
|
||
|
|
|
||
|
|
move-result-object p1
|
||
|
|
|
||
|
|
.line 109
|
||
|
|
sget-object v2, Lcom/google/android/material/R$styleable;->BottomNavigationView:[I
|
||
|
|
|
||
|
|
const/4 v0, 0x0
|
||
|
|
|
||
|
|
new-array v5, v0, [I
|
||
|
|
|
||
|
|
move-object v0, p1
|
||
|
|
|
||
|
|
move-object v1, p2
|
||
|
|
|
||
|
|
move v3, p3
|
||
|
|
|
||
|
|
move v4, p4
|
||
|
|
|
||
|
|
.line 110
|
||
|
|
invoke-static/range {v0 .. v5}, Lcom/google/android/material/internal/ThemeEnforcement;->obtainTintedStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[III[I)Landroidx/appcompat/widget/TintTypedArray;
|
||
|
|
|
||
|
|
move-result-object p2
|
||
|
|
|
||
|
|
.line 113
|
||
|
|
sget p3, Lcom/google/android/material/R$styleable;->BottomNavigationView_itemHorizontalTranslationEnabled:I
|
||
|
|
|
||
|
|
const/4 p4, 0x1
|
||
|
|
|
||
|
|
.line 114
|
||
|
|
invoke-virtual {p2, p3, p4}, Landroidx/appcompat/widget/TintTypedArray;->getBoolean(IZ)Z
|
||
|
|
|
||
|
|
move-result p3
|
||
|
|
|
||
|
|
.line 113
|
||
|
|
invoke-virtual {p0, p3}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->setItemHorizontalTranslationEnabled(Z)V
|
||
|
|
|
||
|
|
.line 117
|
||
|
|
invoke-virtual {p2}, Landroidx/appcompat/widget/TintTypedArray;->recycle()V
|
||
|
|
|
||
|
|
.line 119
|
||
|
|
invoke-direct {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->shouldDrawCompatibilityTopDivider()Z
|
||
|
|
|
||
|
|
move-result p2
|
||
|
|
|
||
|
|
if-eqz p2, :cond_0
|
||
|
|
|
||
|
|
.line 120
|
||
|
|
invoke-direct {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->addCompatibilityTopDivider(Landroid/content/Context;)V
|
||
|
|
|
||
|
|
:cond_0
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method private addCompatibilityTopDivider(Landroid/content/Context;)V
|
||
|
|
.locals 3
|
||
|
|
|
||
|
|
.line 177
|
||
|
|
new-instance v0, Landroid/view/View;
|
||
|
|
|
||
|
|
invoke-direct {v0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V
|
||
|
|
|
||
|
|
.line 178
|
||
|
|
sget v1, Lcom/google/android/material/R$color;->design_bottom_navigation_shadow_color:I
|
||
|
|
|
||
|
|
.line 179
|
||
|
|
invoke-static {p1, v1}, Landroidx/core/content/ContextCompat;->getColor(Landroid/content/Context;I)I
|
||
|
|
|
||
|
|
move-result p1
|
||
|
|
|
||
|
|
.line 178
|
||
|
|
invoke-virtual {v0, p1}, Landroid/view/View;->setBackgroundColor(I)V
|
||
|
|
|
||
|
|
.line 180
|
||
|
|
new-instance p1, Landroid/widget/FrameLayout$LayoutParams;
|
||
|
|
|
||
|
|
.line 183
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getResources()Landroid/content/res/Resources;
|
||
|
|
|
||
|
|
move-result-object v1
|
||
|
|
|
||
|
|
sget v2, Lcom/google/android/material/R$dimen;->design_bottom_navigation_shadow_height:I
|
||
|
|
|
||
|
|
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
||
|
|
|
||
|
|
move-result v1
|
||
|
|
|
||
|
|
const/4 v2, -0x1
|
||
|
|
|
||
|
|
invoke-direct {p1, v2, v1}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
|
||
|
|
|
||
|
|
.line 184
|
||
|
|
invoke-virtual {v0, p1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
|
||
|
|
|
||
|
|
.line 185
|
||
|
|
invoke-virtual {p0, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->addView(Landroid/view/View;)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method private shouldDrawCompatibilityTopDivider()Z
|
||
|
|
.locals 2
|
||
|
|
|
||
|
|
.line 168
|
||
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
||
|
|
|
||
|
|
const/16 v1, 0x15
|
||
|
|
|
||
|
|
if-ge v0, v1, :cond_0
|
||
|
|
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getBackground()Landroid/graphics/drawable/Drawable;
|
||
|
|
|
||
|
|
move-result-object v0
|
||
|
|
|
||
|
|
instance-of v0, v0, Lcom/google/android/material/shape/MaterialShapeDrawable;
|
||
|
|
|
||
|
|
if-nez v0, :cond_0
|
||
|
|
|
||
|
|
const/4 v0, 0x1
|
||
|
|
|
||
|
|
goto :goto_0
|
||
|
|
|
||
|
|
:cond_0
|
||
|
|
const/4 v0, 0x0
|
||
|
|
|
||
|
|
:goto_0
|
||
|
|
return v0
|
||
|
|
.end method
|
||
|
|
|
||
|
|
|
||
|
|
# virtual methods
|
||
|
|
.method protected createNavigationBarMenuView(Landroid/content/Context;)Lcom/google/android/material/navigation/NavigationBarMenuView;
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
.line 160
|
||
|
|
new-instance v0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;
|
||
|
|
|
||
|
|
invoke-direct {v0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;-><init>(Landroid/content/Context;)V
|
||
|
|
|
||
|
|
return-object v0
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public getMaxItemCount()I
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
const/4 v0, 0x5
|
||
|
|
|
||
|
|
return v0
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public isItemHorizontalTranslationEnabled()Z
|
||
|
|
.locals 1
|
||
|
|
|
||
|
|
.line 147
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getMenuView()Landroidx/appcompat/view/menu/MenuView;
|
||
|
|
|
||
|
|
move-result-object v0
|
||
|
|
|
||
|
|
check-cast v0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;
|
||
|
|
|
||
|
|
invoke-virtual {v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->isItemHorizontalTranslationEnabled()Z
|
||
|
|
|
||
|
|
move-result v0
|
||
|
|
|
||
|
|
return v0
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public setItemHorizontalTranslationEnabled(Z)V
|
||
|
|
.locals 2
|
||
|
|
|
||
|
|
.line 132
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getMenuView()Landroidx/appcompat/view/menu/MenuView;
|
||
|
|
|
||
|
|
move-result-object v0
|
||
|
|
|
||
|
|
check-cast v0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;
|
||
|
|
|
||
|
|
.line 133
|
||
|
|
invoke-virtual {v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->isItemHorizontalTranslationEnabled()Z
|
||
|
|
|
||
|
|
move-result v1
|
||
|
|
|
||
|
|
if-eq v1, p1, :cond_0
|
||
|
|
|
||
|
|
.line 134
|
||
|
|
invoke-virtual {v0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->setItemHorizontalTranslationEnabled(Z)V
|
||
|
|
|
||
|
|
.line 135
|
||
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->getPresenter()Lcom/google/android/material/navigation/NavigationBarPresenter;
|
||
|
|
|
||
|
|
move-result-object p1
|
||
|
|
|
||
|
|
const/4 v0, 0x0
|
||
|
|
|
||
|
|
invoke-virtual {p1, v0}, Lcom/google/android/material/navigation/NavigationBarPresenter;->updateMenuView(Z)V
|
||
|
|
|
||
|
|
:cond_0
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public setOnNavigationItemReselectedListener(Lcom/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemReselectedListener;)V
|
||
|
|
.locals 0
|
||
|
|
.annotation runtime Ljava/lang/Deprecated;
|
||
|
|
.end annotation
|
||
|
|
|
||
|
|
.line 212
|
||
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->setOnItemReselectedListener(Lcom/google/android/material/navigation/NavigationBarView$OnItemReselectedListener;)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|
||
|
|
|
||
|
|
.method public setOnNavigationItemSelectedListener(Lcom/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemSelectedListener;)V
|
||
|
|
.locals 0
|
||
|
|
.annotation runtime Ljava/lang/Deprecated;
|
||
|
|
.end annotation
|
||
|
|
|
||
|
|
.line 199
|
||
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationView;->setOnItemSelectedListener(Lcom/google/android/material/navigation/NavigationBarView$OnItemSelectedListener;)V
|
||
|
|
|
||
|
|
return-void
|
||
|
|
.end method
|