MryRoundButtonDrawable.smali

.class public Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;
.super Landroid/graphics/drawable/GradientDrawable;
.source "MryRoundButtonDrawable.java"


# instance fields
.field private mFillColors:Landroid/content/res/ColorStateList;

.field private mRadiusAdjustBounds:Z

.field private mStrokeColors:Landroid/content/res/ColorStateList;

.field private mStrokeWidth:I


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>()V
    .registers 2

    .line 41
    invoke-direct {p0}, Landroid/graphics/drawable/GradientDrawable;-><init>()V

    .line 46
    const/4 v0, 0x1

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mRadiusAdjustBounds:Z

    .line 48
    const/4 v0, 0x0

    iput v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeWidth:I

    return-void
.end method

.method public static fromAttributeSet(Landroid/content/Context;Landroid/util/AttributeSet;I)Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;
    .registers 21
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "attrs"    # Landroid/util/AttributeSet;
    .param p2, "defStyleAttr"    # I

    .line 147
    sget-object v0, Lim/tpelyyftgw/messenger/R$styleable;->MryRoundButton:[I

    const/4 v1, 0x0

    move-object/from16 v2, p0

    move-object/from16 v3, p1

    move/from16 v4, p2

    invoke-virtual {v2, v3, v0, v4, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 148
    .local v0, "typedArray":Landroid/content/res/TypedArray;
    invoke-virtual {v0, v1}, Landroid/content/res/TypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;

    move-result-object v5

    .line 149
    .local v5, "colorBg":Landroid/content/res/ColorStateList;
    const/4 v6, 0x1

    invoke-virtual {v0, v6}, Landroid/content/res/TypedArray;->getColorStateList(I)Landroid/content/res/ColorStateList;

    move-result-object v7

    .line 150
    .local v7, "colorBorder":Landroid/content/res/ColorStateList;
    const/4 v8, 0x2

    invoke-virtual {v0, v8, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v9

    .line 151
    .local v9, "borderWidth":I
    const/4 v10, 0x4

    invoke-virtual {v0, v10, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v11

    .line 152
    .local v11, "isRadiusAdjustBounds":Z
    const/4 v12, 0x5

    invoke-virtual {v0, v12, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v13

    .line 153
    .local v13, "mRadius":I
    const/16 v14, 0x8

    invoke-virtual {v0, v14, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v15

    .line 154
    .local v15, "mRadiusTopLeft":I
    const/16 v12, 0x9

    invoke-virtual {v0, v12, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v12

    .line 155
    .local v12, "mRadiusTopRight":I
    const/4 v10, 0x6

    invoke-virtual {v0, v10, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v8

    .line 156
    .local v8, "mRadiusBottomLeft":I
    const/4 v10, 0x7

    invoke-virtual {v0, v10, v1}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v6

    .line 157
    .local v6, "mRadiusBottomRight":I
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 159
    new-instance v16, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;

    invoke-direct/range {v16 .. v16}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;-><init>()V

    move-object/from16 v17, v16

    .line 160
    .local v17, "bg":Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;
    move-object/from16 v10, v17

    .end local v17    # "bg":Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;
    .local v10, "bg":Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;
    invoke-virtual {v10, v5}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setBgData(Landroid/content/res/ColorStateList;)V

    .line 161
    invoke-virtual {v10, v9, v7}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setStrokeData(ILandroid/content/res/ColorStateList;)V

    .line 162
    if-gtz v15, :cond_63

    if-gtz v12, :cond_63

    if-gtz v8, :cond_63

    if-lez v6, :cond_56

    goto :goto_63

    .line 172
    :cond_56
    int-to-float v1, v13

    invoke-virtual {v10, v1}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setCornerRadius(F)V

    .line 173
    if-lez v13, :cond_60

    .line 174
    const/4 v11, 0x0

    move-object/from16 v17, v0

    goto :goto_8c

    .line 173
    :cond_60
    move-object/from16 v17, v0

    goto :goto_8c

    .line 163
    :cond_63
    :goto_63
    new-array v14, v14, [F

    move-object/from16 v17, v0

    .end local v0    # "typedArray":Landroid/content/res/TypedArray;
    .local v17, "typedArray":Landroid/content/res/TypedArray;
    int-to-float v0, v15

    aput v0, v14, v1

    int-to-float v0, v15

    const/4 v1, 0x1

    aput v0, v14, v1

    int-to-float v0, v12

    const/4 v1, 0x2

    aput v0, v14, v1

    const/4 v0, 0x3

    int-to-float v1, v12

    aput v1, v14, v0

    int-to-float v0, v6

    const/4 v1, 0x4

    aput v0, v14, v1

    int-to-float v0, v6

    const/4 v1, 0x5

    aput v0, v14, v1

    int-to-float v0, v8

    const/4 v1, 0x6

    aput v0, v14, v1

    int-to-float v0, v8

    const/4 v1, 0x7

    aput v0, v14, v1

    move-object v0, v14

    .line 169
    .local v0, "radii":[F
    invoke-virtual {v10, v0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setCornerRadii([F)V

    .line 170
    const/4 v11, 0x0

    .line 171
    .end local v0    # "radii":[F
    nop

    .line 177
    :goto_8c
    invoke-virtual {v10, v11}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setIsRadiusAdjustBounds(Z)V

    .line 178
    return-object v10
.end method

.method private hasNativeStateListAPI()Z
    .registers 3

    .line 104
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x15

    if-lt v0, v1, :cond_8

    const/4 v0, 0x1

    goto :goto_9

    :cond_8
    const/4 v0, 0x0

    :goto_9
    return v0
.end method


# virtual methods
.method public getStrokeWidth()I
    .registers 2

    .line 89
    iget v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeWidth:I

    return v0
.end method

.method public isStateful()Z
    .registers 2

    .line 132
    iget-object v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mFillColors:Landroid/content/res/ColorStateList;

    if-eqz v0, :cond_a

    invoke-virtual {v0}, Landroid/content/res/ColorStateList;->isStateful()Z

    move-result v0

    if-nez v0, :cond_1a

    :cond_a
    iget-object v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeColors:Landroid/content/res/ColorStateList;

    if-eqz v0, :cond_14

    .line 133
    invoke-virtual {v0}, Landroid/content/res/ColorStateList;->isStateful()Z

    move-result v0

    if-nez v0, :cond_1a

    .line 134
    :cond_14
    invoke-super {p0}, Landroid/graphics/drawable/GradientDrawable;->isStateful()Z

    move-result v0

    if-eqz v0, :cond_1c

    :cond_1a
    const/4 v0, 0x1

    goto :goto_1d

    :cond_1c
    const/4 v0, 0x0

    .line 132
    :goto_1d
    return v0
.end method

.method protected onBoundsChange(Landroid/graphics/Rect;)V
    .registers 4
    .param p1, "r"    # Landroid/graphics/Rect;

    .line 139
    invoke-super {p0, p1}, Landroid/graphics/drawable/GradientDrawable;->onBoundsChange(Landroid/graphics/Rect;)V

    .line 140
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mRadiusAdjustBounds:Z

    if-eqz v0, :cond_19

    .line 142
    invoke-virtual {p1}, Landroid/graphics/Rect;->width()I

    move-result v0

    invoke-virtual {p1}, Landroid/graphics/Rect;->height()I

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result v0

    div-int/lit8 v0, v0, 0x2

    int-to-float v0, v0

    invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setCornerRadius(F)V

    .line 144
    :cond_19
    return-void
.end method

.method protected onStateChange([I)Z
    .registers 5
    .param p1, "stateSet"    # [I

    .line 116
    invoke-super {p0, p1}, Landroid/graphics/drawable/GradientDrawable;->onStateChange([I)Z

    move-result v0

    .line 117
    .local v0, "superRet":Z
    iget-object v1, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mFillColors:Landroid/content/res/ColorStateList;

    const/4 v2, 0x0

    if-eqz v1, :cond_11

    .line 118
    invoke-virtual {v1, p1, v2}, Landroid/content/res/ColorStateList;->getColorForState([II)I

    move-result v1

    .line 119
    .local v1, "color":I
    invoke-virtual {p0, v1}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setColor(I)V

    .line 120
    const/4 v0, 0x1

    .line 122
    .end local v1    # "color":I
    :cond_11
    iget-object v1, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeColors:Landroid/content/res/ColorStateList;

    if-eqz v1, :cond_1f

    .line 123
    invoke-virtual {v1, p1, v2}, Landroid/content/res/ColorStateList;->getColorForState([II)I

    move-result v1

    .line 124
    .restart local v1    # "color":I
    iget v2, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeWidth:I

    invoke-virtual {p0, v2, v1}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setStroke(II)V

    .line 125
    const/4 v0, 0x1

    .line 127
    .end local v1    # "color":I
    :cond_1f
    return v0
.end method

.method public setBgData(Landroid/content/res/ColorStateList;)V
    .registers 4
    .param p1, "colors"    # Landroid/content/res/ColorStateList;

    .line 55
    invoke-direct {p0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->hasNativeStateListAPI()Z

    move-result v0

    if-eqz v0, :cond_a

    .line 56
    invoke-super {p0, p1}, Landroid/graphics/drawable/GradientDrawable;->setColor(Landroid/content/res/ColorStateList;)V

    goto :goto_1c

    .line 58
    :cond_a
    iput-object p1, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mFillColors:Landroid/content/res/ColorStateList;

    .line 60
    if-nez p1, :cond_10

    .line 61
    const/4 v0, 0x0

    .local v0, "currentColor":I
    goto :goto_19

    .line 63
    .end local v0    # "currentColor":I
    :cond_10
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->getState()[I

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/content/res/ColorStateList;->getColorForState([II)I

    move-result v0

    .line 65
    .restart local v0    # "currentColor":I
    :goto_19
    invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setColor(I)V

    .line 67
    .end local v0    # "currentColor":I
    :goto_1c
    return-void
.end method

.method public setIsRadiusAdjustBounds(Z)V
    .registers 2
    .param p1, "isRadiusAdjustBounds"    # Z

    .line 111
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mRadiusAdjustBounds:Z

    .line 112
    return-void
.end method

.method public setStrokeColors(Landroid/content/res/ColorStateList;)V
    .registers 3
    .param p1, "colors"    # Landroid/content/res/ColorStateList;

    .line 100
    iget v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeWidth:I

    invoke-virtual {p0, v0, p1}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setStrokeData(ILandroid/content/res/ColorStateList;)V

    .line 101
    return-void
.end method

.method public setStrokeData(ILandroid/content/res/ColorStateList;)V
    .registers 5
    .param p1, "width"    # I
    .param p2, "colors"    # Landroid/content/res/ColorStateList;

    .line 73
    iput p1, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeWidth:I

    .line 74
    iput-object p2, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeColors:Landroid/content/res/ColorStateList;

    .line 75
    invoke-direct {p0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->hasNativeStateListAPI()Z

    move-result v0

    if-eqz v0, :cond_e

    .line 76
    invoke-super {p0, p1, p2}, Landroid/graphics/drawable/GradientDrawable;->setStroke(ILandroid/content/res/ColorStateList;)V

    goto :goto_1e

    .line 79
    :cond_e
    if-nez p2, :cond_12

    .line 80
    const/4 v0, 0x0

    .local v0, "currentColor":I
    goto :goto_1b

    .line 82
    .end local v0    # "currentColor":I
    :cond_12
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->getState()[I

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p2, v0, v1}, Landroid/content/res/ColorStateList;->getColorForState([II)I

    move-result v0

    .line 84
    .restart local v0    # "currentColor":I
    :goto_1b
    invoke-virtual {p0, p1, v0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setStroke(II)V

    .line 86
    .end local v0    # "currentColor":I
    :goto_1e
    return-void
.end method

.method public setStrokeWidth(I)V
    .registers 3
    .param p1, "width"    # I

    .line 96
    iget-object v0, p0, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->mStrokeColors:Landroid/content/res/ColorStateList;

    invoke-virtual {p0, p1, v0}, Lim/tpelyyftgw/ui/hviews/MryRoundButtonDrawable;->setStrokeData(ILandroid/content/res/ColorStateList;)V

    .line 97
    return-void
.end method