1749 lines
46 KiB
Smali
1749 lines
46 KiB
Smali
.class public final Lcom/discord/widgets/main/OverlappingPanelsLayout;
|
|
.super Landroidx/coordinatorlayout/widget/CoordinatorLayout;
|
|
.source "OverlappingPanelsLayout.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/widgets/main/PanelLayout;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;,
|
|
Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public centerPanel:Landroid/view/View;
|
|
|
|
.field public centerPanelDiffX:F
|
|
|
|
.field public centerPanelXAnimator:Landroid/animation/ValueAnimator;
|
|
|
|
.field public centerPanelXFlingAnimation:Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
.field public isScrollingHorizontally:Z
|
|
|
|
.field public final leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public leftPanel:Landroid/view/View;
|
|
|
|
.field public maxCenterPanelX:F
|
|
|
|
.field public minCenterPanelX:F
|
|
|
|
.field public minFlingPxPerSecond:F
|
|
|
|
.field public final rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public rightPanel:Landroid/view/View;
|
|
|
|
.field public scrollingSlopPx:F
|
|
|
|
.field public selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
.field public velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
.field public xFromInterceptActionDown:F
|
|
|
|
.field public yFromInterceptActionDown:F
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Landroidx/coordinatorlayout/widget/CoordinatorLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
sget p1, Lw/u/b/g;->a:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
sget p1, Lw/u/b/g;->b:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
sget-object p1, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/coordinatorlayout/widget/CoordinatorLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
sget p1, Lw/u/b/g;->a:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
sget p1, Lw/u/b/g;->b:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
sget-object p1, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->initialize()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/coordinatorlayout/widget/CoordinatorLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
sget p1, Lw/u/b/g;->a:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
sget p1, Lw/u/b/g;->b:F
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
sget-object p1, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->initialize()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p5, p4, 0x2
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
const/4 p3, 0x0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/main/OverlappingPanelsLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getLeftPanel$p(Lcom/discord/widgets/main/OverlappingPanelsLayout;)Landroid/view/View;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "leftPanel"
|
|
|
|
invoke-static {p0}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleCenterPanelX(Lcom/discord/widgets/main/OverlappingPanelsLayout;FF)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->handleCenterPanelX(FF)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setLeftPanel$p(Lcom/discord/widgets/main/OverlappingPanelsLayout;Landroid/view/View;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$updateCenterPanelX(Lcom/discord/widgets/main/OverlappingPanelsLayout;F)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelX(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final calculateDistanceX(FLandroid/view/MotionEvent;)F
|
|
.locals 0
|
|
|
|
invoke-virtual {p2}, Landroid/view/MotionEvent;->getX()F
|
|
|
|
move-result p2
|
|
|
|
sub-float/2addr p2, p1
|
|
|
|
return p2
|
|
.end method
|
|
|
|
.method private final calculateDistanceY(FLandroid/view/MotionEvent;)F
|
|
.locals 0
|
|
|
|
invoke-virtual {p2}, Landroid/view/MotionEvent;->getY()F
|
|
|
|
move-result p2
|
|
|
|
sub-float/2addr p2, p1
|
|
|
|
return p2
|
|
.end method
|
|
|
|
.method private final closePanels(Ljava/lang/Float;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelXWithAnimation(FLjava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic closePanels$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->closePanels(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getLeftDrawerState(FF)Lcom/discord/stores/StoreNavigation$DrawerState;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-gtz v0, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Closed;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Closed;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreNavigation$DrawerState$Opened;
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-direct {p1, p2}, Lcom/discord/stores/StoreNavigation$DrawerState$Opened;-><init>(Z)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
cmpl-float p1, p2, p1
|
|
|
|
if-lez p1, :cond_2
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Opening;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Opening;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Closing;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Closing;
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final getNormalizedX(Landroid/view/MotionEvent;)F
|
|
.locals 2
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getTargetedX(Landroid/view/MotionEvent;)F
|
|
|
|
move-result p1
|
|
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
cmpl-float v1, p1, v0
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
cmpg-float v1, p1, v0
|
|
|
|
if-gez v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move v0, p1
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method private final getRightDrawerState(FF)Lcom/discord/stores/StoreNavigation$DrawerState;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
cmpl-float v0, p2, v0
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Closed;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Closed;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreNavigation$DrawerState$Opened;
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-direct {p1, p2}, Lcom/discord/stores/StoreNavigation$DrawerState$Opened;-><init>(Z)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
cmpg-float p1, p2, p1
|
|
|
|
if-gez p1, :cond_2
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Opening;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Opening;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
sget-object p1, Lcom/discord/stores/StoreNavigation$DrawerState$Closing;->INSTANCE:Lcom/discord/stores/StoreNavigation$DrawerState$Closing;
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final getTargetedX(Landroid/view/MotionEvent;)F
|
|
.locals 1
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F
|
|
|
|
move-result p1
|
|
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelDiffX:F
|
|
|
|
add-float/2addr p1, v0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private final handleCenterPanelX(FF)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->LEFT:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
cmpg-float v0, p2, v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
sget-object v0, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->RIGHT:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getLeftDrawerState(FF)Lcom/discord/stores/StoreNavigation$DrawerState;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_1
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;
|
|
|
|
invoke-interface {v2, v0}, Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;->onDrawerStateChange(Lcom/discord/stores/StoreNavigation$DrawerState;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getRightDrawerState(FF)Lcom/discord/stores/StoreNavigation$DrawerState;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {p2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_2
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;
|
|
|
|
invoke-interface {v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;->onDrawerStateChange(Lcom/discord/stores/StoreNavigation$DrawerState;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private final initPanels()V
|
|
.locals 6
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "getChildAt(0)"
|
|
|
|
invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p0, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "getChildAt(1)"
|
|
|
|
invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-virtual {p0, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "getChildAt(2)"
|
|
|
|
invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightPanel:Landroid/view/View;
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
const-string v2, "leftPanel"
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
const/16 v4, 0x8
|
|
|
|
invoke-virtual {v1, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v1, v2}, Landroid/view/View;->setElevation(F)V
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
const-string v5, "centerPanel"
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const/high16 v1, 0x3f800000 # 1.0f
|
|
|
|
invoke-virtual {v0, v1}, Landroid/view/View;->setElevation(F)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightPanel:Landroid/view/View;
|
|
|
|
const-string v1, "rightPanel"
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightPanel:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, v2}, Landroid/view/View;->setElevation(F)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_1
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_2
|
|
invoke-static {v5}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_3
|
|
invoke-static {v5}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_4
|
|
invoke-static {v2}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_5
|
|
invoke-static {v2}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
.end method
|
|
|
|
.method private final initialize()V
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const v1, 0x7f0700d0
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->scrollingSlopPx:F
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const v1, 0x7f0700cf
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minFlingPxPerSecond:F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic openLeftPanel$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openLeftPanel(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final openRightPanel(Ljava/lang/Float;)V
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelXWithAnimation(FLjava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic openRightPanel$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openRightPanel(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final shouldHandleActionMoveEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 4
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getNormalizedX(Landroid/view/MotionEvent;)F
|
|
|
|
move-result p1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-virtual {v0}, Landroid/view/View;->getX()F
|
|
|
|
move-result v0
|
|
|
|
sub-float v0, p1, v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "resources"
|
|
|
|
invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object v1
|
|
|
|
iget v1, v1, Landroid/util/DisplayMetrics;->density:F
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
cmpl-float v0, v0, v1
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
const/4 v1, 0x0
|
|
|
|
cmpg-float v1, p1, v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
iget v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
cmpg-float v1, p1, v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
iget v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
cmpg-float p1, p1, v1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v2, 0x0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return v2
|
|
|
|
:cond_3
|
|
const-string p1, "centerPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final snapOpenOrClose(Landroid/view/MotionEvent;)V
|
|
.locals 5
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getTargetedX(Landroid/view/MotionEvent;)F
|
|
|
|
move-result p1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/16 v1, 0x3e8
|
|
|
|
invoke-virtual {v0, v1}, Landroid/view/VelocityTracker;->computeCurrentVelocity(I)V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Landroid/view/VelocityTracker;->getXVelocity()F
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget v0, Lw/u/b/g;->a:F
|
|
|
|
:goto_0
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v1
|
|
|
|
iget v2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minFlingPxPerSecond:F
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x1
|
|
|
|
cmpl-float v1, v1, v2
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v1, :cond_7
|
|
|
|
int-to-float v1, v3
|
|
|
|
cmpl-float v1, v0, v1
|
|
|
|
if-lez v1, :cond_5
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
sget-object v1, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->RIGHT:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
if-ne p1, v1, :cond_3
|
|
|
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->closePanels(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
sget-object v1, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
if-ne p1, v1, :cond_4
|
|
|
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openLeftPanel(Ljava/lang/Float;)V
|
|
|
|
:cond_4
|
|
return-void
|
|
|
|
:cond_5
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
sget-object v2, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->LEFT:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
if-ne v1, v2, :cond_6
|
|
|
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->closePanels(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
sget-object v2, Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;->CENTER:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
if-ne v1, v2, :cond_7
|
|
|
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openRightPanel(Ljava/lang/Float;)V
|
|
|
|
return-void
|
|
|
|
:cond_7
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
const/4 v1, 0x2
|
|
|
|
int-to-float v1, v1
|
|
|
|
div-float/2addr v0, v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
cmpl-float v0, p1, v0
|
|
|
|
if-lez v0, :cond_8
|
|
|
|
invoke-static {p0, v2, v4, v2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openLeftPanel$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_8
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
div-float/2addr v0, v1
|
|
|
|
cmpg-float p1, p1, v0
|
|
|
|
if-gez p1, :cond_9
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openEndPanel()V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_9
|
|
invoke-static {p0, v2, v4, v2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->closePanels$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
|
|
:goto_2
|
|
return-void
|
|
.end method
|
|
|
|
.method private final translateCenterPanel(Landroid/view/MotionEvent;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->getNormalizedX(Landroid/view/MotionEvent;)F
|
|
|
|
move-result p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelX(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final updateCenterPanelX(F)V
|
|
.locals 9
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
const-string v1, "centerPanel"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_9
|
|
|
|
invoke-virtual {v0}, Landroid/view/View;->getX()F
|
|
|
|
move-result v0
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v3, :cond_8
|
|
|
|
invoke-virtual {v3, p1}, Landroid/view/View;->setX(F)V
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
if-eqz v3, :cond_7
|
|
|
|
iget-object v4, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v4, :cond_6
|
|
|
|
invoke-virtual {v4}, Landroid/view/View;->getX()F
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
int-to-float v6, v5
|
|
|
|
const/4 v7, 0x1
|
|
|
|
cmpl-float v4, v4, v6
|
|
|
|
if-lez v4, :cond_0
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
const/16 v8, 0x8
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/16 v4, 0x8
|
|
|
|
:goto_1
|
|
invoke-virtual {v3, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightPanel:Landroid/view/View;
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
iget-object v4, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
invoke-virtual {v4}, Landroid/view/View;->getX()F
|
|
|
|
move-result v1
|
|
|
|
cmpg-float v1, v1, v6
|
|
|
|
if-gez v1, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v7, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v7, :cond_3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/16 v5, 0x8
|
|
|
|
:goto_3
|
|
invoke-virtual {v3, v5}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->handleCenterPanelX(FF)V
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_5
|
|
const-string p1, "rightPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_6
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_7
|
|
const-string p1, "leftPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_8
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_9
|
|
invoke-static {v1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|
|
|
|
.method private final updateCenterPanelXWithAnimation(FLjava/lang/Float;)V
|
|
.locals 6
|
|
|
|
new-instance v0, Lkotlin/jvm/internal/Ref$FloatRef;
|
|
|
|
invoke-direct {v0}, Lkotlin/jvm/internal/Ref$FloatRef;-><init>()V
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "centerPanel"
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getX()F
|
|
|
|
move-result v1
|
|
|
|
iput v1, v0, Lkotlin/jvm/internal/Ref$FloatRef;->element:F
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXAnimator:Landroid/animation/ValueAnimator;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {v1}, Landroid/animation/ValueAnimator;->cancel()V
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXFlingAnimation:Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Landroidx/dynamicanimation/animation/DynamicAnimation;->cancel()V
|
|
|
|
:cond_1
|
|
if-nez p2, :cond_3
|
|
|
|
const/4 p2, 0x2
|
|
|
|
new-array p2, p2, [F
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iget v0, v0, Lkotlin/jvm/internal/Ref$FloatRef;->element:F
|
|
|
|
aput v0, p2, v1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
aput p1, p2, v0
|
|
|
|
invoke-static {p2}, Landroid/animation/ValueAnimator;->ofFloat([F)Landroid/animation/ValueAnimator;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Landroid/view/animation/AccelerateDecelerateInterpolator;
|
|
|
|
invoke-direct {p2}, Landroid/view/animation/AccelerateDecelerateInterpolator;-><init>()V
|
|
|
|
invoke-virtual {p1, p2}, Landroid/animation/ValueAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXAnimator:Landroid/animation/ValueAnimator;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXAnimator:Landroid/animation/ValueAnimator;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
new-instance p2, Lcom/discord/widgets/main/OverlappingPanelsLayout$updateCenterPanelXWithAnimation$2;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/main/OverlappingPanelsLayout$updateCenterPanelXWithAnimation$2;-><init>(Lcom/discord/widgets/main/OverlappingPanelsLayout;)V
|
|
|
|
invoke-virtual {p1, p2}, Landroid/animation/ValueAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V
|
|
|
|
:cond_2
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXAnimator:Landroid/animation/ValueAnimator;
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p1}, Landroid/animation/ValueAnimator;->start()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget v1, v0, Lkotlin/jvm/internal/Ref$FloatRef;->element:F
|
|
|
|
invoke-static {v1, p1}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v1
|
|
|
|
iget v4, v0, Lkotlin/jvm/internal/Ref$FloatRef;->element:F
|
|
|
|
invoke-static {v4, p1}, Ljava/lang/Math;->max(FF)F
|
|
|
|
move-result p1
|
|
|
|
new-instance v4, Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
iget-object v5, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
sget-object v2, Landroidx/dynamicanimation/animation/DynamicAnimation;->X:Landroidx/dynamicanimation/animation/DynamicAnimation$ViewProperty;
|
|
|
|
invoke-direct {v4, v5, v2}, Landroidx/dynamicanimation/animation/FlingAnimation;-><init>(Ljava/lang/Object;Landroidx/dynamicanimation/animation/FloatPropertyCompat;)V
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Float;->floatValue()F
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {v4, p2}, Landroidx/dynamicanimation/animation/FlingAnimation;->setStartVelocity(F)Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2, v1}, Landroidx/dynamicanimation/animation/FlingAnimation;->setMinValue(F)Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2, p1}, Landroidx/dynamicanimation/animation/FlingAnimation;->setMaxValue(F)Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x3f99999a # 1.2f
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/dynamicanimation/animation/FlingAnimation;->setFriction(F)Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Lcom/discord/widgets/main/OverlappingPanelsLayout$updateCenterPanelXWithAnimation$3;
|
|
|
|
invoke-direct {p2, p0, v0}, Lcom/discord/widgets/main/OverlappingPanelsLayout$updateCenterPanelXWithAnimation$3;-><init>(Lcom/discord/widgets/main/OverlappingPanelsLayout;Lkotlin/jvm/internal/Ref$FloatRef;)V
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/dynamicanimation/animation/DynamicAnimation;->addUpdateListener(Landroidx/dynamicanimation/animation/DynamicAnimation$OnAnimationUpdateListener;)Landroidx/dynamicanimation/animation/DynamicAnimation;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXFlingAnimation:Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelXFlingAnimation:Landroidx/dynamicanimation/animation/FlingAnimation;
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p1}, Landroidx/dynamicanimation/animation/DynamicAnimation;->start()V
|
|
|
|
:cond_4
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_5
|
|
invoke-static {v3}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_6
|
|
invoke-static {v3}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|
|
|
|
.method public static synthetic updateCenterPanelXWithAnimation$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;FLjava/lang/Float;ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelXWithAnimation(FLjava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getSelectedPanel()Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->selectedPanel:Lcom/discord/widgets/main/OverlappingPanelsLayout$Panel;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
if-eq v1, v2, :cond_3
|
|
|
|
const/4 v4, 0x2
|
|
|
|
if-eq v1, v4, :cond_1
|
|
|
|
const/4 p1, 0x3
|
|
|
|
if-eq v1, p1, :cond_3
|
|
|
|
:cond_0
|
|
:goto_0
|
|
const/4 v2, 0x0
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_1
|
|
iget-boolean v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->isScrollingHorizontally:Z
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->xFromInterceptActionDown:F
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->calculateDistanceX(FLandroid/view/MotionEvent;)F
|
|
|
|
move-result v0
|
|
|
|
iget v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->yFromInterceptActionDown:F
|
|
|
|
invoke-direct {p0, v1, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->calculateDistanceY(FLandroid/view/MotionEvent;)F
|
|
|
|
move-result p1
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v1
|
|
|
|
iget v4, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->scrollingSlopPx:F
|
|
|
|
cmpl-float v1, v1, v4
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p1}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result p1
|
|
|
|
cmpl-float p1, v0, p1
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
iput-boolean v2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->isScrollingHorizontally:Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p1}, Landroid/view/VelocityTracker;->recycle()V
|
|
|
|
:cond_4
|
|
iput-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
iget-boolean v2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->isScrollingHorizontally:Z
|
|
|
|
iput-boolean v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->isScrollingHorizontally:Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
iput-boolean v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->isScrollingHorizontally:Z
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanel:Landroid/view/View;
|
|
|
|
if-eqz v1, :cond_7
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getX()F
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F
|
|
|
|
move-result v1
|
|
|
|
sub-float/2addr v0, v1
|
|
|
|
iput v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->centerPanelDiffX:F
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->xFromInterceptActionDown:F
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->yFromInterceptActionDown:F
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_6
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/view/VelocityTracker;->clear()V
|
|
|
|
goto :goto_0
|
|
|
|
:goto_1
|
|
return v2
|
|
|
|
:cond_7
|
|
const-string p1, "centerPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_8
|
|
const-string p1, "event"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onLayout(ZIIII)V
|
|
.locals 0
|
|
|
|
invoke-super/range {p0 .. p5}, Landroidx/coordinatorlayout/widget/CoordinatorLayout;->onLayout(ZIIII)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, 0x3
|
|
|
|
if-ne p1, p2, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->initPanels()V
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f0701c8
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result p1
|
|
|
|
iget-object p2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftPanel:Landroid/view/View;
|
|
|
|
const/4 p3, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-virtual {p2}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result p2
|
|
|
|
int-to-float p2, p2
|
|
|
|
add-float/2addr p2, p1
|
|
|
|
iput p2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
iget-object p2, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightPanel:Landroid/view/View;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result p2
|
|
|
|
int-to-float p2, p2
|
|
|
|
add-float/2addr p2, p1
|
|
|
|
neg-float p1, p2
|
|
|
|
iput p1, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->minCenterPanelX:F
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string p1, "rightPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw p3
|
|
|
|
:cond_1
|
|
const-string p1, "leftPanel"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw p3
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eq v0, v1, :cond_3
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-eq v0, v2, :cond_1
|
|
|
|
const/4 v2, 0x3
|
|
|
|
if-eq v0, v2, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->snapOpenOrClose(Landroid/view/MotionEvent;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v0, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
|
|
|
|
:cond_2
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->shouldHandleActionMoveEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->translateCenterPanel(Landroid/view/MotionEvent;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget-object v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->velocityTracker:Landroid/view/VelocityTracker;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
|
|
|
|
:cond_4
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->snapOpenOrClose(Landroid/view/MotionEvent;)V
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return v1
|
|
|
|
:cond_6
|
|
const-string p1, "event"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public openEndPanel()V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-static {p0, v0, v1, v0}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->openRightPanel$default(Lcom/discord/widgets/main/OverlappingPanelsLayout;Ljava/lang/Float;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final openLeftPanel(Ljava/lang/Float;)V
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->maxCenterPanelX:F
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/widgets/main/OverlappingPanelsLayout;->updateCenterPanelXWithAnimation(FLjava/lang/Float;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final varargs registerLeftDrawerStateListeners([Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;)V
|
|
.locals 4
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
array-length v0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, v0, :cond_0
|
|
|
|
aget-object v2, p1, v1
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->leftDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "drawerStateListenerArgs"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final varargs registerRightDrawerStateListeners([Lcom/discord/widgets/main/OverlappingPanelsLayout$DrawerStateListener;)V
|
|
.locals 4
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
array-length v0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, v0, :cond_0
|
|
|
|
aget-object v2, p1, v1
|
|
|
|
iget-object v3, p0, Lcom/discord/widgets/main/OverlappingPanelsLayout;->rightDrawerStateListeners:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "drawerStateListenerArgs"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|