303 lines
8.5 KiB
Smali
303 lines
8.5 KiB
Smali
.class public Lcom/google/android/material/appbar/MaterialToolbar;
|
|
.super Landroidx/appcompat/widget/Toolbar;
|
|
.source "MaterialToolbar.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final DEF_STYLE_RES:I
|
|
|
|
|
|
# instance fields
|
|
.field private navigationIconTint:Ljava/lang/Integer;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
sget v0, Lcom/google/android/material/R$style;->Widget_MaterialComponents_Toolbar:I
|
|
|
|
sput v0, Lcom/google/android/material/appbar/MaterialToolbar;->DEF_STYLE_RES:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1, v0}, Lcom/google/android/material/appbar/MaterialToolbar;-><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
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/util/AttributeSet;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 2
|
|
sget v0, Lcom/google/android/material/R$attr;->toolbarStyle:I
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/google/android/material/appbar/MaterialToolbar;-><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 6
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/util/AttributeSet;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 3
|
|
sget v4, Lcom/google/android/material/appbar/MaterialToolbar;->DEF_STYLE_RES:I
|
|
|
|
invoke-static {p1, p2, p3, v4}, Lcom/google/android/material/theme/overlay/MaterialThemeOverlay;->wrap(Landroid/content/Context;Landroid/util/AttributeSet;II)Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/appcompat/widget/Toolbar;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
.line 4
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
.line 5
|
|
sget-object v2, Lcom/google/android/material/R$styleable;->MaterialToolbar:[I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v5, v0, [I
|
|
|
|
move-object v0, p1
|
|
|
|
move-object v1, p2
|
|
|
|
move v3, p3
|
|
|
|
.line 6
|
|
invoke-static/range {v0 .. v5}, Lcom/google/android/material/internal/ThemeEnforcement;->obtainStyledAttributes(Landroid/content/Context;Landroid/util/AttributeSet;[III[I)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object p2
|
|
|
|
.line 7
|
|
sget p3, Lcom/google/android/material/R$styleable;->MaterialToolbar_navigationIconTint:I
|
|
|
|
invoke-virtual {p2, p3}, Landroid/content/res/TypedArray;->hasValue(I)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, -0x1
|
|
|
|
.line 8
|
|
invoke-virtual {p2, p3, v0}, Landroid/content/res/TypedArray;->getColor(II)I
|
|
|
|
move-result p3
|
|
|
|
invoke-virtual {p0, p3}, Lcom/google/android/material/appbar/MaterialToolbar;->setNavigationIconTint(I)V
|
|
|
|
.line 9
|
|
:cond_0
|
|
invoke-virtual {p2}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
.line 10
|
|
invoke-direct {p0, p1}, Lcom/google/android/material/appbar/MaterialToolbar;->initBackground(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private initBackground(Landroid/content/Context;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getBackground()Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
instance-of v1, v0, Landroid/graphics/drawable/ColorDrawable;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance v1, Lcom/google/android/material/shape/MaterialShapeDrawable;
|
|
|
|
invoke-direct {v1}, Lcom/google/android/material/shape/MaterialShapeDrawable;-><init>()V
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 4
|
|
check-cast v0, Landroid/graphics/drawable/ColorDrawable;
|
|
|
|
.line 5
|
|
invoke-virtual {v0}, Landroid/graphics/drawable/ColorDrawable;->getColor()I
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
.line 6
|
|
:goto_0
|
|
invoke-static {v0}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Lcom/google/android/material/shape/MaterialShapeDrawable;->setFillColor(Landroid/content/res/ColorStateList;)V
|
|
|
|
.line 7
|
|
invoke-virtual {v1, p1}, Lcom/google/android/material/shape/MaterialShapeDrawable;->initializeElevationOverlay(Landroid/content/Context;)V
|
|
|
|
.line 8
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->R(Landroid/view/View;)F
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v1, p1}, Lcom/google/android/material/shape/MaterialShapeDrawable;->setElevation(F)V
|
|
|
|
.line 9
|
|
invoke-static {p0, v1}, Landroidx/core/view/ViewCompat;->I1(Landroid/view/View;Landroid/graphics/drawable/Drawable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private maybeTintNavigationIcon(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
|
|
.locals 1
|
|
.param p1 # Landroid/graphics/drawable/Drawable;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/appbar/MaterialToolbar;->navigationIconTint:Ljava/lang/Integer;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-static {p1}, Ld1/c;->r(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lcom/google/android/material/appbar/MaterialToolbar;->navigationIconTint:Ljava/lang/Integer;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p1, v0}, Ld1/c;->n(Landroid/graphics/drawable/Drawable;I)V
|
|
|
|
:cond_0
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onAttachedToWindow()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-super {p0}, Landroid/view/ViewGroup;->onAttachedToWindow()V
|
|
|
|
.line 2
|
|
invoke-static {p0}, Lcom/google/android/material/shape/MaterialShapeUtils;->setParentAbsoluteElevation(Landroid/view/View;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setElevation(F)V
|
|
.locals 0
|
|
.annotation build Landroidx/annotation/RequiresApi;
|
|
value = 0x15
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-super {p0, p1}, Landroid/view/ViewGroup;->setElevation(F)V
|
|
|
|
.line 2
|
|
invoke-static {p0, p1}, Lcom/google/android/material/shape/MaterialShapeUtils;->setElevation(Landroid/view/View;F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setNavigationIcon(Landroid/graphics/drawable/Drawable;)V
|
|
.locals 0
|
|
.param p1 # Landroid/graphics/drawable/Drawable;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1}, Lcom/google/android/material/appbar/MaterialToolbar;->maybeTintNavigationIcon(Landroid/graphics/drawable/Drawable;)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-super {p0, p1}, Landroidx/appcompat/widget/Toolbar;->setNavigationIcon(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setNavigationIconTint(I)V
|
|
.locals 0
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/google/android/material/appbar/MaterialToolbar;->navigationIconTint:Ljava/lang/Integer;
|
|
|
|
.line 2
|
|
invoke-virtual {p0}, Landroidx/appcompat/widget/Toolbar;->getNavigationIcon()Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 3
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/appbar/MaterialToolbar;->setNavigationIcon(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|