.class public Lcom/moji/mjweather/aqi/AqiPreviewHelper;
.super Ljava/lang/Object;
.source "AqiPreviewHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;,
        Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;
    }
.end annotation


# instance fields
.field private a:Landroid/content/Context;

.field private b:F

.field private c:F

.field private d:F

.field private e:I


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

    .line 40
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/high16 v0, 0x3f000000    # 0.5f

    .line 35
    iput v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b:F

    const/4 v1, 0x0

    .line 36
    iput v1, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->c:F

    .line 37
    iput v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->d:F

    const-string v0, "#80000000"

    .line 38
    invoke-static {v0}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->e:I

    .line 41
    iput-object p1, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a:Landroid/content/Context;

    return-void
.end method

.method private a()Landroid/content/res/Resources;
    .locals 1

    .line 158
    iget-object v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a:Landroid/content/Context;

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

    move-result-object v0

    return-object v0
.end method

.method private a(J)Ljava/lang/String;
    .locals 2

    .line 320
    new-instance v0, Ljava/text/SimpleDateFormat;

    const-string v1, "HH:mm"

    invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    .line 321
    new-instance v1, Ljava/util/Date;

    invoke-direct {v1, p1, p2}, Ljava/util/Date;-><init>(J)V

    invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method private a(Landroid/graphics/Canvas;IILcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;F)V
    .locals 25

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    move/from16 v2, p2

    .line 79
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Canvas;->getHeight()I

    move-result v4

    const/high16 v5, 0x40800000    # 4.0f

    mul-float v5, v5, p5

    .line 80
    invoke-virtual {v0, v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v6

    const/high16 v7, 0x41600000    # 14.0f

    mul-float v7, v7, p5

    .line 82
    invoke-virtual {v0, v7}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v7

    const/high16 v8, 0x41e00000    # 28.0f

    mul-float v8, v8, p5

    .line 83
    invoke-virtual {v0, v8}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v8

    .line 85
    invoke-virtual {v0, v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v9

    .line 87
    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->location()Ljava/lang/String;

    move-result-object v10

    .line 88
    invoke-direct/range {p0 .. p0}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a()Landroid/content/res/Resources;

    move-result-object v11

    const v12, 0x7f0804e4

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

    move-result-object v11

    .line 89
    new-instance v12, Ljava/lang/StringBuilder;

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

    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->value()I

    move-result v13

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

    const-string v13, ""

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

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

    move-result-object v12

    .line 90
    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->objectName()Ljava/lang/String;

    move-result-object v13

    .line 91
    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->levelDesc()Ljava/lang/String;

    move-result-object v14

    .line 92
    iget-object v15, v0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a:Landroid/content/Context;

    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->aqiLevel()I

    move-result v16

    move-object/from16 v17, v13

    invoke-static/range {v16 .. v16}, Lcom/moji/base/AqiValueProvider;->e(I)I

    move-result v13

    invoke-static {v15, v13}, Landroid/support/v4/content/ContextCompat;->getColor(Landroid/content/Context;I)I

    move-result v13

    .line 93
    new-instance v15, Landroid/text/TextPaint;

    invoke-direct {v15}, Landroid/text/TextPaint;-><init>()V

    move-object/from16 v18, v14

    const/4 v14, 0x1

    .line 94
    invoke-virtual {v15, v14}, Landroid/text/TextPaint;->setAntiAlias(Z)V

    const/4 v14, -0x1

    .line 95
    invoke-virtual {v15, v14}, Landroid/text/TextPaint;->setColor(I)V

    const/high16 v16, 0x41400000    # 12.0f

    mul-float v14, p5, v16

    move/from16 v19, v5

    .line 96
    invoke-virtual {v0, v14}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v5

    int-to-float v5, v5

    invoke-virtual {v15, v5}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 97
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    .line 98
    new-instance v5, Landroid/graphics/Paint;

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

    move/from16 v20, v8

    const/4 v8, 0x1

    .line 99
    invoke-virtual {v5, v8}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 100
    invoke-virtual {v0, v14}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v8

    int-to-float v8, v8

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

    .line 102
    invoke-virtual {v15}, Landroid/text/TextPaint;->descent()F

    move-result v8

    invoke-virtual {v15}, Landroid/text/TextPaint;->ascent()F

    move-result v16

    add-float v8, v8, v16

    invoke-static {v8}, Ljava/lang/Math;->abs(F)F

    move-result v8

    add-int/2addr v9, v2

    move/from16 v21, v14

    int-to-float v14, v9

    sub-int v4, v4, p3

    int-to-float v4, v4

    const/high16 v16, 0x40000000    # 2.0f

    div-float v22, v8, v16

    sub-float v22, v4, v22

    .line 106
    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v23

    move/from16 v24, v7

    div-int/lit8 v7, v23, 0x2

    int-to-float v7, v7

    sub-float v7, v22, v7

    .line 104
    invoke-virtual {v1, v11, v14, v7, v5}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 110
    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v5

    add-int/2addr v9, v5

    add-int/2addr v9, v6

    int-to-float v5, v9

    .line 109
    invoke-virtual {v1, v10, v5, v4, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    const/high16 v5, 0x42480000    # 50.0f

    mul-float v5, v5, p5

    .line 114
    invoke-virtual {v0, v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v5

    int-to-float v5, v5

    invoke-virtual {v15, v5}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 115
    invoke-virtual {v15, v13}, Landroid/text/TextPaint;->setColor(I)V

    .line 116
    invoke-virtual {v15, v12}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v5

    .line 117
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b(Landroid/graphics/Paint;)V

    int-to-float v2, v2

    sub-float/2addr v4, v8

    sub-float/2addr v4, v2

    .line 118
    invoke-virtual {v1, v12, v2, v4, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 122
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    .line 124
    new-instance v7, Landroid/graphics/RectF;

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

    add-float/2addr v2, v5

    int-to-float v5, v6

    add-float/2addr v2, v5

    .line 125
    iput v2, v7, Landroid/graphics/RectF;->left:F

    move/from16 v6, v24

    int-to-float v8, v6

    sub-float v8, v4, v8

    .line 126
    iput v8, v7, Landroid/graphics/RectF;->top:F

    move/from16 v9, v20

    int-to-float v10, v9

    add-float/2addr v10, v2

    .line 127
    iput v10, v7, Landroid/graphics/RectF;->right:F

    .line 128
    iput v4, v7, Landroid/graphics/RectF;->bottom:F

    move/from16 v10, v19

    .line 129
    invoke-virtual {v0, v10}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v10

    int-to-float v10, v10

    .line 130
    new-instance v11, Landroid/graphics/Paint;

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

    const/4 v12, 0x1

    .line 131
    invoke-virtual {v11, v12}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 132
    invoke-virtual {v11, v13}, Landroid/graphics/Paint;->setColor(I)V

    .line 133
    sget-object v12, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

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

    .line 134
    invoke-direct {v0, v11}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    .line 135
    invoke-virtual {v1, v7, v10, v10, v11}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V

    const/high16 v7, 0x41300000    # 11.0f

    mul-float v3, p5, v7

    .line 139
    invoke-virtual {v0, v3}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v3

    int-to-float v3, v3

    invoke-virtual {v15, v3}, Landroid/text/TextPaint;->setTextSize(F)V

    const/4 v3, -0x1

    .line 140
    invoke-virtual {v15, v3}, Landroid/text/TextPaint;->setColor(I)V

    move-object/from16 v3, v18

    .line 141
    invoke-virtual {v15, v3}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v7

    .line 142
    invoke-virtual {v15}, Landroid/text/TextPaint;->descent()F

    move-result v10

    invoke-virtual {v15}, Landroid/text/TextPaint;->ascent()F

    move-result v11

    add-float/2addr v10, v11

    invoke-static {v10}, Ljava/lang/Math;->abs(F)F

    move-result v10

    .line 143
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b(Landroid/graphics/Paint;)V

    .line 144
    div-int/lit8 v9, v9, 0x2

    int-to-float v9, v9

    add-float/2addr v9, v2

    div-float v7, v7, v16

    sub-float/2addr v9, v7

    div-int/lit8 v7, v6, 0x2

    int-to-float v6, v7

    sub-float/2addr v4, v6

    div-float v10, v10, v16

    add-float/2addr v4, v10

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

    .line 148
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    move/from16 v3, v21

    .line 150
    invoke-virtual {v0, v3}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v3

    int-to-float v3, v3

    invoke-virtual {v15, v3}, Landroid/text/TextPaint;->setTextSize(F)V

    sub-float/2addr v8, v5

    move-object/from16 v3, v17

    .line 151
    invoke-virtual {v1, v3, v2, v8, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    return-void
.end method

.method private a(Landroid/graphics/Paint;)V
    .locals 4

    .line 64
    iget v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b:F

    iget v1, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->c:F

    iget v2, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->d:F

    iget v3, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->e:I

    invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Paint;->setShadowLayer(FFFI)V

    return-void
.end method

.method private b(Landroid/graphics/Canvas;IILcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;F)V
    .locals 32

    move-object/from16 v0, p0

    move-object/from16 v7, p1

    const/high16 v2, 0x40800000    # 4.0f

    mul-float v2, v2, p5

    .line 167
    invoke-virtual {v0, v2}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v3

    const/high16 v4, 0x42d20000    # 105.0f

    mul-float v4, v4, p5

    .line 168
    invoke-virtual {v0, v4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v4

    const/high16 v5, 0x42580000    # 54.0f

    mul-float v5, v5, p5

    .line 169
    invoke-virtual {v0, v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v5

    .line 170
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Canvas;->getHeight()I

    move-result v6

    .line 171
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Canvas;->getWidth()I

    move-result v9

    .line 174
    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->lastAqiInfo()Ljava/util/List;

    move-result-object v10

    const/4 v11, 0x0

    .line 175
    invoke-interface {v10, v11}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v12

    check-cast v12, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;

    iget v12, v12, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    .line 177
    invoke-interface {v10}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v13

    move v14, v12

    :goto_0
    invoke-interface {v13}, Ljava/util/Iterator;->hasNext()Z

    move-result v15

    if-eqz v15, :cond_2

    invoke-interface {v13}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v15

    check-cast v15, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;

    .line 178
    iget v11, v15, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    if-le v11, v12, :cond_0

    .line 179
    iget v11, v15, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    move v12, v11

    .line 181
    :cond_0
    iget v11, v15, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    if-ge v11, v14, :cond_1

    .line 182
    iget v11, v15, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    move v14, v11

    :cond_1
    const/4 v11, 0x0

    goto :goto_0

    :cond_2
    sub-int v11, v12, v14

    const/high16 v13, 0x41c00000    # 24.0f

    mul-float v13, v13, p5

    .line 188
    invoke-virtual {v0, v13}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v13

    const/high16 v15, 0x40c00000    # 6.0f

    mul-float v15, v15, p5

    move/from16 v16, v11

    .line 189
    invoke-virtual {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v11

    move/from16 v17, v15

    sub-int v15, v13, v11

    move/from16 v18, v15

    .line 192
    iget-object v15, v0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a:Landroid/content/Context;

    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->aqiLevel()I

    move-result v19

    move/from16 v20, v11

    invoke-static/range {v19 .. v19}, Lcom/moji/base/AqiValueProvider;->e(I)I

    move-result v11

    invoke-static {v15, v11}, Landroid/support/v4/content/ContextCompat;->getColor(Landroid/content/Context;I)I

    move-result v11

    .line 193
    new-instance v15, Landroid/text/TextPaint;

    invoke-direct {v15}, Landroid/text/TextPaint;-><init>()V

    move/from16 v21, v11

    const/4 v11, 0x1

    .line 194
    invoke-virtual {v15, v11}, Landroid/text/TextPaint;->setAntiAlias(Z)V

    const/4 v11, -0x1

    .line 195
    invoke-virtual {v15, v11}, Landroid/text/TextPaint;->setColor(I)V

    const/high16 v19, 0x41400000    # 12.0f

    mul-float v11, p5, v19

    .line 196
    invoke-virtual {v0, v11}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v11

    int-to-float v11, v11

    invoke-virtual {v15, v11}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 197
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    .line 200
    new-instance v11, Landroid/graphics/RectF;

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

    sub-int v9, v9, p2

    sub-int v4, v9, v4

    move/from16 v23, v13

    int-to-float v13, v4

    .line 201
    iput v13, v11, Landroid/graphics/RectF;->left:F

    sub-int v6, v6, p3

    sub-int v5, v6, v5

    int-to-float v5, v5

    .line 202
    iput v5, v11, Landroid/graphics/RectF;->top:F

    int-to-float v13, v9

    .line 203
    iput v13, v11, Landroid/graphics/RectF;->right:F

    int-to-float v13, v6

    .line 204
    iput v13, v11, Landroid/graphics/RectF;->bottom:F

    .line 205
    invoke-virtual {v0, v2}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v13

    int-to-float v13, v13

    .line 206
    new-instance v8, Landroid/graphics/Paint;

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

    const/4 v1, 0x1

    .line 207
    invoke-virtual {v8, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    const-string v1, "#32ffffff"

    .line 208
    invoke-static {v1}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v1

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

    .line 209
    sget-object v1, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

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

    .line 210
    invoke-virtual {v7, v11, v13, v13, v8}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V

    const-string v1, "AQI"

    .line 213
    invoke-virtual {v15}, Landroid/text/TextPaint;->descent()F

    move-result v8

    invoke-virtual {v15}, Landroid/text/TextPaint;->ascent()F

    move-result v11

    add-float/2addr v8, v11

    invoke-static {v8}, Ljava/lang/Math;->abs(F)F

    move-result v8

    sub-int v11, v4, v3

    int-to-float v11, v11

    .line 215
    invoke-virtual {v15, v1}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v13

    sub-float/2addr v11, v13

    add-float/2addr v5, v8

    .line 214
    invoke-virtual {v7, v1, v11, v5, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 220
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b(Landroid/graphics/Paint;)V

    const/4 v1, 0x0

    .line 221
    invoke-interface {v10, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;

    move/from16 v24, v2

    iget-wide v1, v5, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->time:J

    invoke-direct {v0, v1, v2}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(J)Ljava/lang/String;

    move-result-object v1

    .line 222
    invoke-interface {v10}, Ljava/util/List;->size()I

    move-result v2

    const/4 v5, 0x1

    sub-int/2addr v2, v5

    invoke-interface {v10, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;

    move-object/from16 v25, v10

    iget-wide v10, v2, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->time:J

    invoke-direct {v0, v10, v11}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(J)Ljava/lang/String;

    move-result-object v2

    const-string v5, "#96ffffff"

    .line 223
    invoke-static {v5}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v5

    invoke-virtual {v15, v5}, Landroid/text/TextPaint;->setColor(I)V

    .line 224
    invoke-virtual {v15}, Landroid/text/TextPaint;->descent()F

    move-result v5

    invoke-virtual {v15}, Landroid/text/TextPaint;->ascent()F

    move-result v10

    add-float/2addr v5, v10

    invoke-static {v5}, Ljava/lang/Math;->abs(F)F

    move-result v5

    add-int v10, v4, v3

    int-to-float v10, v10

    sub-int/2addr v6, v3

    int-to-float v6, v6

    .line 225
    invoke-virtual {v7, v1, v10, v6, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    sub-int/2addr v9, v3

    int-to-float v1, v9

    .line 230
    invoke-virtual {v15, v2}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v3

    sub-float v3, v1, v3

    .line 229
    invoke-virtual {v7, v2, v3, v6, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 233
    invoke-direct {v0, v15}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Paint;)V

    const/4 v2, -0x1

    .line 235
    invoke-virtual {v15, v2}, Landroid/text/TextPaint;->setColor(I)V

    .line 236
    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, ""

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

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

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

    move-result-object v2

    .line 237
    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v9, ""

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

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

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

    move-result-object v3

    .line 238
    invoke-virtual {v15, v2}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v9

    .line 239
    invoke-virtual {v15, v3}, Landroid/text/TextPaint;->measureText(Ljava/lang/String;)F

    move-result v10

    .line 243
    new-instance v11, Landroid/graphics/Paint;

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

    .line 244
    invoke-static {}, Lcom/moji/mjweather/setting/fragment/SettingDevelopConsoleFragment;->i()Z

    move-result v12

    if-eqz v12, :cond_3

    const-string v12, "#FFFFFF"

    :goto_1
    invoke-static {v12}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v12

    goto :goto_2

    :cond_3
    const-string v12, "#32FFFFFF"

    goto :goto_1

    :goto_2
    invoke-virtual {v11, v12}, Landroid/graphics/Paint;->setColor(I)V

    const/4 v12, 0x0

    .line 245
    invoke-virtual {v11, v12}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    const/high16 v12, 0x3f800000    # 1.0f

    .line 246
    invoke-virtual {v11, v12}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    move/from16 v13, v24

    .line 247
    invoke-virtual {v0, v13}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v13

    add-int v4, v4, p2

    int-to-float v4, v4

    sub-float v10, v1, v10

    int-to-float v13, v13

    sub-float v13, v10, v13

    sub-float/2addr v6, v5

    const/high16 v5, 0x41000000    # 8.0f

    mul-float v5, v5, p5

    .line 252
    invoke-virtual {v0, v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v5

    int-to-float v5, v5

    sub-float/2addr v6, v5

    move/from16 v5, v23

    int-to-float v5, v5

    const v22, 0x3f19999a    # 0.6f

    mul-float v22, v22, v5

    sub-float v22, v6, v22

    sub-float v23, v6, v5

    const/high16 v5, 0x40000000    # 2.0f

    div-float/2addr v8, v5

    add-float v8, v23, v8

    .line 256
    invoke-virtual {v7, v3, v10, v8, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    sub-float/2addr v1, v9

    .line 261
    invoke-virtual {v7, v2, v1, v6, v15}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    move-object/from16 v1, p1

    move v2, v4

    move v3, v6

    move v8, v4

    move v4, v13

    move v5, v6

    move v9, v6

    move-object v6, v11

    .line 268
    invoke-virtual/range {v1 .. v6}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    .line 276
    new-instance v1, Landroid/graphics/DashPathEffect;

    const/4 v2, 0x2

    new-array v2, v2, [F

    move/from16 v10, v17

    invoke-virtual {v0, v10}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v3

    int-to-float v3, v3

    const/4 v15, 0x0

    aput v3, v2, v15

    const/high16 v3, 0x40400000    # 3.0f

    mul-float v3, v3, p5

    invoke-virtual {v0, v3}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v3

    int-to-float v3, v3

    const/4 v4, 0x1

    aput v3, v2, v4

    invoke-direct {v1, v2, v12}, Landroid/graphics/DashPathEffect;-><init>([FF)V

    .line 277
    invoke-virtual {v11, v1}, Landroid/graphics/Paint;->setPathEffect(Landroid/graphics/PathEffect;)Landroid/graphics/PathEffect;

    move-object/from16 v1, p1

    move v2, v8

    move/from16 v3, v23

    move v4, v13

    move/from16 v5, v23

    .line 278
    invoke-virtual/range {v1 .. v6}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    move/from16 v3, v22

    move/from16 v5, v22

    .line 285
    invoke-virtual/range {v1 .. v6}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    .line 292
    invoke-interface/range {p4 .. p4}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->lastAqiInfo()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    .line 294
    new-instance v2, Landroid/graphics/Paint;

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

    move/from16 v3, v21

    .line 295
    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setColor(I)V

    const/4 v3, 0x1

    .line 296
    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 298
    new-instance v3, Landroid/graphics/RectF;

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

    sub-float/2addr v13, v8

    float-to-int v4, v13

    .line 302
    invoke-virtual {v0, v10}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v5

    mul-int v6, v5, v1

    sub-int/2addr v4, v6

    add-int/lit8 v6, v1, -0x1

    .line 304
    div-int/2addr v4, v6

    :goto_3
    if-ge v15, v1, :cond_4

    move-object/from16 v6, v25

    .line 307
    invoke-interface {v6, v15}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;

    .line 309
    invoke-virtual {v3}, Landroid/graphics/RectF;->setEmpty()V

    int-to-float v11, v5

    add-float v12, v8, v11

    mul-int v13, v15, v5

    int-to-float v13, v13

    add-float/2addr v12, v13

    mul-int v13, v15, v4

    int-to-float v13, v13

    add-float/2addr v12, v13

    .line 310
    iput v12, v3, Landroid/graphics/RectF;->left:F

    .line 311
    iput v9, v3, Landroid/graphics/RectF;->bottom:F

    .line 312
    iget v12, v3, Landroid/graphics/RectF;->bottom:F

    move/from16 v26, v1

    move/from16 v13, v20

    int-to-float v1, v13

    move/from16 v27, v4

    move/from16 v28, v5

    move/from16 v4, v18

    int-to-float v5, v4

    move/from16 v29, v4

    iget v4, v10, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->value:I

    sub-int/2addr v4, v14

    int-to-float v4, v4

    move-object/from16 v30, v6

    move/from16 v31, v8

    move/from16 v6, v16

    int-to-float v8, v6

    div-float/2addr v4, v8

    mul-float v5, v5, v4

    add-float/2addr v1, v5

    sub-float/2addr v12, v1

    iput v12, v3, Landroid/graphics/RectF;->top:F

    .line 313
    iget v1, v3, Landroid/graphics/RectF;->left:F

    sub-float/2addr v1, v11

    iput v1, v3, Landroid/graphics/RectF;->right:F

    .line 314
    iget-object v1, v0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a:Landroid/content/Context;

    iget v4, v10, Lcom/moji/mjweather/aqi/AqiPreviewHelper$AqiPoint;->colorLevel:I

    invoke-static {v4}, Lcom/moji/base/AqiValueProvider;->e(I)I

    move-result v4

    invoke-static {v1, v4}, Landroid/support/v4/content/ContextCompat;->getColor(Landroid/content/Context;I)I

    move-result v1

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

    .line 315
    invoke-virtual {v7, v3, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/RectF;Landroid/graphics/Paint;)V

    add-int/lit8 v15, v15, 0x1

    move/from16 v1, v26

    move/from16 v4, v27

    move/from16 v5, v28

    move/from16 v18, v29

    move-object/from16 v25, v30

    move/from16 v8, v31

    goto :goto_3

    :cond_4
    return-void
.end method

.method private b(Landroid/graphics/Paint;)V
    .locals 4

    .line 68
    iget v0, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->c:F

    iget v1, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->d:F

    iget v2, p0, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->e:I

    const/4 v3, 0x0

    invoke-virtual {p1, v3, v0, v1, v2}, Landroid/graphics/Paint;->setShadowLayer(FFFI)V

    return-void
.end method


# virtual methods
.method public a(F)I
    .locals 2

    .line 328
    invoke-direct {p0}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a()Landroid/content/res/Resources;

    move-result-object v0

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

    move-result-object v0

    const/4 v1, 0x1

    invoke-static {v1, p1, v0}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result p1

    float-to-int p1, p1

    return p1
.end method

.method public a(Landroid/graphics/Bitmap;Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;F)Landroid/graphics/Bitmap;
    .locals 9

    .line 45
    invoke-static {}, Lcom/moji/mjweather/setting/fragment/SettingDevelopConsoleFragment;->i()Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "AqiPreviewHelper"

    .line 46
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "draw: resolution "

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

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

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

    move-result-object v1

    invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 48
    :cond_0
    sget-object v0, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    const/4 v1, 0x1

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Bitmap;->copy(Landroid/graphics/Bitmap$Config;Z)Landroid/graphics/Bitmap;

    move-result-object p1

    .line 49
    new-instance v6, Landroid/graphics/Canvas;

    invoke-direct {v6, p1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    const/high16 v0, 0x41200000    # 10.0f

    mul-float v0, v0, p3

    .line 50
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v7

    const/high16 v0, 0x41700000    # 15.0f

    mul-float v0, v0, p3

    .line 51
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(F)I

    move-result v8

    move-object v0, p0

    move-object v1, v6

    move v2, v7

    move v3, v8

    move-object v4, p2

    move v5, p3

    .line 52
    invoke-direct/range {v0 .. v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->a(Landroid/graphics/Canvas;IILcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;F)V

    .line 54
    invoke-interface {p2}, Lcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;->lastAqiInfo()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_1

    move-object v0, p0

    move-object v1, v6

    move v2, v7

    move v3, v8

    move-object v4, p2

    move v5, p3

    .line 55
    invoke-direct/range {v0 .. v5}, Lcom/moji/mjweather/aqi/AqiPreviewHelper;->b(Landroid/graphics/Canvas;IILcom/moji/mjweather/aqi/AqiPreviewHelper$IAqiInfo;F)V

    .line 57
    :cond_1
    invoke-virtual {v6}, Landroid/graphics/Canvas;->save()I

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

    return-object p1
.end method
