.class public Lcom/moji/mjweather/assshop/view/RoundProgressBar;
.super Landroid/view/View;
.source "RoundProgressBar.java"


# instance fields
.field private a:Landroid/graphics/Paint;

.field private b:I

.field private c:I

.field private d:I

.field private e:F

.field private f:F

.field private g:I

.field private h:I

.field private i:Z

.field private j:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    .line 74
    invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    .line 78
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1

    .line 82
    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 84
    new-instance p3, Landroid/graphics/Paint;

    invoke-direct {p3}, Landroid/graphics/Paint;-><init>()V

    iput-object p3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    .line 87
    sget-object p3, Lcom/moji/mjweather/R$styleable;->WeatherAvatarRoundProgressBar:[I

    invoke-virtual {p1, p2, p3}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object p1

    const/4 p2, 0x1

    const/high16 p3, -0x10000

    .line 91
    invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result p3

    iput p3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->b:I

    const/4 p3, 0x2

    const v0, -0xff0100

    .line 92
    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result p3

    iput p3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->c:I

    const/4 p3, 0x3

    const/high16 v0, 0x40a00000    # 5.0f

    .line 93
    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result p3

    iput p3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->f:F

    const/4 p3, 0x0

    const/16 v0, 0x64

    .line 94
    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getInteger(II)I

    move-result v0

    iput v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    const/4 v0, 0x5

    .line 95
    invoke-virtual {p1, v0, p2}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result p2

    iput-boolean p2, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->i:Z

    const/4 p2, 0x4

    .line 96
    invoke-virtual {p1, p2, p3}, Landroid/content/res/TypedArray;->getInt(II)I

    move-result p2

    iput p2, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->j:I

    .line 98
    invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V

    return-void
.end method


# virtual methods
.method public declared-synchronized getMax()I
    .locals 1

    monitor-enter p0

    .line 166
    :try_start_0
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized getProgress()I
    .locals 1

    monitor-enter p0

    .line 185
    :try_start_0
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public getTextColor()I
    .locals 1

    .line 208
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->d:I

    return v0
.end method

.method public getTextSize()F
    .locals 1

    .line 216
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->e:F

    return v0
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 10

    .line 104
    invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V

    .line 109
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->getWidth()I

    move-result v0

    div-int/lit8 v0, v0, 0x2

    int-to-float v1, v0

    .line 110
    iget v2, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->f:F

    const/high16 v3, 0x40000000    # 2.0f

    div-float/2addr v2, v3

    sub-float v2, v1, v2

    float-to-int v2, v2

    .line 111
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->b:I

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setColor(I)V

    .line 112
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    sget-object v5, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 113
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->f:F

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 114
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    const/4 v5, 0x1

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    int-to-float v4, v2

    .line 115
    iget-object v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v1, v4, v5}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    .line 122
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    const/4 v5, 0x0

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 123
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->d:I

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setColor(I)V

    .line 124
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->e:F

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setTextSize(F)V

    .line 125
    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    sget-object v5, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    .line 126
    iget v4, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I

    int-to-float v4, v4

    iget v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    int-to-float v5, v5

    div-float/2addr v4, v5

    const/high16 v5, 0x42c80000    # 100.0f

    mul-float v4, v4, v5

    float-to-int v4, v4

    .line 127
    iget-object v5, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v7, "%"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v5

    .line 129
    iget-boolean v6, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->i:Z

    if-eqz v6, :cond_0

    if-eqz v4, :cond_0

    iget v6, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->j:I

    if-nez v6, :cond_0

    .line 130
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v4, "%"

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    div-float/2addr v5, v3

    sub-float v5, v1, v5

    iget v6, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->e:F

    div-float/2addr v6, v3

    add-float/2addr v1, v6

    iget-object v3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    invoke-virtual {p1, v4, v5, v1, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 139
    :cond_0
    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->f:F

    invoke-virtual {v1, v3}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 140
    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    iget v3, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->c:I

    invoke-virtual {v1, v3}, Landroid/graphics/Paint;->setColor(I)V

    .line 141
    new-instance v5, Landroid/graphics/RectF;

    sub-int v1, v0, v2

    int-to-float v1, v1

    add-int/2addr v0, v2

    int-to-float v0, v0

    invoke-direct {v5, v1, v1, v0, v0}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 144
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->j:I

    packed-switch v0, :pswitch_data_0

    goto :goto_0

    .line 155
    :pswitch_0
    iget-object v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->FILL_AND_STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 156
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I

    if-eqz v0, :cond_1

    const/4 v6, 0x0

    .line 157
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I

    mul-int/lit16 v0, v0, 0x168

    iget v1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    div-int/2addr v0, v1

    int-to-float v7, v0

    const/4 v8, 0x1

    iget-object v9, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    move-object v4, p1

    invoke-virtual/range {v4 .. v9}, Landroid/graphics/Canvas;->drawArc(Landroid/graphics/RectF;FFZLandroid/graphics/Paint;)V

    goto :goto_0

    .line 146
    :pswitch_1
    iget-object v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 148
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    const/high16 v0, -0x3d4c0000    # -90.0f

    .line 149
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->getWidth()I

    move-result v1

    div-int/lit8 v1, v1, 0x2

    int-to-float v1, v1

    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->getHeight()I

    move-result v2

    div-int/lit8 v2, v2, 0x2

    int-to-float v2, v2

    invoke-virtual {p1, v0, v1, v2}, Landroid/graphics/Canvas;->rotate(FFF)V

    const/4 v6, 0x0

    .line 150
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I

    mul-int/lit16 v0, v0, 0x168

    iget v1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    div-int/2addr v0, v1

    int-to-float v7, v0

    const/4 v8, 0x0

    iget-object v9, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->a:Landroid/graphics/Paint;

    move-object v4, p1

    invoke-virtual/range {v4 .. v9}, Landroid/graphics/Canvas;->drawArc(Landroid/graphics/RectF;FFZLandroid/graphics/Paint;)V

    .line 151
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    :cond_1
    :goto_0
    return-void

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public declared-synchronized setMax(I)V
    .locals 1

    monitor-enter p0

    if-ltz p1, :cond_0

    .line 177
    :try_start_0
    iput p1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 178
    monitor-exit p0

    return-void

    .line 175
    :cond_0
    :try_start_1
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string v0, "max not less than 0"

    invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :catchall_0
    move-exception p1

    .line 173
    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized setProgress(I)V
    .locals 1

    monitor-enter p0

    if-gez p1, :cond_0

    const/4 p1, 0x0

    .line 197
    :cond_0
    :try_start_0
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    if-le p1, v0, :cond_1

    .line 198
    iget p1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    .line 200
    :cond_1
    iget v0, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->g:I

    if-gt p1, v0, :cond_2

    .line 201
    iput p1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->h:I

    .line 202
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->postInvalidate()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 205
    :cond_2
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    .line 193
    monitor-exit p0

    throw p1
.end method

.method public setTextColor(I)V
    .locals 0

    .line 212
    iput p1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->d:I

    return-void
.end method

.method public setTextSize(F)V
    .locals 0

    .line 220
    iput p1, p0, Lcom/moji/mjweather/assshop/view/RoundProgressBar;->e:F

    return-void
.end method
