396 lines
11 KiB
Smali
396 lines
11 KiB
Smali
.class public final Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetGuildContextMenu.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final computeMaxContextMenuHeight(Landroid/content/Context;)I
|
|
.locals 3
|
|
|
|
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object p1
|
|
|
|
const v0, 0x7f0d01d3
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, v2, v2}, Landroid/view/View;->measure(II)V
|
|
|
|
const-string v0, "view"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getMeasuredHeight()I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private final newInstance(J)Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
.locals 2
|
|
|
|
new-instance v0, Landroid/os/Bundle;
|
|
|
|
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
|
|
|
|
const-string v1, "com.discord.intent.extra.EXTRA_GUILD_ID"
|
|
|
|
invoke-virtual {v0, v1, p1, p2}, Landroid/os/Bundle;->putLong(Ljava/lang/String;J)V
|
|
|
|
new-instance p1, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
|
|
invoke-direct {p1}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;-><init>()V
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/fragment/app/Fragment;->setArguments(Landroid/os/Bundle;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final hide(Landroidx/fragment/app/FragmentActivity;Z)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "WidgetGuildContextMenu"
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/fragment/app/FragmentManager;->findFragmentByTag(Ljava/lang/String;)Landroidx/fragment/app/Fragment;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v0, v1
|
|
|
|
:goto_0
|
|
check-cast v0, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-static {v0}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;->access$doCircularRemove(Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2, v0}, Landroidx/fragment/app/FragmentTransaction;->remove(Landroidx/fragment/app/Fragment;)Landroidx/fragment/app/FragmentTransaction;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Landroidx/fragment/app/FragmentTransaction;->commitAllowingStateLoss()I
|
|
|
|
invoke-virtual {p1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "activity.window"
|
|
|
|
invoke-static {p2, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Landroid/view/Window;->getDecorView()Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v1, "activity.window.decorView"
|
|
|
|
invoke-static {p2, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Landroid/view/View;->getRootView()Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
check-cast p2, Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {p1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/Window;->getDecorView()Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getRootView()Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "WidgetGuildContextMenuViewContainer"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewWithTag(Ljava/lang/Object;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/FrameLayout;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p2, p1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V
|
|
|
|
:cond_2
|
|
const/4 p1, 0x0
|
|
|
|
invoke-static {p1}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;->access$setShowingContextMenu$cp(Z)V
|
|
|
|
:goto_1
|
|
return-void
|
|
|
|
:cond_3
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string p2, "null cannot be cast to non-null type android.view.ViewGroup"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
return-void
|
|
|
|
:cond_5
|
|
const-string p1, "activity"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final show(Landroidx/fragment/app/FragmentActivity;Landroid/graphics/PointF;J)V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-static {}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;->access$isShowingContextMenu$cp()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {v0}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;->access$setShowingContextMenu$cp(Z)V
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;->computeMaxContextMenuHeight(Landroid/content/Context;)I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p0, p1, v0}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;->hide(Landroidx/fragment/app/FragmentActivity;Z)V
|
|
|
|
new-instance v0, Landroid/widget/FrameLayout;
|
|
|
|
invoke-direct {v0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
new-instance v1, Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
const/4 v2, -0x1
|
|
|
|
invoke-direct {v1, v2, v2}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
const-string v1, "WidgetGuildContextMenuViewContainer"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->setTag(Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {p1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "activity.window"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Landroid/view/Window;->getDecorView()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "activity.window.decorView"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getRootView()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
check-cast v1, Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
|
|
|
|
new-instance v2, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion$show$1;
|
|
|
|
invoke-direct {v2, p1}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion$show$1;-><init>(Landroidx/fragment/app/FragmentActivity;)V
|
|
|
|
invoke-virtual {v0, v2}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
new-instance v2, Landroid/widget/FrameLayout;
|
|
|
|
invoke-direct {v2, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
invoke-static {}, Landroid/view/View;->generateViewId()I
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual {v2, v3}, Landroid/widget/FrameLayout;->setId(I)V
|
|
|
|
new-instance v3, Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
const/4 v4, -0x2
|
|
|
|
invoke-direct {v3, v4, v4}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V
|
|
|
|
invoke-virtual {v2, v3}, Landroid/widget/FrameLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
invoke-virtual {v0, v2}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
|
|
|
|
iget v0, p2, Landroid/graphics/PointF;->x:F
|
|
|
|
invoke-virtual {v2, v0}, Landroid/widget/FrameLayout;->setX(F)V
|
|
|
|
invoke-virtual {v1}, Landroid/view/ViewGroup;->getHeight()I
|
|
|
|
move-result v0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;->computeMaxContextMenuHeight(Landroid/content/Context;)I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-static {}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;->access$getSCREEN_BOTTOM_BUFFER$cp()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
iget p2, p2, Landroid/graphics/PointF;->y:F
|
|
|
|
int-to-float v0, v0
|
|
|
|
cmpl-float v1, p2, v0
|
|
|
|
if-lez v1, :cond_1
|
|
|
|
move p2, v0
|
|
|
|
:cond_1
|
|
invoke-virtual {v2, p2}, Landroid/widget/FrameLayout;->setY(F)V
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentActivity;->getSupportFragmentManager()Landroidx/fragment/app/FragmentManager;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentManager;->beginTransaction()Landroidx/fragment/app/FragmentTransaction;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v2}, Landroid/widget/FrameLayout;->getId()I
|
|
|
|
move-result p2
|
|
|
|
invoke-direct {p0, p3, p4}, Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu$Companion;->newInstance(J)Lcom/discord/widgets/guilds/contextmenu/WidgetGuildContextMenu;
|
|
|
|
move-result-object p3
|
|
|
|
const-string p4, "WidgetGuildContextMenu"
|
|
|
|
invoke-virtual {p1, p2, p3, p4}, Landroidx/fragment/app/FragmentTransaction;->add(ILandroidx/fragment/app/Fragment;Ljava/lang/String;)Landroidx/fragment/app/FragmentTransaction;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroidx/fragment/app/FragmentTransaction;->commit()I
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string p2, "null cannot be cast to non-null type android.view.ViewGroup"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
const-string p1, "absolutePosition"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
const-string p1, "activity"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|