Rabbit-R1/original r1/smali/smali_classes2/androidx/viewpager2/widget/WindowInsetsApplier.smali
2024-05-21 17:08:36 -04:00

143 lines
3.9 KiB
Smali

.class public final Landroidx/viewpager2/widget/WindowInsetsApplier;
.super Ljava/lang/Object;
.source "WindowInsetsApplier.java"
# interfaces
.implements Landroidx/core/view/OnApplyWindowInsetsListener;
# direct methods
.method private constructor <init>()V
.locals 0
.line 47
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private consumeAllInsets(Landroidx/core/view/WindowInsetsCompat;)Landroidx/core/view/WindowInsetsCompat;
.locals 0
.line 117
sget-object p0, Landroidx/core/view/WindowInsetsCompat;->CONSUMED:Landroidx/core/view/WindowInsetsCompat;
invoke-virtual {p0}, Landroidx/core/view/WindowInsetsCompat;->toWindowInsets()Landroid/view/WindowInsets;
move-result-object p0
if-eqz p0, :cond_0
.line 118
sget-object p0, Landroidx/core/view/WindowInsetsCompat;->CONSUMED:Landroidx/core/view/WindowInsetsCompat;
return-object p0
.line 125
:cond_0
invoke-virtual {p1}, Landroidx/core/view/WindowInsetsCompat;->consumeSystemWindowInsets()Landroidx/core/view/WindowInsetsCompat;
move-result-object p0
invoke-virtual {p0}, Landroidx/core/view/WindowInsetsCompat;->consumeStableInsets()Landroidx/core/view/WindowInsetsCompat;
move-result-object p0
return-object p0
.end method
.method public static install(Landroidx/viewpager2/widget/ViewPager2;)Z
.locals 2
.line 68
invoke-virtual {p0}, Landroidx/viewpager2/widget/ViewPager2;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v0
.line 69
iget v0, v0, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I
const/16 v1, 0x1e
if-lt v0, v1, :cond_0
const/4 p0, 0x0
return p0
.line 74
:cond_0
new-instance v0, Landroidx/viewpager2/widget/WindowInsetsApplier;
invoke-direct {v0}, Landroidx/viewpager2/widget/WindowInsetsApplier;-><init>()V
invoke-static {p0, v0}, Landroidx/core/view/ViewCompat;->setOnApplyWindowInsetsListener(Landroid/view/View;Landroidx/core/view/OnApplyWindowInsetsListener;)V
const/4 p0, 0x1
return p0
.end method
# virtual methods
.method public onApplyWindowInsets(Landroid/view/View;Landroidx/core/view/WindowInsetsCompat;)Landroidx/core/view/WindowInsetsCompat;
.locals 4
.line 82
check-cast p1, Landroidx/viewpager2/widget/ViewPager2;
.line 85
invoke-static {p1, p2}, Landroidx/core/view/ViewCompat;->onApplyWindowInsets(Landroid/view/View;Landroidx/core/view/WindowInsetsCompat;)Landroidx/core/view/WindowInsetsCompat;
move-result-object p2
.line 87
invoke-virtual {p2}, Landroidx/core/view/WindowInsetsCompat;->isConsumed()Z
move-result v0
if-eqz v0, :cond_0
return-object p2
.line 99
:cond_0
iget-object p1, p1, Landroidx/viewpager2/widget/ViewPager2;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView;
.line 100
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->getChildCount()I
move-result v0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_1
.line 102
invoke-virtual {p1, v1}, Landroidx/recyclerview/widget/RecyclerView;->getChildAt(I)Landroid/view/View;
move-result-object v2
new-instance v3, Landroidx/core/view/WindowInsetsCompat;
invoke-direct {v3, p2}, Landroidx/core/view/WindowInsetsCompat;-><init>(Landroidx/core/view/WindowInsetsCompat;)V
invoke-static {v2, v3}, Landroidx/core/view/ViewCompat;->dispatchApplyWindowInsets(Landroid/view/View;Landroidx/core/view/WindowInsetsCompat;)Landroidx/core/view/WindowInsetsCompat;
add-int/lit8 v1, v1, 0x1
goto :goto_0
.line 111
:cond_1
invoke-direct {p0, p2}, Landroidx/viewpager2/widget/WindowInsetsApplier;->consumeAllInsets(Landroidx/core/view/WindowInsetsCompat;)Landroidx/core/view/WindowInsetsCompat;
move-result-object p0
return-object p0
.end method