2020-05-17 12:40:10 +00:00
|
|
|
.class public Landroidx/transition/GhostViewHolder;
|
|
|
|
.super Landroid/widget/FrameLayout;
|
|
|
|
.source "GhostViewHolder.java"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation build Landroid/annotation/SuppressLint;
|
|
|
|
value = {
|
|
|
|
"ViewConstructor"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public mAttached:Z
|
|
|
|
|
|
|
|
.field public mParent:Landroid/view/ViewGroup;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/view/ViewGroup;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/widget/FrameLayout;->setClipChildren(Z)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
sget v0, Landroidx/transition/R$id;->ghost_view_holder:I
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0, p0}, Landroid/view/ViewGroup;->setTag(ILjava/lang/Object;)V
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/transition/ViewGroupUtils;->getOverlay(Landroid/view/ViewGroup;)Landroidx/transition/ViewGroupOverlayImpl;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1, p0}, Landroidx/transition/ViewGroupOverlayImpl;->add(Landroid/view/View;)V
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
iput-boolean p1, p0, Landroidx/transition/GhostViewHolder;->mAttached:Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static getHolder(Landroid/view/ViewGroup;)Landroidx/transition/GhostViewHolder;
|
|
|
|
.locals 1
|
|
|
|
.param p0 # Landroid/view/ViewGroup;
|
|
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
|
|
.end annotation
|
|
|
|
.end param
|
|
|
|
|
|
|
|
sget v0, Landroidx/transition/R$id;->ghost_view_holder:I
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/ViewGroup;->getTag(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
check-cast p0, Landroidx/transition/GhostViewHolder;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private getInsertIndex(Ljava/util/ArrayList;)I
|
|
|
|
.locals 5
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Ljava/util/ArrayList<",
|
|
|
|
"Landroid/view/View;",
|
|
|
|
">;)I"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getChildCount()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
add-int/lit8 v1, v1, -0x1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-gt v2, v1, :cond_1
|
|
|
|
|
|
|
|
add-int v3, v2, v1
|
|
|
|
|
|
|
|
div-int/lit8 v3, v3, 0x2
|
|
|
|
|
|
|
|
invoke-virtual {p0, v3}, Landroid/widget/FrameLayout;->getChildAt(I)Landroid/view/View;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
check-cast v4, Landroidx/transition/GhostViewPort;
|
|
|
|
|
|
|
|
iget-object v4, v4, Landroidx/transition/GhostViewPort;->mView:Landroid/view/View;
|
|
|
|
|
|
|
|
invoke-static {v4, v0}, Landroidx/transition/GhostViewHolder;->getParents(Landroid/view/View;Ljava/util/ArrayList;)V
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Landroidx/transition/GhostViewHolder;->isOnTop(Ljava/util/ArrayList;Ljava/util/ArrayList;)Z
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
|
|
|
|
move v2, v3
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
add-int/lit8 v3, v3, -0x1
|
|
|
|
|
|
|
|
move v1, v3
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return v2
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static getParents(Landroid/view/View;Ljava/util/ArrayList;)V
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Landroid/view/View;",
|
|
|
|
"Ljava/util/ArrayList<",
|
|
|
|
"Landroid/view/View;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
check-cast v0, Landroid/view/View;
|
|
|
|
|
|
|
|
invoke-static {v0, p1}, Landroidx/transition/GhostViewHolder;->getParents(Landroid/view/View;Ljava/util/ArrayList;)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p1, p0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static isOnTop(Landroid/view/View;Landroid/view/View;)Z
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getChildCount()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getZ()F
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getZ()F
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/4 v5, 0x1
|
|
|
|
|
|
|
|
cmpl-float v2, v2, v3
|
|
|
|
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getZ()F
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getZ()F
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
cmpl-float p0, p0, p1
|
|
|
|
|
|
|
|
if-lez p0, :cond_0
|
|
|
|
|
|
|
|
const/4 v4, 0x1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return v4
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v2, v1, :cond_4
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Landroidx/transition/ViewGroupUtils;->getChildDrawingOrder(Landroid/view/ViewGroup;I)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-virtual {v0, v3}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
if-ne v3, p0, :cond_2
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
goto :goto_2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
if-ne v3, p1, :cond_3
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
:goto_1
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v4, 0x1
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
return v4
|
2020-05-17 12:40:10 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static isOnTop(Ljava/util/ArrayList;Ljava/util/ArrayList;)Z
|
|
|
|
.locals 6
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Ljava/util/ArrayList<",
|
|
|
|
"Landroid/view/View;",
|
|
|
|
">;",
|
|
|
|
"Ljava/util/ArrayList<",
|
|
|
|
"Landroid/view/View;",
|
|
|
|
">;)Z"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
if-eq v2, v3, :cond_0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0}, Ljava/util/ArrayList;->size()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v3, v2, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {p0, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
check-cast v4, Landroid/view/View;
|
|
|
|
|
|
|
|
invoke-virtual {p1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
check-cast v5, Landroid/view/View;
|
|
|
|
|
|
|
|
if-eq v4, v5, :cond_1
|
|
|
|
|
|
|
|
invoke-static {v4, v5}, Landroidx/transition/GhostViewHolder;->isOnTop(Landroid/view/View;Landroid/view/View;)Z
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
return p0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
|
|
|
|
|
|
|
|
move-result p0
|
|
|
|
|
|
|
|
if-ne p0, v2, :cond_3
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
goto :goto_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_3
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v1, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_4
|
|
|
|
:goto_1
|
|
|
|
return v1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public addGhostView(Landroidx/transition/GhostViewPort;)V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
iget-object v1, p1, Landroidx/transition/GhostViewPort;->mView:Landroid/view/View;
|
|
|
|
|
|
|
|
invoke-static {v1, v0}, Landroidx/transition/GhostViewHolder;->getParents(Landroid/view/View;Ljava/util/ArrayList;)V
|
|
|
|
|
|
|
|
invoke-direct {p0, v0}, Landroidx/transition/GhostViewHolder;->getInsertIndex(Ljava/util/ArrayList;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-ltz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getChildCount()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0, p1, v0}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;I)V
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onViewAdded(Landroid/view/View;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Landroidx/transition/GhostViewHolder;->mAttached:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onViewAdded(Landroid/view/View;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
|
|
|
|
const-string v0, "This GhostViewHolder is detached!"
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onViewRemoved(Landroid/view/View;)V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onViewRemoved(Landroid/view/View;)V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getChildCount()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
if-ne v0, v2, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0, v1}, Landroid/widget/FrameLayout;->getChildAt(I)Landroid/view/View;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eq v0, p1, :cond_1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getChildCount()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object p1, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
sget v0, Landroidx/transition/R$id;->ghost_view_holder:I
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0, v2}, Landroid/view/ViewGroup;->setTag(ILjava/lang/Object;)V
|
|
|
|
|
|
|
|
iget-object p1, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
invoke-static {p1}, Landroidx/transition/ViewGroupUtils;->getOverlay(Landroid/view/ViewGroup;)Landroidx/transition/ViewGroupOverlayImpl;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-interface {p1, p0}, Landroidx/transition/ViewGroupOverlayImpl;->remove(Landroid/view/View;)V
|
|
|
|
|
|
|
|
iput-boolean v1, p0, Landroidx/transition/GhostViewHolder;->mAttached:Z
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public popToOverlayTop()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Landroidx/transition/GhostViewHolder;->mAttached:Z
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroidx/transition/ViewGroupUtils;->getOverlay(Landroid/view/ViewGroup;)Landroidx/transition/ViewGroupOverlayImpl;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0, p0}, Landroidx/transition/ViewGroupOverlayImpl;->remove(Landroid/view/View;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Landroidx/transition/GhostViewHolder;->mParent:Landroid/view/ViewGroup;
|
|
|
|
|
|
|
|
invoke-static {v0}, Landroidx/transition/ViewGroupUtils;->getOverlay(Landroid/view/ViewGroup;)Landroidx/transition/ViewGroupOverlayImpl;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0, p0}, Landroidx/transition/ViewGroupOverlayImpl;->add(Landroid/view/View;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
|
|
|
|
const-string v1, "This GhostViewHolder is detached!"
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|