apkfuckery/com.discord/smali/f/f/a/a.smali
2020-05-11 21:22:21 +02:00

507 lines
11 KiB
Smali

.class public Lf/f/a/a;
.super Landroid/widget/FrameLayout;
.source "ColorItem.java"
# interfaces
.implements Landroid/view/View$OnClickListener;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lf/f/a/a$c;
}
.end annotation
# instance fields
.field public d:Landroid/widget/ImageView;
.field public e:I
.field public f:I
.annotation build Landroidx/annotation/ColorInt;
.end annotation
.end field
.field public g:Z
.field public h:Lf/f/a/a$c;
# direct methods
.method public constructor <init>(Landroid/content/Context;IZ)V
.locals 0
.param p2 # I
.annotation build Landroidx/annotation/ColorInt;
.end annotation
.end param
invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
const/4 p1, 0x0
iput p1, p0, Lf/f/a/a;->e:I
iput-boolean p1, p0, Lf/f/a/a;->g:Z
iput p2, p0, Lf/f/a/a;->f:I
iput-boolean p3, p0, Lf/f/a/a;->g:Z
invoke-virtual {p0}, Lf/f/a/a;->b()V
invoke-virtual {p0, p0}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
invoke-virtual {p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
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
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
move-result-object p1
check-cast p1, Landroid/widget/ImageView;
iput-object p1, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
iget-object p1, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
iget p2, p0, Lf/f/a/a;->f:I
invoke-static {p2}, Lf/f/a/a;->b(I)Z
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
iget-boolean p1, p0, Lf/f/a/a;->g:Z
invoke-virtual {p0, p1}, Lf/f/a/a;->setChecked(Z)V
return-void
.end method
.method public static a(I)I
.locals 3
.annotation build Landroidx/annotation/ColorInt;
.end annotation
const/4 v0, 0x3
new-array v0, v0, [F
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
aput v1, v0, p0
invoke-static {v0}, Landroid/graphics/Color;->HSVToColor([F)I
move-result p0
return p0
.end method
.method public static synthetic a(Lf/f/a/a;F)V
.locals 0
invoke-direct {p0, p1}, Lf/f/a/a;->setItemCheckmarkAttributes(F)V
return-void
.end method
.method public static b(I)Z
.locals 6
invoke-static {p0}, Landroid/graphics/Color;->red(I)I
move-result v0
int-to-double v0, v0
const-wide v2, 0x3fd322d0e5604189L # 0.299
mul-double v0, v0, v2
invoke-static {p0}, Landroid/graphics/Color;->green(I)I
move-result v2
int-to-double v2, v2
const-wide v4, 0x3fe2c8b439581062L # 0.587
mul-double v2, v2, v4
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
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
.method private setItemCheckmarkAttributes(F)V
.locals 1
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setAlpha(F)V
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setScaleX(F)V
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setScaleY(F)V
return-void
.end method
# virtual methods
.method public final a()Landroid/graphics/drawable/Drawable;
.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
iget v1, p0, Lf/f/a/a;->e:I
if-eqz v1, :cond_1
iget v2, p0, Lf/f/a/a;->f:I
invoke-static {v2}, Lf/f/a/a;->b(I)Z
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
iget v1, p0, Lf/f/a/a;->f:I
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setColor(I)V
return-object v0
.end method
.method public final b()V
.locals 4
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
const/4 v1, 0x1
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;
iget v2, p0, Lf/f/a/a;->f:I
invoke-static {v2}, Lf/f/a/a;->a(I)I
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
invoke-virtual {p0, v1}, Landroid/widget/FrameLayout;->setForeground(Landroid/graphics/drawable/Drawable;)V
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
invoke-virtual {p0}, Lf/f/a/a;->a()Landroid/graphics/drawable/Drawable;
move-result-object v0
invoke-virtual {p0, v0}, Landroid/widget/FrameLayout;->setBackground(Landroid/graphics/drawable/Drawable;)V
return-void
.end method
.method public getColor()I
.locals 1
iget v0, p0, Lf/f/a/a;->f:I
return v0
.end method
.method public onClick(Landroid/view/View;)V
.locals 2
iget-boolean p1, p0, Lf/f/a/a;->g:Z
if-nez p1, :cond_1
const/4 p1, 0x1
invoke-virtual {p0, p1}, Lf/f/a/a;->setChecked(Z)V
iget-boolean p1, p0, Lf/f/a/a;->g:Z
if-eqz p1, :cond_1
iget-object p1, p0, Lf/f/a/a;->h:Lf/f/a/a$c;
if-eqz p1, :cond_1
check-cast p1, Lf/f/a/b;
iget-object v0, p1, Lf/f/a/b;->h:Lf/f/a/a;
if-eqz v0, :cond_0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lf/f/a/a;->setChecked(Z)V
:cond_0
iput-object p0, p1, Lf/f/a/b;->h:Lf/f/a/a;
invoke-virtual {p0}, Lf/f/a/a;->getColor()I
move-result v0
iput v0, p1, Lf/f/a/b;->g:I
iget-object v0, p1, Lf/f/a/b;->i:Lcom/angarron/colorpicker/OnColorSelectedListener;
if-eqz v0, :cond_1
iget p1, p1, Lf/f/a/b;->g:I
invoke-interface {v0, p1}, Lcom/angarron/colorpicker/OnColorSelectedListener;->a(I)V
:cond_1
return-void
.end method
.method public setChecked(Z)V
.locals 6
iget-boolean v0, p0, Lf/f/a/a;->g:Z
iput-boolean p1, p0, Lf/f/a/a;->g:Z
const-wide/16 v1, 0xfa
const/4 p1, 0x0
const/4 v3, 0x0
const/high16 v4, 0x3f800000 # 1.0f
if-nez v0, :cond_0
iget-boolean v5, p0, Lf/f/a/a;->g:Z
if-eqz v5, :cond_0
invoke-direct {p0, v3}, Lf/f/a/a;->setItemCheckmarkAttributes(F)V
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setVisibility(I)V
iget-object p1, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
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
new-instance v0, Lf/f/a/a$a;
invoke-direct {v0, p0}, Lf/f/a/a$a;-><init>(Lf/f/a/a;)V
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
goto :goto_1
:cond_0
if-eqz v0, :cond_1
iget-boolean v0, p0, Lf/f/a/a;->g:Z
if-nez v0, :cond_1
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setVisibility(I)V
invoke-direct {p0, v4}, Lf/f/a/a;->setItemCheckmarkAttributes(F)V
iget-object p1, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
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
new-instance v0, Lf/f/a/a$b;
invoke-direct {v0, p0}, Lf/f/a/a$b;-><init>(Lf/f/a/a;)V
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
goto :goto_1
:cond_1
iget-object v0, p0, Lf/f/a/a;->d:Landroid/widget/ImageView;
iget-boolean v1, p0, Lf/f/a/a;->g:Z
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
invoke-direct {p0, v4}, Lf/f/a/a;->setItemCheckmarkAttributes(F)V
:goto_1
return-void
.end method
.method public setOnSelectedListener(Lf/f/a/a$c;)V
.locals 0
iput-object p1, p0, Lf/f/a/a;->h:Lf/f/a/a$c;
return-void
.end method
.method public setOutlineWidth(I)V
.locals 0
iput p1, p0, Lf/f/a/a;->e:I
invoke-virtual {p0}, Lf/f/a/a;->b()V
return-void
.end method