.class public Lcom/moji/mjweather/assshop/view/TopRightTextView;
.super Landroid/widget/TextView;
.source "TopRightTextView.java"


# instance fields
.field private a:Z

.field private b:Landroid/graphics/Paint;


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

    .line 20
    invoke-direct {p0, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    return-void
.end method

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

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

    return-void
.end method

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

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

    return-void
.end method


# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 7

    .line 33
    invoke-super {p0, p1}, Landroid/widget/TextView;->onDraw(Landroid/graphics/Canvas;)V

    .line 34
    iget-boolean v0, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->a:Z

    if-eqz v0, :cond_1

    const/high16 v0, 0x40c00000    # 6.0f

    .line 35
    invoke-static {}, Lcom/moji/tool/DeviceTool;->f()F

    move-result v1

    mul-float v1, v1, v0

    float-to-int v0, v1

    .line 36
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/TopRightTextView;->getPaddingRight()I

    move-result v1

    .line 37
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

    if-nez v2, :cond_0

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

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

    iput-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

    .line 40
    :cond_0
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

    int-to-float v3, v0

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

    .line 41
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/TopRightTextView;->getContext()Landroid/content/Context;

    move-result-object v3

    const v4, 0x7f060049

    invoke-static {v3, v4}, Lcom/moji/tool/DeviceTool;->a(Landroid/content/Context;I)I

    move-result v3

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

    .line 42
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

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

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

    .line 43
    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

    invoke-virtual {v2}, Landroid/graphics/Paint;->getFontMetricsInt()Landroid/graphics/Paint$FontMetricsInt;

    move-result-object v2

    int-to-double v3, v0

    const-wide v5, 0x3ffccccccccccccdL    # 1.8

    .line 44
    invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v3, v3, v5

    iget v5, v2, Landroid/graphics/Paint$FontMetricsInt;->bottom:I

    int-to-double v5, v5

    invoke-static {v5, v6}, Ljava/lang/Double;->isNaN(D)Z

    sub-double/2addr v3, v5

    iget v5, v2, Landroid/graphics/Paint$FontMetricsInt;->top:I

    int-to-double v5, v5

    invoke-static {v5, v6}, Ljava/lang/Double;->isNaN(D)Z

    add-double/2addr v3, v5

    const-wide/high16 v5, 0x4000000000000000L    # 2.0

    div-double/2addr v3, v5

    iget v2, v2, Landroid/graphics/Paint$FontMetricsInt;->top:I

    int-to-double v5, v2

    invoke-static {v5, v6}, Ljava/lang/Double;->isNaN(D)Z

    sub-double/2addr v3, v5

    double-to-int v2, v3

    const-string v3, "NEW"

    .line 45
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/view/TopRightTextView;->getMeasuredWidth()I

    move-result v4

    sub-int/2addr v4, v1

    add-int/2addr v4, v0

    int-to-float v0, v4

    int-to-float v1, v2

    iget-object v2, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->b:Landroid/graphics/Paint;

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

    :cond_1
    return-void
.end method

.method public setTopRightVisibility(Z)V
    .locals 0

    .line 50
    iput-boolean p1, p0, Lcom/moji/mjweather/assshop/view/TopRightTextView;->a:Z

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

    return-void
.end method
