1603 lines
48 KiB
Smali
1603 lines
48 KiB
Smali
.class public Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;
|
|
.super Landroid/view/ViewGroup;
|
|
.source "BottomNavigationMenuView.java"
|
|
|
|
# interfaces
|
|
.implements Landroidx/appcompat/view/menu/MenuView;
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final ACTIVE_ANIMATION_DURATION_MS:J = 0x73L
|
|
|
|
.field private static final CHECKED_STATE_SET:[I
|
|
|
|
.field private static final DISABLED_STATE_SET:[I
|
|
|
|
|
|
# instance fields
|
|
.field private final activeItemMaxWidth:I
|
|
|
|
.field private final activeItemMinWidth:I
|
|
|
|
.field private buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
.field private final inactiveItemMaxWidth:I
|
|
|
|
.field private final inactiveItemMinWidth:I
|
|
|
|
.field private itemBackground:Landroid/graphics/drawable/Drawable;
|
|
|
|
.field private itemBackgroundRes:I
|
|
|
|
.field private final itemHeight:I
|
|
|
|
.field private itemHorizontalTranslationEnabled:Z
|
|
|
|
.field private itemIconSize:I
|
|
.annotation build Landroidx/annotation/Dimension;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private itemIconTint:Landroid/content/res/ColorStateList;
|
|
|
|
.field private final itemPool:Landroidx/core/util/Pools$Pool;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/core/util/Pools$Pool<",
|
|
"Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private itemTextAppearanceActive:I
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private itemTextAppearanceInactive:I
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final itemTextColorDefault:Landroid/content/res/ColorStateList;
|
|
|
|
.field private itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
.field private labelVisibilityMode:I
|
|
|
|
.field private menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
.field private final onClickListener:Landroid/view/View$OnClickListener;
|
|
|
|
.field private presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
.field private selectedItemId:I
|
|
|
|
.field private selectedItemPosition:I
|
|
|
|
.field private final set:Landroidx/transition/TransitionSet;
|
|
|
|
.field private tempChildWidths:[I
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v1, v0, [I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const v3, 0x10100a0
|
|
|
|
aput v3, v1, v2
|
|
|
|
sput-object v1, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->CHECKED_STATE_SET:[I
|
|
|
|
new-array v0, v0, [I
|
|
|
|
const v1, -0x101009e
|
|
|
|
aput v1, v0, v2
|
|
|
|
sput-object v0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->DISABLED_STATE_SET:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 2
|
|
|
|
invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
new-instance p1, Landroidx/core/util/Pools$SynchronizedPool;
|
|
|
|
const/4 p2, 0x5
|
|
|
|
invoke-direct {p1, p2}, Landroidx/core/util/Pools$SynchronizedPool;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemPool:Landroidx/core/util/Pools$Pool;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->design_bottom_navigation_item_max_width:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->inactiveItemMaxWidth:I
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->design_bottom_navigation_item_min_width:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->inactiveItemMinWidth:I
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->design_bottom_navigation_active_item_max_width:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMaxWidth:I
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->design_bottom_navigation_active_item_min_width:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMinWidth:I
|
|
|
|
sget v1, Lcom/google/android/material/R$dimen;->design_bottom_navigation_height:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHeight:I
|
|
|
|
const v0, 0x1010038
|
|
|
|
invoke-virtual {p0, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->createDefaultColorStateList(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorDefault:Landroid/content/res/ColorStateList;
|
|
|
|
new-instance v0, Landroidx/transition/AutoTransition;
|
|
|
|
invoke-direct {v0}, Landroidx/transition/AutoTransition;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/transition/TransitionSet;->setOrdering(I)Landroidx/transition/TransitionSet;
|
|
|
|
iget-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
const-wide/16 v0, 0x73
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroidx/transition/TransitionSet;->setDuration(J)Landroidx/transition/TransitionSet;
|
|
|
|
iget-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
new-instance v0, Landroidx/interpolator/view/animation/FastOutSlowInInterpolator;
|
|
|
|
invoke-direct {v0}, Landroidx/interpolator/view/animation/FastOutSlowInInterpolator;-><init>()V
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/transition/TransitionSet;->setInterpolator(Landroid/animation/TimeInterpolator;)Landroidx/transition/TransitionSet;
|
|
|
|
iget-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
new-instance v0, Lcom/google/android/material/internal/TextScale;
|
|
|
|
invoke-direct {v0}, Lcom/google/android/material/internal/TextScale;-><init>()V
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/transition/TransitionSet;->addTransition(Landroidx/transition/Transition;)Landroidx/transition/TransitionSet;
|
|
|
|
new-instance p1, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView$1;
|
|
|
|
invoke-direct {p1, p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView$1;-><init>(Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;)V
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->onClickListener:Landroid/view/View$OnClickListener;
|
|
|
|
new-array p1, p2, [I
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000(Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;)Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic access$100(Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;)Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private getNewItem()Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemPool:Landroidx/core/util/Pools$Pool;
|
|
|
|
invoke-interface {v0}, Landroidx/core/util/Pools$Pool;->acquire()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;-><init>(Landroid/content/Context;)V
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private isShifting(II)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, -0x1
|
|
|
|
if-ne p1, v2, :cond_1
|
|
|
|
const/4 p1, 0x3
|
|
|
|
if-le p2, p1, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
return v1
|
|
|
|
:cond_1
|
|
if-nez p1, :cond_2
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
return v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public buildMenuView()V
|
|
.locals 6
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->removeAllViews()V
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
array-length v2, v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v2, :cond_1
|
|
|
|
aget-object v4, v0, v3
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget-object v5, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemPool:Landroidx/core/util/Pools$Pool;
|
|
|
|
invoke-interface {v5, v4}, Landroidx/core/util/Pools$Pool;->release(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
new-array v0, v0, [Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
iget-object v2, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v2}, Landroidx/appcompat/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {p0, v0, v2}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->isShifting(II)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_1
|
|
iget-object v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v3}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
if-ge v2, v3, :cond_4
|
|
|
|
iget-object v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;->setUpdateSuspended(Z)V
|
|
|
|
iget-object v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v3, v2}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3, v4}, Landroid/view/MenuItem;->setCheckable(Z)Landroid/view/MenuItem;
|
|
|
|
iget-object v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
invoke-virtual {v3, v1}, Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;->setUpdateSuspended(Z)V
|
|
|
|
invoke-direct {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getNewItem()Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
move-result-object v3
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
aput-object v3, v4, v2
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconTint:Landroid/content/res/ColorStateList;
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setIconTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
iget v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconSize:I
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setIconSize(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorDefault:Landroid/content/res/ColorStateList;
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
iget v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceInactive:I
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextAppearanceInactive(I)V
|
|
|
|
iget v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceActive:I
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextAppearanceActive(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackground:Landroid/graphics/drawable/Drawable;
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setItemBackground(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
iget v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackgroundRes:I
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setItemBackground(I)V
|
|
|
|
:goto_2
|
|
invoke-virtual {v3, v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setShifting(Z)V
|
|
|
|
iget v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setLabelVisibilityMode(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v4, v2}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Landroidx/appcompat/view/menu/MenuItemImpl;
|
|
|
|
invoke-virtual {v3, v4, v1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->initialize(Landroidx/appcompat/view/menu/MenuItemImpl;I)V
|
|
|
|
invoke-virtual {v3, v2}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setItemPosition(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->onClickListener:Landroid/view/View$OnClickListener;
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
invoke-virtual {p0, v3}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->addView(Landroid/view/View;)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
sub-int/2addr v0, v4
|
|
|
|
iget v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
iget v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0, v4}, Landroid/view/MenuItem;->setChecked(Z)Landroid/view/MenuItem;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public createDefaultColorStateList(I)Landroid/content/res/ColorStateList;
|
|
.locals 9
|
|
|
|
new-instance v0, Landroid/util/TypedValue;
|
|
|
|
invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-virtual {v1, p1, v0, v2}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z
|
|
|
|
move-result p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
iget v3, v0, Landroid/util/TypedValue;->resourceId:I
|
|
|
|
invoke-static {p1, v3}, Landroidx/appcompat/content/res/AppCompatResources;->getColorStateList(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;
|
|
|
|
move-result-object v3
|
|
|
|
sget v4, Landroidx/appcompat/R$attr;->colorPrimary:I
|
|
|
|
invoke-virtual {v3, v4, v0, v2}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_1
|
|
|
|
return-object v1
|
|
|
|
:cond_1
|
|
iget v0, v0, Landroid/util/TypedValue;->data:I
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/ColorStateList;->getDefaultColor()I
|
|
|
|
move-result v1
|
|
|
|
new-instance v3, Landroid/content/res/ColorStateList;
|
|
|
|
const/4 v4, 0x3
|
|
|
|
new-array v5, v4, [[I
|
|
|
|
sget-object v6, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->DISABLED_STATE_SET:[I
|
|
|
|
const/4 v7, 0x0
|
|
|
|
aput-object v6, v5, v7
|
|
|
|
sget-object v6, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->CHECKED_STATE_SET:[I
|
|
|
|
aput-object v6, v5, v2
|
|
|
|
sget-object v6, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->EMPTY_STATE_SET:[I
|
|
|
|
const/4 v8, 0x2
|
|
|
|
aput-object v6, v5, v8
|
|
|
|
new-array v4, v4, [I
|
|
|
|
sget-object v6, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->DISABLED_STATE_SET:[I
|
|
|
|
invoke-virtual {p1, v6, v1}, Landroid/content/res/ColorStateList;->getColorForState([II)I
|
|
|
|
move-result p1
|
|
|
|
aput p1, v4, v7
|
|
|
|
aput v0, v4, v2
|
|
|
|
aput v1, v4, v8
|
|
|
|
invoke-direct {v3, v5, v4}, Landroid/content/res/ColorStateList;-><init>([[I[I)V
|
|
|
|
return-object v3
|
|
.end method
|
|
|
|
.method public getIconTintList()Landroid/content/res/ColorStateList;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconTint:Landroid/content/res/ColorStateList;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getItemBackground()Landroid/graphics/drawable/Drawable;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aget-object v0, v0, v1
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->getBackground()Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackground:Landroid/graphics/drawable/Drawable;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getItemBackgroundRes()I
|
|
.locals 1
|
|
.annotation runtime Ljava/lang/Deprecated;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackgroundRes:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemIconSize()I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/Dimension;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconSize:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemTextAppearanceActive()I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceActive:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemTextAppearanceInactive()I
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceInactive:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemTextColor()Landroid/content/res/ColorStateList;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getLabelVisibilityMode()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getSelectedItemId()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getWindowAnimations()I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public initialize(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public isItemHorizontalTranslationEnabled()Z
|
|
.locals 1
|
|
|
|
iget-boolean v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHorizontalTranslationEnabled:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method protected onLayout(ZIIII)V
|
|
.locals 4
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildCount()I
|
|
|
|
move-result p1
|
|
|
|
sub-int/2addr p4, p2
|
|
|
|
sub-int/2addr p5, p3
|
|
|
|
const/4 p2, 0x0
|
|
|
|
const/4 p3, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-ge p3, p1, :cond_2
|
|
|
|
invoke-virtual {p0, p3}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v2
|
|
|
|
const/16 v3, 0x8
|
|
|
|
if-eq v2, v3, :cond_1
|
|
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getLayoutDirection(Landroid/view/View;)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-ne v2, v3, :cond_0
|
|
|
|
sub-int v2, p4, v0
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v3
|
|
|
|
sub-int v3, v2, v3
|
|
|
|
invoke-virtual {v1, v3, p2, v2, p5}, Landroid/view/View;->layout(IIII)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v2, v0
|
|
|
|
invoke-virtual {v1, v0, p2, v2, p5}, Landroid/view/View;->layout(IIII)V
|
|
|
|
:goto_1
|
|
invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
:cond_1
|
|
add-int/lit8 p3, p3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onMeasure(II)V
|
|
.locals 10
|
|
|
|
invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I
|
|
|
|
move-result p1
|
|
|
|
iget-object p2, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {p2}, Landroidx/appcompat/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildCount()I
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHeight:I
|
|
|
|
const/high16 v2, 0x40000000 # 2.0f
|
|
|
|
invoke-static {v1, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
|
|
|
move-result v1
|
|
|
|
iget v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
invoke-direct {p0, v3, p2}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->isShifting(II)Z
|
|
|
|
move-result v3
|
|
|
|
const/16 v4, 0x8
|
|
|
|
const/4 v5, 0x1
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-eqz v3, :cond_6
|
|
|
|
iget-boolean v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHorizontalTranslationEnabled:Z
|
|
|
|
if-eqz v3, :cond_6
|
|
|
|
iget v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
invoke-virtual {p0, v3}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v3
|
|
|
|
iget v7, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMinWidth:I
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v8
|
|
|
|
if-eq v8, v4, :cond_0
|
|
|
|
iget v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMaxWidth:I
|
|
|
|
const/high16 v9, -0x80000000
|
|
|
|
invoke-static {v8, v9}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
|
|
|
move-result v8
|
|
|
|
invoke-virtual {v3, v8, v1}, Landroid/view/View;->measure(II)V
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v8
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v7
|
|
|
|
:cond_0
|
|
invoke-virtual {v3}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v3
|
|
|
|
if-eq v3, v4, :cond_1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
sub-int/2addr p2, v3
|
|
|
|
iget v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->inactiveItemMinWidth:I
|
|
|
|
mul-int v3, v3, p2
|
|
|
|
sub-int v3, p1, v3
|
|
|
|
iget v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMaxWidth:I
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v7
|
|
|
|
invoke-static {v3, v7}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v3
|
|
|
|
sub-int/2addr p1, v3
|
|
|
|
if-nez p2, :cond_2
|
|
|
|
const/4 v7, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move v7, p2
|
|
|
|
:goto_1
|
|
div-int v7, p1, v7
|
|
|
|
iget v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->inactiveItemMaxWidth:I
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v7
|
|
|
|
mul-int p2, p2, v7
|
|
|
|
sub-int/2addr p1, p2
|
|
|
|
move p2, p1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:goto_2
|
|
if-ge p1, v0, :cond_a
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-virtual {v8}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v8
|
|
|
|
if-eq v8, v4, :cond_4
|
|
|
|
iget-object v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
iget v9, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
if-ne p1, v9, :cond_3
|
|
|
|
move v9, v3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
move v9, v7
|
|
|
|
:goto_3
|
|
aput v9, v8, p1
|
|
|
|
if-lez p2, :cond_5
|
|
|
|
iget-object v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
aget v9, v8, p1
|
|
|
|
add-int/2addr v9, v5
|
|
|
|
aput v9, v8, p1
|
|
|
|
add-int/lit8 p2, p2, -0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
iget-object v8, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
aput v6, v8, p1
|
|
|
|
:cond_5
|
|
:goto_4
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
if-nez p2, :cond_7
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_5
|
|
|
|
:cond_7
|
|
move v3, p2
|
|
|
|
:goto_5
|
|
div-int v3, p1, v3
|
|
|
|
iget v7, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->activeItemMaxWidth:I
|
|
|
|
invoke-static {v3, v7}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v3
|
|
|
|
mul-int p2, p2, v3
|
|
|
|
sub-int/2addr p1, p2
|
|
|
|
move p2, p1
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:goto_6
|
|
if-ge p1, v0, :cond_a
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {v7}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v7
|
|
|
|
if-eq v7, v4, :cond_8
|
|
|
|
iget-object v7, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
aput v3, v7, p1
|
|
|
|
if-lez p2, :cond_9
|
|
|
|
aget v8, v7, p1
|
|
|
|
add-int/2addr v8, v5
|
|
|
|
aput v8, v7, p1
|
|
|
|
add-int/lit8 p2, p2, -0x1
|
|
|
|
goto :goto_7
|
|
|
|
:cond_8
|
|
iget-object v7, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
aput v6, v7, p1
|
|
|
|
:cond_9
|
|
:goto_7
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_a
|
|
const/4 p1, 0x0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:goto_8
|
|
if-ge p1, v0, :cond_c
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getVisibility()I
|
|
|
|
move-result v5
|
|
|
|
if-eq v5, v4, :cond_b
|
|
|
|
iget-object v5, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->tempChildWidths:[I
|
|
|
|
aget v5, v5, p1
|
|
|
|
invoke-static {v5, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual {v3, v5, v1}, Landroid/view/View;->measure(II)V
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v7
|
|
|
|
iput v7, v5, Landroid/view/ViewGroup$LayoutParams;->width:I
|
|
|
|
invoke-virtual {v3}, Landroid/view/View;->getMeasuredWidth()I
|
|
|
|
move-result v3
|
|
|
|
add-int/2addr p2, v3
|
|
|
|
:cond_b
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_8
|
|
|
|
:cond_c
|
|
invoke-static {p2, v2}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p2, p1, v6}, Landroid/view/View;->resolveSizeAndState(III)I
|
|
|
|
move-result p1
|
|
|
|
iget p2, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHeight:I
|
|
|
|
invoke-static {p2, v1, v6}, Landroid/view/View;->resolveSizeAndState(III)I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->setMeasuredDimension(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setIconTintList(Landroid/content/res/ColorStateList;)V
|
|
.locals 4
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconTint:Landroid/content/res/ColorStateList;
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setIconTintList(Landroid/content/res/ColorStateList;)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemBackground(Landroid/graphics/drawable/Drawable;)V
|
|
.locals 4
|
|
.param p1 # Landroid/graphics/drawable/Drawable;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackground:Landroid/graphics/drawable/Drawable;
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setItemBackground(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemBackgroundRes(I)V
|
|
.locals 4
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemBackgroundRes:I
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setItemBackground(I)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemHorizontalTranslationEnabled(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemHorizontalTranslationEnabled:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemIconSize(I)V
|
|
.locals 4
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/Dimension;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemIconSize:I
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setIconSize(I)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemTextAppearanceActive(I)V
|
|
.locals 5
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceActive:I
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextAppearanceActive(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemTextAppearanceInactive(I)V
|
|
.locals 5
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextAppearanceInactive:I
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextAppearanceInactive(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemTextColor(Landroid/content/res/ColorStateList;)V
|
|
.locals 4
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->itemTextColorFromUser:Landroid/content/res/ColorStateList;
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
aget-object v3, v0, v2
|
|
|
|
invoke-virtual {v3, p1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setTextColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setLabelVisibilityMode(I)V
|
|
.locals 0
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setPresenter(Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method tryRestoreSelectedItemId(I)V
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, v0, :cond_1
|
|
|
|
iget-object v2, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v2, v1}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Landroid/view/MenuItem;->getItemId()I
|
|
|
|
move-result v3
|
|
|
|
if-ne p1, v3, :cond_0
|
|
|
|
iput p1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
iput v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-interface {v2, p1}, Landroid/view/MenuItem;->setChecked(Z)Landroid/view/MenuItem;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public updateMenuView()V
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
array-length v1, v1
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
invoke-virtual {p0}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buildMenuView()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
iget v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v0, :cond_3
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v4, v3}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v4}, Landroid/view/MenuItem;->isChecked()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
invoke-interface {v4}, Landroid/view/MenuItem;->getItemId()I
|
|
|
|
move-result v4
|
|
|
|
iput v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
iput v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemPosition:I
|
|
|
|
:cond_2
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->selectedItemId:I
|
|
|
|
if-eq v1, v3, :cond_4
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->set:Landroidx/transition/TransitionSet;
|
|
|
|
invoke-static {p0, v1}, Landroidx/transition/TransitionManager;->beginDelayedTransition(Landroid/view/ViewGroup;Landroidx/transition/Transition;)V
|
|
|
|
:cond_4
|
|
iget v1, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
iget-object v3, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v3}, Landroidx/appcompat/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v3
|
|
|
|
invoke-direct {p0, v1, v3}, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->isShifting(II)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-ge v3, v0, :cond_5
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
const/4 v5, 0x1
|
|
|
|
invoke-virtual {v4, v5}, Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;->setUpdateSuspended(Z)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
aget-object v4, v4, v3
|
|
|
|
iget v5, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->labelVisibilityMode:I
|
|
|
|
invoke-virtual {v4, v5}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setLabelVisibilityMode(I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
aget-object v4, v4, v3
|
|
|
|
invoke-virtual {v4, v1}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->setShifting(Z)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->buttons:[Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;
|
|
|
|
aget-object v4, v4, v3
|
|
|
|
iget-object v5, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v5, v3}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Landroidx/appcompat/view/menu/MenuItemImpl;
|
|
|
|
invoke-virtual {v4, v5, v2}, Lcom/google/android/material/bottomnavigation/BottomNavigationItemView;->initialize(Landroidx/appcompat/view/menu/MenuItemImpl;I)V
|
|
|
|
iget-object v4, p0, Lcom/google/android/material/bottomnavigation/BottomNavigationMenuView;->presenter:Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;
|
|
|
|
invoke-virtual {v4, v2}, Lcom/google/android/material/bottomnavigation/BottomNavigationPresenter;->setUpdateSuspended(Z)V
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
return-void
|
|
|
|
:cond_6
|
|
:goto_2
|
|
return-void
|
|
.end method
|