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


# instance fields
.field private a:I

.field private b:I

.field private c:Landroid/graphics/Bitmap;

.field private d:Landroid/graphics/Bitmap;

.field private e:I

.field private f:I

.field private g:Landroid/graphics/Paint;

.field private h:F

.field private i:I


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

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

    const/4 v0, 0x0

    .line 19
    iput v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b:I

    const/4 v0, 0x0

    .line 20
    iput-object v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c:Landroid/graphics/Bitmap;

    .line 21
    iput-object v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    .line 30
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a(Landroid/content/Context;)V

    return-void
.end method

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

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

    const/4 p2, 0x0

    .line 19
    iput p2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b:I

    const/4 p2, 0x0

    .line 20
    iput-object p2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c:Landroid/graphics/Bitmap;

    .line 21
    iput-object p2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    .line 35
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a(Landroid/content/Context;)V

    return-void
.end method

.method private a(I)V
    .locals 7

    .line 67
    rem-int/lit8 v0, p1, 0x2

    .line 68
    div-int/lit8 v1, p1, 0x2

    .line 70
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    const/4 v3, 0x0

    if-eqz v2, :cond_0

    .line 71
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    goto :goto_0

    :cond_0
    const/4 v2, 0x0

    .line 74
    :goto_0
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v4

    .line 75
    iget v5, v4, Landroid/view/ViewGroup$LayoutParams;->width:I

    const/4 v6, -0x2

    if-eq v5, v6, :cond_3

    if-lez v5, :cond_1

    goto :goto_2

    .line 84
    :cond_1
    iget p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->i:I

    div-int/lit8 p1, p1, 0x2

    if-nez v0, :cond_2

    .line 87
    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    add-int/2addr v2, v0

    mul-int v1, v1, v2

    sub-int/2addr p1, v1

    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    div-int/lit8 v0, v0, 0x2

    add-int/2addr p1, v0

    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->e:I

    goto :goto_1

    .line 89
    :cond_2
    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    add-int/2addr v0, v2

    mul-int v1, v1, v0

    sub-int/2addr p1, v1

    div-int/lit8 v2, v2, 0x2

    sub-int/2addr p1, v2

    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->e:I

    :goto_1
    return-void

    .line 77
    :cond_3
    :goto_2
    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a:I

    if-eq v0, p1, :cond_4

    add-int/lit8 v0, p1, -0x1

    .line 78
    iget v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    mul-int v0, v0, v1

    mul-int p1, p1, v2

    add-int/2addr v0, p1

    iput v0, v4, Landroid/view/ViewGroup$LayoutParams;->width:I

    .line 79
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->requestLayout()V

    .line 81
    :cond_4
    iput v3, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->e:I

    return-void
.end method

.method private a(Landroid/content/Context;)V
    .locals 1

    .line 39
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c(Landroid/content/Context;)I

    move-result v0

    iput v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->i:I

    .line 40
    new-instance v0, Landroid/graphics/Paint;

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

    iput-object v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->g:Landroid/graphics/Paint;

    .line 41
    iget-object v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    if-nez v0, :cond_0

    .line 42
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b(Landroid/content/Context;)F

    move-result p1

    const/high16 v0, 0x41200000    # 10.0f

    mul-float p1, p1, v0

    float-to-int p1, p1

    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    .line 43
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v0, 0x7f080111

    invoke-static {p1, v0}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    .line 44
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v0, 0x7f080112

    invoke-static {p1, v0}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c:Landroid/graphics/Bitmap;

    :cond_0
    return-void
.end method

.method private b(Landroid/content/Context;)F
    .locals 0

    .line 112
    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

    return p1
.end method

.method private c(Landroid/content/Context;)I
    .locals 0

    .line 115
    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;->widthPixels:I

    return p1
.end method


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

    .line 49
    iput p2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b:I

    .line 50
    invoke-virtual {p0, p1, p2}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b(II)V

    return-void
.end method

.method public b(II)V
    .locals 0

    .line 94
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a(I)V

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

    .line 96
    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a:I

    .line 97
    iput p2, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b:I

    return-void
.end method

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

    const/4 v0, 0x0

    .line 55
    :goto_0
    iget v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->a:I

    if-ge v0, v1, :cond_2

    .line 56
    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    if-eqz v1, :cond_1

    .line 57
    iget v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->b:I

    const/4 v2, 0x0

    if-ne v0, v1, :cond_0

    .line 58
    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->c:Landroid/graphics/Bitmap;

    iget v3, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->e:I

    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    iget v5, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    add-int/2addr v4, v5

    mul-int v4, v4, v0

    add-int/2addr v3, v4

    int-to-float v3, v3

    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->g:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v3, v2, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    goto :goto_1

    .line 60
    :cond_0
    iget-object v1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    iget v3, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->e:I

    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->d:Landroid/graphics/Bitmap;

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    iget v5, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->f:I

    add-int/2addr v4, v5

    mul-int v4, v4, v0

    add-int/2addr v3, v4

    int-to-float v3, v3

    iget-object v4, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->g:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v3, v2, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    :cond_1
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_2
    return-void
.end method

.method public setAlpha(F)V
    .locals 2

    .line 101
    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->h:F

    cmpl-float v0, v0, p1

    if-eqz v0, :cond_0

    .line 102
    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->h:F

    .line 103
    iget-object p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->g:Landroid/graphics/Paint;

    iget v0, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->h:F

    const/high16 v1, 0x437f0000    # 255.0f

    mul-float v0, v0, v1

    float-to-int v0, v0

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

    .line 104
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->invalidate()V

    :cond_0
    return-void
.end method

.method public setViewWidth(I)V
    .locals 0

    .line 109
    iput p1, p0, Lcom/moji/mjweather/assshop/view/AssistIndexControlView;->i:I

    return-void
.end method
