.class public Lcom/moji/mjweather/weather/view/UpperIndicator;
.super Landroid/view/View;
.source "UpperIndicator.java"

# interfaces
.implements Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView$OnScrollListener;


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

.field private b:I

.field private c:I

.field private d:I

.field private e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

.field private f:I


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

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

    .line 19
    new-instance p1, Landroid/graphics/Paint;

    const/4 p2, 0x1

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

    iput-object p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

    .line 37
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->a()V

    return-void
.end method

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

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

    .line 19
    new-instance p1, Landroid/graphics/Paint;

    const/4 p2, 0x1

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

    iput-object p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

    .line 42
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->a()V

    return-void
.end method

.method private a(FFF)F
    .locals 1

    cmpg-float v0, p3, p1

    if-gez v0, :cond_0

    goto :goto_0

    :cond_0
    cmpl-float p1, p3, p2

    if-lez p1, :cond_1

    move p1, p2

    goto :goto_0

    :cond_1
    move p1, p3

    :goto_0
    return p1
.end method

.method private a(F)I
    .locals 1

    .line 129
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->density:F

    mul-float p1, p1, v0

    const/high16 v0, 0x3f000000    # 0.5f

    add-float/2addr p1, v0

    float-to-int p1, p1

    return p1
.end method

.method private a()V
    .locals 2

    .line 46
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->isInEditMode()Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    :cond_0
    const/high16 v0, 0x42c80000    # 100.0f

    .line 48
    invoke-direct {p0, v0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->a(F)I

    move-result v0

    iput v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->d:I

    .line 49
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

    const v1, 0x66ffffff

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

    .line 50
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

    const/16 v1, 0x80

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

    return-void
.end method

.method static synthetic a(Lcom/moji/mjweather/weather/view/UpperIndicator;)V
    .locals 0

    .line 17
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getScrollMax()V

    return-void
.end method

.method private getScrollMax()V
    .locals 2

    .line 99
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    if-nez v0, :cond_0

    return-void

    .line 102
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    invoke-virtual {v0}, Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;->getChildCount()I

    move-result v0

    if-lez v0, :cond_1

    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 103
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/View;->getWidth()I

    move-result v0

    invoke-static {}, Lcom/moji/tool/DeviceTool;->b()I

    move-result v1

    sub-int/2addr v0, v1

    iput v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->c:I

    .line 105
    :cond_1
    iget v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->c:I

    if-lez v0, :cond_2

    .line 106
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->postInvalidate()V

    :cond_2
    return-void
.end method


# virtual methods
.method public a(IIIIB)V
    .locals 0

    .line 124
    iput p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->b:I

    .line 125
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->invalidate()V

    return-void
.end method

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

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

    .line 57
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    if-nez v0, :cond_0

    return-void

    .line 60
    :cond_0
    iget v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->c:I

    if-gtz v0, :cond_1

    .line 61
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getScrollMax()V

    return-void

    .line 65
    :cond_1
    iget v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->b:I

    int-to-float v0, v0

    const/high16 v1, 0x3f800000    # 1.0f

    iget v2, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->c:I

    int-to-float v2, v2

    mul-float v2, v2, v1

    div-float/2addr v0, v2

    const/4 v1, 0x0

    .line 66
    iget v2, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->f:I

    int-to-float v2, v2

    iget v3, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->f:I

    int-to-float v3, v3

    mul-float v3, v3, v0

    invoke-direct {p0, v1, v2, v3}, Lcom/moji/mjweather/weather/view/UpperIndicator;->a(FFF)F

    move-result v5

    .line 67
    iget v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->d:I

    int-to-float v0, v0

    add-float v7, v5, v0

    .line 69
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getHeight()I

    move-result v0

    int-to-float v8, v0

    const/4 v6, 0x0

    .line 70
    iget-object v9, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

    move-object v4, p1

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

    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 0

    .line 112
    invoke-super {p0, p1, p2, p3, p4}, Landroid/view/View;->onSizeChanged(IIII)V

    .line 113
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getWidth()I

    move-result p1

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getPaddingLeft()I

    move-result p2

    sub-int/2addr p1, p2

    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getPaddingRight()I

    move-result p2

    sub-int/2addr p1, p2

    iget p2, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->d:I

    sub-int/2addr p1, p2

    iput p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->f:I

    .line 114
    new-instance p1, Lcom/moji/mjweather/weather/view/UpperIndicator$1;

    invoke-direct {p1, p0}, Lcom/moji/mjweather/weather/view/UpperIndicator$1;-><init>(Lcom/moji/mjweather/weather/view/UpperIndicator;)V

    invoke-virtual {p0, p1}, Lcom/moji/mjweather/weather/view/UpperIndicator;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public setColor(I)V
    .locals 1

    .line 94
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->a:Landroid/graphics/Paint;

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

    .line 95
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->invalidate()V

    return-void
.end method

.method public setScrollView(Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;)V
    .locals 2

    .line 78
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    if-ne v0, p1, :cond_0

    return-void

    .line 81
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    if-eqz v0, :cond_1

    .line 82
    iget-object v0, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;->setOnScrollListener(Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView$OnScrollListener;)V

    .line 84
    :cond_1
    iput-object p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    .line 85
    iget-object p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    if-nez p1, :cond_2

    return-void

    .line 88
    :cond_2
    invoke-direct {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->getScrollMax()V

    .line 89
    iget-object p1, p0, Lcom/moji/mjweather/weather/view/UpperIndicator;->e:Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;

    invoke-virtual {p1, p0}, Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView;->setOnScrollListener(Lcom/moji/mjweather/weather/view/Day15Hour24HorizontalScrollView$OnScrollListener;)V

    .line 90
    invoke-virtual {p0}, Lcom/moji/mjweather/weather/view/UpperIndicator;->invalidate()V

    return-void
.end method
