318 lines
8.4 KiB
Smali
318 lines
8.4 KiB
Smali
.class public abstract Lcom/google/android/material/transformation/ExpandableBehavior;
|
|
.super Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;
|
|
.source "ExpandableBehavior.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior<",
|
|
"Landroid/view/View;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final STATE_COLLAPSED:I = 0x2
|
|
|
|
.field private static final STATE_EXPANDED:I = 0x1
|
|
|
|
.field private static final STATE_UNINITIALIZED:I
|
|
|
|
|
|
# instance fields
|
|
.field private currentState:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput p1, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000(Lcom/google/android/material/transformation/ExpandableBehavior;)I
|
|
.locals 0
|
|
|
|
iget p0, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private didStateChange(Z)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
iget p1, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-ne p1, v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return v0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return v1
|
|
|
|
:cond_2
|
|
iget p1, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
if-ne p1, v1, :cond_3
|
|
|
|
return v1
|
|
|
|
:cond_3
|
|
return v0
|
|
.end method
|
|
|
|
.method public static from(Landroid/view/View;Ljava/lang/Class;)Lcom/google/android/material/transformation/ExpandableBehavior;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Lcom/google/android/material/transformation/ExpandableBehavior;",
|
|
">(",
|
|
"Landroid/view/View;",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;)TT;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object p0
|
|
|
|
instance-of v0, p0, Landroidx/coordinatorlayout/widget/CoordinatorLayout$LayoutParams;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
check-cast p0, Landroidx/coordinatorlayout/widget/CoordinatorLayout$LayoutParams;
|
|
|
|
invoke-virtual {p0}, Landroidx/coordinatorlayout/widget/CoordinatorLayout$LayoutParams;->getBehavior()Landroidx/coordinatorlayout/widget/CoordinatorLayout$Behavior;
|
|
|
|
move-result-object p0
|
|
|
|
instance-of v0, p0, Lcom/google/android/material/transformation/ExpandableBehavior;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/Class;->cast(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Lcom/google/android/material/transformation/ExpandableBehavior;
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "The view is not associated with ExpandableBehavior"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "The view is not a child of CoordinatorLayout"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected findExpandableWidget(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;)Lcom/google/android/material/expandable/ExpandableWidget;
|
|
.locals 5
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/coordinatorlayout/widget/CoordinatorLayout;->getDependencies(Landroid/view/View;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_1
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/view/View;
|
|
|
|
invoke-virtual {p0, p1, p2, v3}, Lcom/google/android/material/transformation/ExpandableBehavior;->layoutDependsOn(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;Landroid/view/View;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
check-cast v3, Lcom/google/android/material/expandable/ExpandableWidget;
|
|
|
|
return-object v3
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public abstract layoutDependsOn(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;Landroid/view/View;)Z
|
|
.end method
|
|
|
|
.method public onDependentViewChanged(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;Landroid/view/View;)Z
|
|
.locals 1
|
|
|
|
check-cast p3, Lcom/google/android/material/expandable/ExpandableWidget;
|
|
|
|
invoke-interface {p3}, Lcom/google/android/material/expandable/ExpandableWidget;->isExpanded()Z
|
|
|
|
move-result p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/google/android/material/transformation/ExpandableBehavior;->didStateChange(Z)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-interface {p3}, Lcom/google/android/material/expandable/ExpandableWidget;->isExpanded()Z
|
|
|
|
move-result p1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x2
|
|
|
|
:goto_0
|
|
iput p1, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
move-object p1, p3
|
|
|
|
check-cast p1, Landroid/view/View;
|
|
|
|
invoke-interface {p3}, Lcom/google/android/material/expandable/ExpandableWidget;->isExpanded()Z
|
|
|
|
move-result p3
|
|
|
|
invoke-virtual {p0, p1, p2, p3, v0}, Lcom/google/android/material/transformation/ExpandableBehavior;->onExpandedStateChange(Landroid/view/View;Landroid/view/View;ZZ)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method protected abstract onExpandedStateChange(Landroid/view/View;Landroid/view/View;ZZ)Z
|
|
.end method
|
|
|
|
.method public onLayoutChild(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;I)Z
|
|
.locals 2
|
|
|
|
invoke-static {p2}, Landroidx/core/view/ViewCompat;->isLaidOut(Landroid/view/View;)Z
|
|
|
|
move-result p3
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/google/android/material/transformation/ExpandableBehavior;->findExpandableWidget(Landroidx/coordinatorlayout/widget/CoordinatorLayout;Landroid/view/View;)Lcom/google/android/material/expandable/ExpandableWidget;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-interface {p1}, Lcom/google/android/material/expandable/ExpandableWidget;->isExpanded()Z
|
|
|
|
move-result p3
|
|
|
|
invoke-direct {p0, p3}, Lcom/google/android/material/transformation/ExpandableBehavior;->didStateChange(Z)Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
invoke-interface {p1}, Lcom/google/android/material/expandable/ExpandableWidget;->isExpanded()Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const/4 p3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p3, 0x2
|
|
|
|
:goto_0
|
|
iput p3, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
iget p3, p0, Lcom/google/android/material/transformation/ExpandableBehavior;->currentState:I
|
|
|
|
invoke-virtual {p2}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/google/android/material/transformation/ExpandableBehavior$1;
|
|
|
|
invoke-direct {v1, p0, p2, p3, p1}, Lcom/google/android/material/transformation/ExpandableBehavior$1;-><init>(Lcom/google/android/material/transformation/ExpandableBehavior;Landroid/view/View;ILcom/google/android/material/expandable/ExpandableWidget;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnPreDrawListener(Landroid/view/ViewTreeObserver$OnPreDrawListener;)V
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|