apkfuckery/com.discord/smali/e/f/a/a.smali

508 lines
11 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Le/f/a/a;
2019-07-24 11:27:29 +00:00
.super Landroid/widget/FrameLayout;
.source "ColorItem.java"
# interfaces
.implements Landroid/view/View$OnClickListener;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
2019-12-06 03:29:40 +00:00
Le/f/a/a$c;
2019-07-24 11:27:29 +00:00
}
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public e:I
2019-10-23 04:50:18 +00:00
2019-12-06 03:29:40 +00:00
.field public f:I
.annotation build Landroidx/annotation/ColorInt;
.end annotation
.end field
2019-12-06 01:29:57 +00:00
2019-12-06 03:29:40 +00:00
.field public g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public h:Le/f/a/a$c;
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init>(Landroid/content/Context;IZ)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p2 # I
.annotation build Landroidx/annotation/ColorInt;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
const/4 p1, 0x0
2019-12-06 03:29:40 +00:00
iput p1, p0, Le/f/a/a;->e:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-boolean p1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput p2, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-boolean p3, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Le/f/a/a;->b()V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p0}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
move-result-object p1
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object p1
sget p2, Lcom/angarron/colorpicker/R$b;->color_item:I
const/4 p3, 0x1
invoke-virtual {p1, p2, p0, p3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
sget p1, Lcom/angarron/colorpicker/R$a;->selected_checkmark:I
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
2019-07-24 11:27:29 +00:00
move-result-object p1
check-cast p1, Landroid/widget/ImageView;
2019-12-06 03:29:40 +00:00
iput-object p1, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object p1, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p2, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p2}, Le/f/a/a;->b(I)Z
2019-07-24 11:27:29 +00:00
move-result p2
if-eqz p2, :cond_0
const/4 p2, -0x1
goto :goto_0
:cond_0
const/high16 p2, -0x1000000
:goto_0
invoke-virtual {p1, p2}, Landroid/widget/ImageView;->setColorFilter(I)V
2019-12-06 03:29:40 +00:00
iget-boolean p1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Le/f/a/a;->setChecked(Z)V
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static a(I)I
.locals 3
.annotation build Landroidx/annotation/ColorInt;
.end annotation
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v0, 0x3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
new-array v0, v0, [F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p0, v0}, Landroid/graphics/Color;->colorToHSV(I[F)V
const/4 p0, 0x2
aget v1, v0, p0
const/high16 v2, 0x3f000000 # 0.5f
mul-float v1, v1, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aput v1, v0, p0
invoke-static {v0}, Landroid/graphics/Color;->HSVToColor([F)I
move-result p0
2019-07-24 11:27:29 +00:00
return p0
.end method
2019-12-06 03:29:40 +00:00
.method public static synthetic a(Le/f/a/a;F)V
2019-07-24 11:27:29 +00:00
.locals 0
2019-12-06 03:29:40 +00:00
invoke-direct {p0, p1}, Le/f/a/a;->setItemCheckmarkAttributes(F)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
return-void
2019-07-24 11:27:29 +00:00
.end method
2019-12-06 03:29:40 +00:00
.method public static b(I)Z
.locals 6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p0}, Landroid/graphics/Color;->red(I)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-double v0, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-wide v2, 0x3fd322d0e5604189L # 0.299
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-double v0, v0, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p0}, Landroid/graphics/Color;->green(I)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-double v2, v2
const-wide v4, 0x3fe2c8b439581062L # 0.587
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-double v2, v2, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-double/2addr v2, v0
invoke-static {p0}, Landroid/graphics/Color;->blue(I)I
move-result p0
int-to-double v0, p0
const-wide v4, 0x3fbd2f1a9fbe76c9L # 0.114
mul-double v0, v0, v4
add-double/2addr v0, v2
const-wide/high16 v2, 0x4064000000000000L # 160.0
cmpg-double p0, v0, v2
if-gez p0, :cond_0
const/4 p0, 0x1
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
2019-12-06 03:29:40 +00:00
const/4 p0, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:goto_0
return p0
.end method
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.method private setItemCheckmarkAttributes(F)V
.locals 1
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setAlpha(F)V
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setScaleX(F)V
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setScaleY(F)V
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
# virtual methods
.method public final a()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
.locals 3
new-instance v0, Landroid/graphics/drawable/GradientDrawable;
invoke-direct {v0}, Landroid/graphics/drawable/GradientDrawable;-><init>()V
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setShape(I)V
2019-12-06 03:29:40 +00:00
iget v1, p0, Le/f/a/a;->e:I
2019-07-24 11:27:29 +00:00
if-eqz v1, :cond_1
2019-12-06 03:29:40 +00:00
iget v2, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v2}, Le/f/a/a;->b(I)Z
2019-07-24 11:27:29 +00:00
move-result v2
if-eqz v2, :cond_0
const/4 v2, -0x1
goto :goto_0
:cond_0
const/high16 v2, -0x1000000
:goto_0
invoke-virtual {v0, v1, v2}, Landroid/graphics/drawable/GradientDrawable;->setStroke(II)V
:cond_1
2019-12-06 03:29:40 +00:00
iget v1, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setColor(I)V
return-object v0
.end method
2019-12-06 03:29:40 +00:00
.method public final b()V
.locals 4
2019-07-24 11:27:29 +00:00
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
new-instance v0, Landroid/graphics/drawable/GradientDrawable;
invoke-direct {v0}, Landroid/graphics/drawable/GradientDrawable;-><init>()V
2019-12-06 03:29:40 +00:00
const/4 v1, 0x1
2019-07-24 11:27:29 +00:00
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setShape(I)V
const/high16 v1, -0x1000000
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setColor(I)V
new-instance v1, Landroid/graphics/drawable/RippleDrawable;
2019-12-06 03:29:40 +00:00
iget v2, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v2}, Le/f/a/a;->a(I)I
2019-07-24 11:27:29 +00:00
move-result v2
invoke-static {v2}, Landroid/content/res/ColorStateList;->valueOf(I)Landroid/content/res/ColorStateList;
move-result-object v2
const/4 v3, 0x0
invoke-direct {v1, v2, v3, v0}, Landroid/graphics/drawable/RippleDrawable;-><init>(Landroid/content/res/ColorStateList;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v1}, Landroid/widget/FrameLayout;->setForeground(Landroid/graphics/drawable/Drawable;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Le/f/a/a;->a()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
return-void
2019-07-24 11:27:29 +00:00
.end method
2019-12-06 03:29:40 +00:00
.method public getColor()I
.locals 1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v0, p0, Le/f/a/a;->f:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
return v0
2019-07-24 11:27:29 +00:00
.end method
2019-12-06 03:29:40 +00:00
.method public onClick(Landroid/view/View;)V
.locals 2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-boolean p1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-nez p1, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 p1, 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Le/f/a/a;->setChecked(Z)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-boolean p1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz p1, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object p1, p0, Le/f/a/a;->h:Le/f/a/a$c;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz p1, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
check-cast p1, Le/f/a/b;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p1, Le/f/a/b;->h:Le/f/a/a;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v1, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v0, v1}, Le/f/a/a;->setChecked(Z)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:cond_0
iput-object p0, p1, Le/f/a/b;->h:Le/f/a/a;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Le/f/a/a;->getColor()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput v0, p1, Le/f/a/b;->g:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p1, Le/f/a/b;->i:Lcom/angarron/colorpicker/OnColorSelectedListener;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget p1, p1, Le/f/a/b;->g:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-interface {v0, p1}, Lcom/angarron/colorpicker/OnColorSelectedListener;->a(I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:cond_1
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public setChecked(Z)V
2019-07-24 11:27:29 +00:00
.locals 6
2019-12-06 03:29:40 +00:00
iget-boolean v0, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iput-boolean p1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
const-wide/16 v1, 0xfa
const/4 p1, 0x0
const/4 v3, 0x0
const/high16 v4, 0x3f800000 # 1.0f
if-nez v0, :cond_0
2019-12-06 03:29:40 +00:00
iget-boolean v5, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
if-eqz v5, :cond_0
2019-12-06 03:29:40 +00:00
invoke-direct {p0, v3}, Le/f/a/a;->setItemCheckmarkAttributes(F)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setVisibility(I)V
2019-12-06 03:29:40 +00:00
iget-object p1, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
invoke-virtual {p1}, Landroid/widget/ImageView;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v4}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v4}, Landroid/view/ViewPropertyAnimator;->scaleX(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v4}, Landroid/view/ViewPropertyAnimator;->scaleY(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v1, v2}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object p1
2019-12-06 03:29:40 +00:00
new-instance v0, Le/f/a/a$a;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v0, p0}, Le/f/a/a$a;-><init>(Le/f/a/a;)V
2019-07-24 11:27:29 +00:00
invoke-virtual {p1, v0}, Landroid/view/ViewPropertyAnimator;->setListener(Landroid/animation/Animator$AnimatorListener;)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1}, Landroid/view/ViewPropertyAnimator;->start()V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_0
if-eqz v0, :cond_1
2019-12-06 03:29:40 +00:00
iget-boolean v0, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
if-nez v0, :cond_1
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setVisibility(I)V
2019-12-06 03:29:40 +00:00
invoke-direct {p0, v4}, Le/f/a/a;->setItemCheckmarkAttributes(F)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object p1, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
invoke-virtual {p1}, Landroid/widget/ImageView;->animate()Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v3}, Landroid/view/ViewPropertyAnimator;->alpha(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v3}, Landroid/view/ViewPropertyAnimator;->scaleX(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v3}, Landroid/view/ViewPropertyAnimator;->scaleY(F)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1, v1, v2}, Landroid/view/ViewPropertyAnimator;->setDuration(J)Landroid/view/ViewPropertyAnimator;
move-result-object p1
2019-12-06 03:29:40 +00:00
new-instance v0, Le/f/a/a$b;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v0, p0}, Le/f/a/a$b;-><init>(Le/f/a/a;)V
2019-07-24 11:27:29 +00:00
invoke-virtual {p1, v0}, Landroid/view/ViewPropertyAnimator;->setListener(Landroid/animation/Animator$AnimatorListener;)Landroid/view/ViewPropertyAnimator;
move-result-object p1
invoke-virtual {p1}, Landroid/view/ViewPropertyAnimator;->start()V
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_1
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Le/f/a/a;->d:Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-boolean v1, p0, Le/f/a/a;->g:Z
2019-07-24 11:27:29 +00:00
if-eqz v1, :cond_2
goto :goto_0
:cond_2
const/4 p1, 0x4
:goto_0
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setVisibility(I)V
2019-12-06 03:29:40 +00:00
invoke-direct {p0, v4}, Le/f/a/a;->setItemCheckmarkAttributes(F)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public setOnSelectedListener(Le/f/a/a$c;)V
2019-07-24 11:27:29 +00:00
.locals 0
2019-12-06 03:29:40 +00:00
iput-object p1, p0, Le/f/a/a;->h:Le/f/a/a$c;
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public setOutlineWidth(I)V
2019-07-24 11:27:29 +00:00
.locals 0
2019-12-06 03:29:40 +00:00
iput p1, p0, Le/f/a/a;->e:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Le/f/a/a;->b()V
2019-07-24 11:27:29 +00:00
return-void
.end method