RollTextView.smali
.class public Lcom/cleanmaster/weather/view/RollTextView;
.super Landroid/widget/TextView;
.source "RollTextView.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/cleanmaster/weather/view/RollTextView$AdContent;
}
.end annotation
# instance fields
.field a:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Lcom/cleanmaster/weather/view/RollTextView$AdContent;",
">;"
}
.end annotation
.end field
.field b:I
.field c:I
.field d:I
.field e:I
.field f:I
.field g:Ljava/lang/String;
.field h:Ljava/lang/String;
.field i:Z
.field j:Lcom/cleanmaster/hpsharelib/base/anim/ObjectAnimation;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.registers 2
.prologue
.line 31
invoke-direct {p0, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
.line 32
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->a()V
.line 33
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 3
.prologue
.line 36
invoke-direct {p0, p1, p2}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 37
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->a()V
.line 38
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.registers 4
.prologue
.line 41
invoke-direct {p0, p1, p2, p3}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.line 42
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->a()V
.line 43
return-void
.end method
.method private a(I)Lcom/cleanmaster/weather/view/RollTextView$AdContent;
.registers 3
.prologue
.line 70
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_a
.line 71
const/4 v0, 0x0
.line 77
:goto_9
return-object v0
.line 73
:cond_a
if-ltz p1, :cond_14
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-lt p1, v0, :cond_15
.line 74
:cond_14
const/4 p1, 0x0
.line 76
:cond_15
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/cleanmaster/weather/view/RollTextView$AdContent;
goto :goto_9
.end method
.method private a(Ljava/lang/String;Landroid/graphics/Paint;F)Ljava/lang/String;
.registers 8
.prologue
const/4 v1, 0x0
.line 145
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v2
.line 146
invoke-virtual {p2, p1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
move-result v0
.line 147
cmpg-float v3, v0, p3
if-gtz v3, :cond_1c
.line 148
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingLeft()I
move-result v1
int-to-float v1, v1
sub-float v0, p3, v0
const/high16 v2, 0x40000000 # 2.0f
div-float/2addr v0, v2
add-float/2addr v0, v1
float-to-int v0, v0
iput v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->b:I
.line 160
:goto_1b
return-object p1
.line 152
:cond_1c
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingLeft()I
move-result v0
iput v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->b:I
move v0, v1
.line 153
:goto_23
if-ge v0, v2, :cond_4e
.line 154
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v3
.line 155
invoke-virtual {p2, v3}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
move-result v3
cmpl-float v3, v3, p3
if-lez v3, :cond_4b
.line 156
add-int/lit8 v0, v0, -0x1
invoke-virtual {p1, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v0
.line 157
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, ".."
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
goto :goto_1b
.line 153
:cond_4b
add-int/lit8 v0, v0, 0x1
goto :goto_23
.line 160
:cond_4e
const-string p1, ""
goto :goto_1b
.end method
.method private a()V
.registers 3
.prologue
.line 46
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v0
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getTextSize()F
move-result v1
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setTextSize(F)V
.line 47
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v0
const v1, -0x71a800
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
.line 48
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
move-result-object v0
new-instance v1, Lcom/cleanmaster/weather/view/a;
invoke-direct {v1, p0}, Lcom/cleanmaster/weather/view/a;-><init>(Lcom/cleanmaster/weather/view/RollTextView;)V
invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
.line 54
return-void
.end method
.method static synthetic a(Lcom/cleanmaster/weather/view/RollTextView;)V
.registers 1
.prologue
.line 20
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->b()V
return-void
.end method
.method private b()V
.registers 6
.prologue
const/4 v1, 0x0
.line 81
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
if-eqz v0, :cond_d
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-gtz v0, :cond_12
.line 82
:cond_d
iput-object v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->g:Ljava/lang/String;
.line 83
iput-object v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->h:Ljava/lang/String;
.line 102
:goto_11
return-void
.line 87
:cond_12
iget v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->f:I
invoke-direct {p0, v0}, Lcom/cleanmaster/weather/view/RollTextView;->a(I)Lcom/cleanmaster/weather/view/RollTextView$AdContent;
move-result-object v0
.line 88
iget v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->f:I
add-int/lit8 v1, v1, 0x1
invoke-direct {p0, v1}, Lcom/cleanmaster/weather/view/RollTextView;->a(I)Lcom/cleanmaster/weather/view/RollTextView$AdContent;
move-result-object v1
.line 90
if-eqz v0, :cond_43
.line 91
invoke-interface {v0}, Lcom/cleanmaster/weather/view/RollTextView$AdContent;->getTitle()Ljava/lang/String;
move-result-object v0
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v2
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getWidth()I
move-result v3
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingLeft()I
move-result v4
sub-int/2addr v3, v4
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingRight()I
move-result v4
sub-int/2addr v3, v4
int-to-float v3, v3
invoke-direct {p0, v0, v2, v3}, Lcom/cleanmaster/weather/view/RollTextView;->a(Ljava/lang/String;Landroid/graphics/Paint;F)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->g:Ljava/lang/String;
.line 92
iget v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->b:I
iput v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->c:I
.line 94
:cond_43
if-eqz v1, :cond_66
.line 95
invoke-interface {v1}, Lcom/cleanmaster/weather/view/RollTextView$AdContent;->getTitle()Ljava/lang/String;
move-result-object v0
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v1
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getWidth()I
move-result v2
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingLeft()I
move-result v3
sub-int/2addr v2, v3
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getCompoundPaddingRight()I
move-result v3
sub-int/2addr v2, v3
int-to-float v2, v2
invoke-direct {p0, v0, v1, v2}, Lcom/cleanmaster/weather/view/RollTextView;->a(Ljava/lang/String;Landroid/graphics/Paint;F)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->h:Ljava/lang/String;
.line 96
iget v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->b:I
iput v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->d:I
.line 99
:cond_66
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v0
invoke-virtual {v0}, Landroid/text/TextPaint;->getFontMetrics()Landroid/graphics/Paint$FontMetrics;
move-result-object v0
.line 100
iget v1, v0, Landroid/graphics/Paint$FontMetrics;->bottom:F
iget v2, v0, Landroid/graphics/Paint$FontMetrics;->top:F
sub-float/2addr v1, v2
.line 101
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getHeight()I
move-result v2
int-to-float v2, v2
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getHeight()I
move-result v3
int-to-float v3, v3
sub-float v1, v3, v1
const/high16 v3, 0x40000000 # 2.0f
div-float/2addr v1, v3
sub-float v1, v2, v1
iget v0, v0, Landroid/graphics/Paint$FontMetrics;->bottom:F
sub-float v0, v1, v0
float-to-int v0, v0
iput v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->e:I
goto :goto_11
.end method
.method private c()F
.registers 2
.prologue
.line 138
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->j:Lcom/cleanmaster/hpsharelib/base/anim/ObjectAnimation;
if-eqz v0, :cond_b
.line 139
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->j:Lcom/cleanmaster/hpsharelib/base/anim/ObjectAnimation;
invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/anim/ObjectAnimation;->getValue()F
move-result v0
.line 141
:goto_a
return v0
:cond_b
const/4 v0, 0x0
goto :goto_a
.end method
# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
.registers 6
.prologue
.line 165
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->g:Ljava/lang/String;
if-nez v0, :cond_5
.line 182
:goto_4
return-void
.line 168
:cond_5
iget-boolean v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->i:Z
if-eqz v0, :cond_41
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->h:Ljava/lang/String;
if-eqz v0, :cond_41
.line 170
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
.line 171
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->g:Ljava/lang/String;
iget v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->c:I
int-to-float v1, v1
iget v2, p0, Lcom/cleanmaster/weather/view/RollTextView;->e:I
int-to-float v2, v2
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->c()F
move-result v3
add-float/2addr v2, v3
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v3
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V
.line 172
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->h:Ljava/lang/String;
iget v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->d:I
int-to-float v1, v1
iget v2, p0, Lcom/cleanmaster/weather/view/RollTextView;->e:I
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getHeight()I
move-result v3
sub-int/2addr v2, v3
int-to-float v2, v2
invoke-direct {p0}, Lcom/cleanmaster/weather/view/RollTextView;->c()F
move-result v3
add-float/2addr v2, v3
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v3
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V
.line 173
invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V
goto :goto_4
.line 177
:cond_41
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
.line 178
iget-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->g:Ljava/lang/String;
iget v1, p0, Lcom/cleanmaster/weather/view/RollTextView;->c:I
int-to-float v1, v1
iget v2, p0, Lcom/cleanmaster/weather/view/RollTextView;->e:I
int-to-float v2, v2
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->getPaint()Landroid/text/TextPaint;
move-result-object v3
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V
.line 179
invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V
goto :goto_4
.end method
.method public setData(Ljava/util/List;)V
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<+",
"Lcom/cleanmaster/weather/view/RollTextView$AdContent;",
">;)V"
}
.end annotation
.prologue
.line 57
if-nez p1, :cond_3
.line 63
:goto_2
return-void
.line 60
:cond_3
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0, p1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
iput-object v0, p0, Lcom/cleanmaster/weather/view/RollTextView;->a:Ljava/util/List;
.line 61
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->requestLayout()V
.line 62
invoke-virtual {p0}, Lcom/cleanmaster/weather/view/RollTextView;->invalidate()V
goto :goto_2
.end method