151 lines
4.4 KiB
Smali
151 lines
4.4 KiB
Smali
.class public final Landroidx/viewpager2/widget/PageTransformerAdapter;
|
|
.super Landroidx/viewpager2/widget/ViewPager2$OnPageChangeCallback;
|
|
.source "PageTransformerAdapter.java"
|
|
|
|
|
|
# instance fields
|
|
.field public final mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
.field public mPageTransformer:Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroidx/recyclerview/widget/LinearLayoutManager;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroidx/viewpager2/widget/ViewPager2$OnPageChangeCallback;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getPageTransformer()Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mPageTransformer:Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onPageScrollStateChanged(I)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onPageScrolled(IFI)V
|
|
.locals 4
|
|
|
|
iget-object p3, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mPageTransformer:Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
neg-float p2, p2
|
|
|
|
const/4 p3, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
invoke-virtual {v1}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getChildCount()I
|
|
|
|
move-result v1
|
|
|
|
if-ge v0, v1, :cond_2
|
|
|
|
iget-object v1, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
iget-object v2, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
invoke-virtual {v2, v1}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getPosition(Landroid/view/View;)I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v2, p1
|
|
|
|
int-to-float v2, v2
|
|
|
|
add-float/2addr v2, p2
|
|
|
|
iget-object v3, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mPageTransformer:Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
|
|
invoke-interface {v3, v1, v2}, Landroidx/viewpager2/widget/ViewPager2$PageTransformer;->transformPage(Landroid/view/View;F)V
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
sget-object p2, Ljava/util/Locale;->US:Ljava/util/Locale;
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v1, p3
|
|
|
|
iget-object p3, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;
|
|
|
|
invoke-virtual {p3}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getChildCount()I
|
|
|
|
move-result p3
|
|
|
|
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
aput-object p3, v1, v0
|
|
|
|
const-string p3, "LayoutManager returned a null child at pos %d/%d while transforming pages"
|
|
|
|
invoke-static {p2, p3, v1}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public onPageSelected(I)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setPageTransformer(Landroidx/viewpager2/widget/ViewPager2$PageTransformer;)V
|
|
.locals 0
|
|
.param p1 # Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput-object p1, p0, Landroidx/viewpager2/widget/PageTransformerAdapter;->mPageTransformer:Landroidx/viewpager2/widget/ViewPager2$PageTransformer;
|
|
|
|
return-void
|
|
.end method
|