233 lines
5.3 KiB
Smali
Raw Normal View History

2026-07-06 19:54:44 +08:00
.class public Landroidx/appcompat/widget/ViewUtils;
.super Ljava/lang/Object;
.source "ViewUtils.java"
# static fields
.field private static final TAG:Ljava/lang/String; = "ViewUtils"
.field private static sComputeFitSystemWindowsMethod:Ljava/lang/reflect/Method;
# direct methods
.method static constructor <clinit>()V
.locals 5
.line 42
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x12
if-lt v0, v1, :cond_0
.line 44
:try_start_0
const-class v0, Landroid/view/View;
const-string v1, "computeFitSystemWindows"
const/4 v2, 0x2
new-array v2, v2, [Ljava/lang/Class;
const/4 v3, 0x0
const-class v4, Landroid/graphics/Rect;
aput-object v4, v2, v3
const-class v3, Landroid/graphics/Rect;
const/4 v4, 0x1
aput-object v3, v2, v4
invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v0
sput-object v0, Landroidx/appcompat/widget/ViewUtils;->sComputeFitSystemWindowsMethod:Ljava/lang/reflect/Method;
.line 46
invoke-virtual {v0}, Ljava/lang/reflect/Method;->isAccessible()Z
move-result v0
if-nez v0, :cond_0
.line 47
sget-object v0, Landroidx/appcompat/widget/ViewUtils;->sComputeFitSystemWindowsMethod:Ljava/lang/reflect/Method;
invoke-virtual {v0, v4}, Ljava/lang/reflect/Method;->setAccessible(Z)V
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
const-string v0, "ViewUtils"
const-string v1, "Could not find method computeFitSystemWindows. Oh well."
.line 50
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
:goto_0
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 55
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static computeFitSystemWindows(Landroid/view/View;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
.locals 3
.line 66
sget-object v0, Landroidx/appcompat/widget/ViewUtils;->sComputeFitSystemWindowsMethod:Ljava/lang/reflect/Method;
if-eqz v0, :cond_0
const/4 v1, 0x2
:try_start_0
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
aput-object p1, v1, v2
const/4 p1, 0x1
aput-object p2, v1, p1
.line 68
invoke-virtual {v0, p0, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p0
const-string p1, "ViewUtils"
const-string p2, "Could not invoke computeFitSystemWindows"
.line 70
invoke-static {p1, p2, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:cond_0
:goto_0
return-void
.end method
.method public static isLayoutRtl(Landroid/view/View;)Z
.locals 1
.line 58
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 makeOptionalFitsSystemWindows(Landroid/view/View;)V
.locals 6
const-string v0, "Could not invoke makeOptionalFitsSystemWindows"
const-string v1, "ViewUtils"
.line 80
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x10
if-lt v2, v3, :cond_1
.line 84
:try_start_0
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v2
const-string v3, "makeOptionalFitsSystemWindows"
const/4 v4, 0x0
new-array v5, v4, [Ljava/lang/Class;
invoke-virtual {v2, v3, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v2
.line 85
invoke-virtual {v2}, Ljava/lang/reflect/Method;->isAccessible()Z
move-result v3
if-nez v3, :cond_0
const/4 v3, 0x1
.line 86
invoke-virtual {v2, v3}, Ljava/lang/reflect/Method;->setAccessible(Z)V
:cond_0
new-array v3, v4, [Ljava/lang/Object;
.line 88
invoke-virtual {v2, p0, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p0
.line 94
invoke-static {v1, v0, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_0
:catch_1
move-exception p0
.line 92
invoke-static {v1, v0, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_0
:catch_2
const-string p0, "Could not find method makeOptionalFitsSystemWindows. Oh well..."
.line 90
invoke-static {v1, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_1
:goto_0
return-void
.end method