273 lines
7.6 KiB
Smali
273 lines
7.6 KiB
Smali
.class public Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;
|
|
.super Lcom/discord/app/AppDialog;
|
|
.source "WidgetServerSettingsEditRoleColorPicker.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final ARG_COLORS_ARRAY_KEY:Ljava/lang/String; = "COLORS_ARRAY"
|
|
|
|
.field public static final ARG_SELECTED_COLOR_KEY:Ljava/lang/String; = "SELECTED_COLOR"
|
|
|
|
|
|
# instance fields
|
|
.field public colorsGridView:Landroid/widget/GridView;
|
|
|
|
.field public done:Landroid/widget/TextView;
|
|
|
|
.field public listener:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
.field public reset:Landroid/widget/TextView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/app/AppDialog;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static show(Landroidx/fragment/app/FragmentManager;[IILcom/angarron/colorpicker/OnColorSelectedListener;Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
new-instance v0, Landroid/os/Bundle;
|
|
|
|
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
|
|
|
|
const-string v1, "COLORS_ARRAY"
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/os/Bundle;->putIntArray(Ljava/lang/String;[I)V
|
|
|
|
const-string p1, "SELECTED_COLOR"
|
|
|
|
invoke-virtual {v0, p1, p2}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
|
|
|
|
new-instance p1, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;
|
|
|
|
invoke-direct {p1}, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;-><init>()V
|
|
|
|
iput-object p3, p1, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->listener:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/fragment/app/Fragment;->setArguments(Landroid/os/Bundle;)V
|
|
|
|
invoke-virtual {p1, p0, p4}, Lcom/discord/app/AppDialog;->show(Landroidx/fragment/app/FragmentManager;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public synthetic a(I)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->listener:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0, p1}, Lcom/angarron/colorpicker/OnColorSelectedListener;->a(I)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic a(Landroid/view/View;)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/app/AppDialog;->dismiss()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic b(Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->listener:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-interface {p1, v0}, Lcom/angarron/colorpicker/OnColorSelectedListener;->a(I)V
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/discord/app/AppDialog;->dismiss()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public getContentViewResId()I
|
|
.locals 1
|
|
|
|
const v0, 0x7f0d020e
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public onViewBound(Landroid/view/View;)V
|
|
.locals 1
|
|
.param p1 # Landroid/view/View;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/app/AppDialog;->onViewBound(Landroid/view/View;)V
|
|
|
|
const v0, 0x7f0a024e
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/GridView;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->colorsGridView:Landroid/widget/GridView;
|
|
|
|
const v0, 0x7f0a024f
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->reset:Landroid/widget/TextView;
|
|
|
|
const v0, 0x7f0a024d
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->done:Landroid/widget/TextView;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onViewBoundOrOnResume()V
|
|
.locals 8
|
|
|
|
invoke-super {p0}, Lcom/discord/app/AppDialog;->onViewBoundOrOnResume()V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/app/AppDialog;->getArgumentsOrDefault()Landroid/os/Bundle;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "COLORS_ARRAY"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/os/Bundle;->getIntArray(Ljava/lang/String;)[I
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p0}, Lcom/discord/app/AppDialog;->getArgumentsOrDefault()Landroid/os/Bundle;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "SELECTED_COLOR"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual {p0}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
sget v0, Le/f/a/b;->j:F
|
|
|
|
sget-object v0, Le/f/a/b;->k:[I
|
|
|
|
array-length v1, v0
|
|
|
|
new-array v1, v1, [I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
array-length v6, v0
|
|
|
|
if-ge v2, v6, :cond_0
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v6
|
|
|
|
aget v7, v0, v2
|
|
|
|
invoke-virtual {v6, v7}, Landroid/content/res/Resources;->getColor(I)I
|
|
|
|
move-result v6
|
|
|
|
aput v6, v1, v2
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/high16 v6, 0x42340000 # 45.0f
|
|
|
|
new-instance v0, Le/f/a/b;
|
|
|
|
const/4 v7, 0x0
|
|
|
|
move-object v2, v0
|
|
|
|
invoke-direct/range {v2 .. v7}, Le/f/a/b;-><init>(Landroid/content/Context;[IIFLe/f/a/b$a;)V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iput-object v1, v0, Le/f/a/b;->i:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->colorsGridView:Landroid/widget/GridView;
|
|
|
|
iget v2, v0, Le/f/a/b;->e:F
|
|
|
|
iget-object v3, v0, Le/f/a/b;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
invoke-static {v4, v2, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F
|
|
|
|
move-result v2
|
|
|
|
float-to-int v2, v2
|
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/GridView;->setColumnWidth(I)V
|
|
|
|
invoke-virtual {v1, v0}, Landroid/widget/GridView;->setAdapter(Landroid/widget/ListAdapter;)V
|
|
|
|
new-instance v1, Le/a/k/e/o1;
|
|
|
|
invoke-direct {v1, p0}, Le/a/k/e/o1;-><init>(Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;)V
|
|
|
|
iput-object v1, v0, Le/f/a/b;->i:Lcom/angarron/colorpicker/OnColorSelectedListener;
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->done:Landroid/widget/TextView;
|
|
|
|
new-instance v1, Le/a/k/e/q1;
|
|
|
|
invoke-direct {v1, p0}, Le/a/k/e/q1;-><init>(Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;->reset:Landroid/widget/TextView;
|
|
|
|
new-instance v1, Le/a/k/e/p1;
|
|
|
|
invoke-direct {v1, p0}, Le/a/k/e/p1;-><init>(Lcom/discord/widgets/servers/WidgetServerSettingsEditRoleColorPicker;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
.end method
|