359 lines
8.7 KiB
Smali
359 lines
8.7 KiB
Smali
.class public Lcom/moji/mjweather/weather/view/LinearProgress;
|
|
.super Landroid/view/View;
|
|
.source "LinearProgress.java"
|
|
|
|
|
|
# instance fields
|
|
.field private a:F
|
|
|
|
.field private b:F
|
|
|
|
.field private c:I
|
|
|
|
.field private d:I
|
|
|
|
.field private e:I
|
|
|
|
.field private f:I
|
|
|
|
.field private g:I
|
|
|
|
.field private h:Landroid/graphics/RectF;
|
|
|
|
.field private i:Landroid/graphics/Paint;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 33
|
|
invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
.line 22
|
|
iput v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->a:F
|
|
|
|
.line 23
|
|
iput v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->b:F
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 24
|
|
iput v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
const v0, -0xff0100
|
|
|
|
.line 27
|
|
iput v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->f:I
|
|
|
|
.line 34
|
|
invoke-direct {p0, p1}, Lcom/moji/mjweather/weather/view/LinearProgress;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
.line 38
|
|
invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
const/high16 p2, 0x3f800000 # 1.0f
|
|
|
|
.line 22
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->a:F
|
|
|
|
.line 23
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->b:F
|
|
|
|
const/4 p2, 0x0
|
|
|
|
.line 24
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
const p2, -0xff0100
|
|
|
|
.line 27
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->f:I
|
|
|
|
.line 39
|
|
invoke-direct {p0, p1}, Lcom/moji/mjweather/weather/view/LinearProgress;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 43
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
const/high16 p2, 0x3f800000 # 1.0f
|
|
|
|
.line 22
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->a:F
|
|
|
|
.line 23
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->b:F
|
|
|
|
const/4 p2, 0x0
|
|
|
|
.line 24
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
const p2, -0xff0100
|
|
|
|
.line 27
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->f:I
|
|
|
|
.line 44
|
|
invoke-direct {p0, p1}, Lcom/moji/mjweather/weather/view/LinearProgress;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/content/Context;F)I
|
|
.locals 0
|
|
|
|
.line 129
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p1
|
|
|
|
iget p1, p1, Landroid/util/DisplayMetrics;->density:F
|
|
|
|
mul-float p2, p2, p1
|
|
|
|
const/high16 p1, 0x3f000000 # 0.5f
|
|
|
|
add-float/2addr p2, p1
|
|
|
|
float-to-int p1, p2
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private a(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
const/high16 v0, 0x40000000 # 2.0f
|
|
|
|
.line 48
|
|
invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/weather/view/LinearProgress;->a(Landroid/content/Context;F)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->g:I
|
|
|
|
.line 49
|
|
new-instance p1, Landroid/graphics/Paint;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p1, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
.line 50
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
iget v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->f:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
.line 51
|
|
iget-object p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
sget-object v0, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V
|
|
|
|
.line 52
|
|
new-instance p1, Landroid/graphics/RectF;
|
|
|
|
invoke-direct {p1}, Landroid/graphics/RectF;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->h:Landroid/graphics/RectF;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(IF)V
|
|
.locals 0
|
|
|
|
.line 69
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/weather/view/LinearProgress;->setColor(I)V
|
|
|
|
.line 70
|
|
invoke-virtual {p0, p2}, Lcom/moji/mjweather/weather/view/LinearProgress;->setProgress(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onDraw(Landroid/graphics/Canvas;)V
|
|
.locals 5
|
|
|
|
.line 115
|
|
invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
.line 117
|
|
iget v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 118
|
|
iget v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->d:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
.line 119
|
|
iget-object v2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->h:Landroid/graphics/RectF;
|
|
|
|
iget v3, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->e:I
|
|
|
|
int-to-float v3, v3
|
|
|
|
invoke-virtual {v2, v1, v1, v0, v3}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
.line 120
|
|
iget-object v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->h:Landroid/graphics/RectF;
|
|
|
|
iget v1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->g:I
|
|
|
|
int-to-float v1, v1
|
|
|
|
iget v2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->g:I
|
|
|
|
int-to-float v2, v2
|
|
|
|
iget-object v3, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 122
|
|
:cond_0
|
|
iget v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->e:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
.line 123
|
|
iget-object v2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->h:Landroid/graphics/RectF;
|
|
|
|
iget v3, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->d:I
|
|
|
|
int-to-float v3, v3
|
|
|
|
iget v4, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->e:I
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-virtual {v2, v1, v0, v3, v4}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
.line 124
|
|
iget-object v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->h:Landroid/graphics/RectF;
|
|
|
|
iget v1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->g:I
|
|
|
|
int-to-float v1, v1
|
|
|
|
iget v2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->g:I
|
|
|
|
int-to-float v2, v2
|
|
|
|
iget-object v3, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onSizeChanged(IIII)V
|
|
.locals 0
|
|
|
|
.line 108
|
|
invoke-super {p0, p1, p2, p3, p4}, Landroid/view/View;->onSizeChanged(IIII)V
|
|
|
|
.line 109
|
|
iput p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->d:I
|
|
|
|
.line 110
|
|
iput p2, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->e:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setColor(I)V
|
|
.locals 1
|
|
|
|
.line 74
|
|
iput p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->f:I
|
|
|
|
.line 75
|
|
iget-object v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->i:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
.line 76
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/LinearProgress;->postInvalidate()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setMaxProgress(F)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setOrientation(I)V
|
|
.locals 1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 99
|
|
iput p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
if-ne p1, v0, :cond_1
|
|
|
|
.line 101
|
|
iput v0, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->c:I
|
|
|
|
.line 103
|
|
:cond_1
|
|
:goto_0
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/LinearProgress;->postInvalidate()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setProgress(F)V
|
|
.locals 0
|
|
|
|
const/high16 p1, 0x3f800000 # 1.0f
|
|
|
|
.line 65
|
|
iput p1, p0, Lcom/moji/mjweather/weather/view/LinearProgress;->a:F
|
|
|
|
return-void
|
|
.end method
|