467 lines
12 KiB
Smali
467 lines
12 KiB
Smali
.class public Lcom/google/android/material/internal/ViewUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "ViewUtils.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/google/android/material/internal/ViewUtils$RelativePadding;,
|
|
Lcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 55
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static addOnGlobalLayoutListener(Landroid/view/View;Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 323
|
|
invoke-virtual {p0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static doOnApplyWindowInsets(Landroid/view/View;Landroid/util/AttributeSet;II)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 150
|
|
invoke-static {p0, p1, p2, p3, v0}, Lcom/google/android/material/internal/ViewUtils;->doOnApplyWindowInsets(Landroid/view/View;Landroid/util/AttributeSet;IILcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static doOnApplyWindowInsets(Landroid/view/View;Landroid/util/AttributeSet;IILcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;)V
|
|
.locals 2
|
|
|
|
.line 164
|
|
invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/google/android/material/R$styleable;->Insets:[I
|
|
|
|
.line 165
|
|
invoke-virtual {v0, p1, v1, p2, p3}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object p1
|
|
|
|
.line 167
|
|
sget p2, Lcom/google/android/material/R$styleable;->Insets_paddingBottomSystemWindowInsets:I
|
|
|
|
const/4 p3, 0x0
|
|
|
|
.line 168
|
|
invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
|
|
|
|
move-result p2
|
|
|
|
.line 169
|
|
sget v0, Lcom/google/android/material/R$styleable;->Insets_paddingLeftSystemWindowInsets:I
|
|
|
|
.line 170
|
|
invoke-virtual {p1, v0, p3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
|
|
|
|
move-result v0
|
|
|
|
.line 171
|
|
sget v1, Lcom/google/android/material/R$styleable;->Insets_paddingRightSystemWindowInsets:I
|
|
|
|
.line 172
|
|
invoke-virtual {p1, v1, p3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
|
|
|
|
move-result p3
|
|
|
|
.line 174
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
.line 176
|
|
new-instance p1, Lcom/google/android/material/internal/ViewUtils$2;
|
|
|
|
invoke-direct {p1, p2, v0, p3, p4}, Lcom/google/android/material/internal/ViewUtils$2;-><init>(ZZZLcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;)V
|
|
|
|
invoke-static {p0, p1}, Lcom/google/android/material/internal/ViewUtils;->doOnApplyWindowInsets(Landroid/view/View;Lcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static doOnApplyWindowInsets(Landroid/view/View;Lcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;)V
|
|
.locals 5
|
|
|
|
.line 218
|
|
new-instance v0, Lcom/google/android/material/internal/ViewUtils$RelativePadding;
|
|
|
|
.line 220
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getPaddingStart(Landroid/view/View;)I
|
|
|
|
move-result v1
|
|
|
|
.line 221
|
|
invoke-virtual {p0}, Landroid/view/View;->getPaddingTop()I
|
|
|
|
move-result v2
|
|
|
|
.line 222
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getPaddingEnd(Landroid/view/View;)I
|
|
|
|
move-result v3
|
|
|
|
.line 223
|
|
invoke-virtual {p0}, Landroid/view/View;->getPaddingBottom()I
|
|
|
|
move-result v4
|
|
|
|
invoke-direct {v0, v1, v2, v3, v4}, Lcom/google/android/material/internal/ViewUtils$RelativePadding;-><init>(IIII)V
|
|
|
|
.line 226
|
|
new-instance v1, Lcom/google/android/material/internal/ViewUtils$3;
|
|
|
|
invoke-direct {v1, p1, v0}, Lcom/google/android/material/internal/ViewUtils$3;-><init>(Lcom/google/android/material/internal/ViewUtils$OnApplyWindowInsetsListener;Lcom/google/android/material/internal/ViewUtils$RelativePadding;)V
|
|
|
|
invoke-static {p0, v1}, Landroidx/core/view/ViewCompat;->setOnApplyWindowInsetsListener(Landroid/view/View;Landroidx/core/view/OnApplyWindowInsetsListener;)V
|
|
|
|
.line 235
|
|
invoke-static {p0}, Lcom/google/android/material/internal/ViewUtils;->requestApplyInsetsWhenAttached(Landroid/view/View;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static dpToPx(Landroid/content/Context;I)F
|
|
.locals 1
|
|
|
|
.line 81
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
int-to-float p1, p1
|
|
|
|
.line 82
|
|
invoke-virtual {p0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {v0, p1, p0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static getContentView(Landroid/view/View;)Landroid/view/ViewGroup;
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 295
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/view/View;->getRootView()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
const v2, 0x1020002
|
|
|
|
.line 296
|
|
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/view/ViewGroup;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
return-object v2
|
|
|
|
:cond_1
|
|
if-eq v1, p0, :cond_2
|
|
|
|
.line 305
|
|
instance-of p0, v1, Landroid/view/ViewGroup;
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 306
|
|
check-cast v1, Landroid/view/ViewGroup;
|
|
|
|
return-object v1
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getContentViewOverlay(Landroid/view/View;)Lcom/google/android/material/internal/ViewOverlayImpl;
|
|
.locals 0
|
|
|
|
.line 317
|
|
invoke-static {p0}, Lcom/google/android/material/internal/ViewUtils;->getContentView(Landroid/view/View;)Landroid/view/ViewGroup;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/android/material/internal/ViewUtils;->getOverlay(Landroid/view/View;)Lcom/google/android/material/internal/ViewOverlayImpl;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getOverlay(Landroid/view/View;)Lcom/google/android/material/internal/ViewOverlayImpl;
|
|
.locals 2
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
.line 282
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x12
|
|
|
|
if-lt v0, v1, :cond_1
|
|
|
|
.line 283
|
|
new-instance v0, Lcom/google/android/material/internal/ViewOverlayApi18;
|
|
|
|
invoke-direct {v0, p0}, Lcom/google/android/material/internal/ViewOverlayApi18;-><init>(Landroid/view/View;)V
|
|
|
|
return-object v0
|
|
|
|
.line 285
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/google/android/material/internal/ViewOverlayApi14;->createFrom(Landroid/view/View;)Lcom/google/android/material/internal/ViewOverlayApi14;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getParentAbsoluteElevation(Landroid/view/View;)F
|
|
.locals 2
|
|
|
|
.line 265
|
|
invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 266
|
|
:goto_0
|
|
instance-of v1, p0, Landroid/view/View;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 267
|
|
move-object v1, p0
|
|
|
|
check-cast v1, Landroid/view/View;
|
|
|
|
invoke-static {v1}, Landroidx/core/view/ViewCompat;->getElevation(Landroid/view/View;)F
|
|
|
|
move-result v1
|
|
|
|
add-float/2addr v0, v1
|
|
|
|
.line 268
|
|
invoke-interface {p0}, Landroid/view/ViewParent;->getParent()Landroid/view/ViewParent;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isLayoutRtl(Landroid/view/View;)Z
|
|
.locals 1
|
|
|
|
.line 77
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->getLayoutDirection(Landroid/view/View;)I
|
|
|
|
move-result p0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-ne p0, v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static parseTintMode(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x3
|
|
|
|
if-eq p0, v0, :cond_2
|
|
|
|
const/4 v0, 0x5
|
|
|
|
if-eq p0, v0, :cond_1
|
|
|
|
const/16 v0, 0x9
|
|
|
|
if-eq p0, v0, :cond_0
|
|
|
|
packed-switch p0, :pswitch_data_0
|
|
|
|
return-object p1
|
|
|
|
.line 70
|
|
:pswitch_0
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->ADD:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 68
|
|
:pswitch_1
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->SCREEN:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 66
|
|
:pswitch_2
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 64
|
|
:cond_0
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->SRC_ATOP:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 62
|
|
:cond_1
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
.line 60
|
|
:cond_2
|
|
sget-object p0, Landroid/graphics/PorterDuff$Mode;->SRC_OVER:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
return-object p0
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0xe
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method public static removeOnGlobalLayoutListener(Landroid/view/View;Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 330
|
|
invoke-virtual {p0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0, p1}, Lcom/google/android/material/internal/ViewUtils;->removeOnGlobalLayoutListener(Landroid/view/ViewTreeObserver;Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static removeOnGlobalLayoutListener(Landroid/view/ViewTreeObserver;Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
.locals 2
|
|
|
|
.line 336
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x10
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
.line 337
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewTreeObserver;->removeOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 339
|
|
:cond_0
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewTreeObserver;->removeGlobalOnLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static requestApplyInsetsWhenAttached(Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
.line 240
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->isAttachedToWindow(Landroid/view/View;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 242
|
|
invoke-static {p0}, Landroidx/core/view/ViewCompat;->requestApplyInsets(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 245
|
|
:cond_0
|
|
new-instance v0, Lcom/google/android/material/internal/ViewUtils$4;
|
|
|
|
invoke-direct {v0}, Lcom/google/android/material/internal/ViewUtils$4;-><init>()V
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->addOnAttachStateChangeListener(Landroid/view/View$OnAttachStateChangeListener;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static requestFocusAndShowKeyboard(Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
.line 86
|
|
invoke-virtual {p0}, Landroid/view/View;->requestFocus()Z
|
|
|
|
.line 87
|
|
new-instance v0, Lcom/google/android/material/internal/ViewUtils$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/google/android/material/internal/ViewUtils$1;-><init>(Landroid/view/View;)V
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->post(Ljava/lang/Runnable;)Z
|
|
|
|
return-void
|
|
.end method
|