RoundStatusDrawable.smali

.class public Lim/tpelyyftgw/ui/components/RoundStatusDrawable;
.super Lim/tpelyyftgw/ui/components/StatusDrawable;
.source "RoundStatusDrawable.java"


# instance fields
.field private isChat:Z

.field private lastUpdateTime:J

.field private progress:F

.field private progressDirection:I

.field private started:Z


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>()V
    .registers 4

    .line 11
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/StatusDrawable;-><init>()V

    .line 13
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->isChat:Z

    .line 14
    const-wide/16 v1, 0x0

    iput-wide v1, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->lastUpdateTime:J

    .line 15
    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->started:Z

    .line 17
    const/4 v0, 0x1

    iput v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progressDirection:I

    return-void
.end method

.method private update()V
    .registers 9

    .line 24
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 25
    .local v0, "newTime":J
    iget-wide v2, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->lastUpdateTime:J

    sub-long v2, v0, v2

    .line 26
    .local v2, "dt":J
    iput-wide v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->lastUpdateTime:J

    .line 27
    const-wide/16 v4, 0x32

    cmp-long v6, v2, v4

    if-lez v6, :cond_12

    .line 28
    const-wide/16 v2, 0x32

    .line 30
    :cond_12
    iget v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    iget v5, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progressDirection:I

    int-to-long v6, v5

    mul-long v6, v6, v2

    long-to-float v6, v6

    const/high16 v7, 0x43c80000    # 400.0f

    div-float/2addr v6, v7

    add-float/2addr v4, v6

    iput v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    .line 31
    if-lez v5, :cond_2e

    const/high16 v5, 0x3f800000    # 1.0f

    cmpl-float v4, v4, v5

    if-ltz v4, :cond_2e

    .line 32
    const/4 v4, -0x1

    iput v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progressDirection:I

    .line 33
    iput v5, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    goto :goto_3e

    .line 34
    :cond_2e
    iget v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progressDirection:I

    if-gez v4, :cond_3e

    iget v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    const/4 v5, 0x0

    cmpg-float v4, v4, v5

    if-gtz v4, :cond_3e

    .line 35
    const/4 v4, 0x1

    iput v4, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progressDirection:I

    .line 36
    iput v5, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    .line 38
    :cond_3e
    :goto_3e
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->invalidateSelf()V

    .line 39
    return-void
.end method


# virtual methods
.method public draw(Landroid/graphics/Canvas;)V
    .registers 6
    .param p1, "canvas"    # Landroid/graphics/Canvas;

    .line 53
    sget-object v0, Lim/tpelyyftgw/ui/actionbar/Theme;->chat_statusPaint:Landroid/graphics/Paint;

    iget v1, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->progress:F

    const/high16 v2, 0x43480000    # 200.0f

    mul-float v1, v1, v2

    float-to-int v1, v1

    add-int/lit8 v1, v1, 0x37

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

    .line 54
    const/high16 v0, 0x40c00000    # 6.0f

    invoke-static {v0}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v0

    int-to-float v0, v0

    iget-boolean v1, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->isChat:Z

    if-eqz v1, :cond_1c

    const/high16 v1, 0x41000000    # 8.0f

    goto :goto_1e

    :cond_1c
    const/high16 v1, 0x41100000    # 9.0f

    :goto_1e
    invoke-static {v1}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v1

    int-to-float v1, v1

    const/high16 v2, 0x40800000    # 4.0f

    invoke-static {v2}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v2

    int-to-float v2, v2

    sget-object v3, Lim/tpelyyftgw/ui/actionbar/Theme;->chat_statusPaint:Landroid/graphics/Paint;

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

    .line 55
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->started:Z

    if-eqz v0, :cond_36

    .line 56
    invoke-direct {p0}, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->update()V

    .line 58
    :cond_36
    return-void
.end method

.method public getIntrinsicHeight()I
    .registers 2

    .line 82
    const/high16 v0, 0x41200000    # 10.0f

    invoke-static {v0}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v0

    return v0
.end method

.method public getIntrinsicWidth()I
    .registers 2

    .line 77
    const/high16 v0, 0x41400000    # 12.0f

    invoke-static {v0}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v0

    return v0
.end method

.method public getOpacity()I
    .registers 2

    .line 72
    const/4 v0, 0x0

    return v0
.end method

.method public setAlpha(I)V
    .registers 2
    .param p1, "alpha"    # I

    .line 63
    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .registers 2
    .param p1, "cf"    # Landroid/graphics/ColorFilter;

    .line 68
    return-void
.end method

.method public setIsChat(Z)V
    .registers 2
    .param p1, "value"    # Z

    .line 20
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->isChat:Z

    .line 21
    return-void
.end method

.method public start()V
    .registers 3

    .line 42
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->lastUpdateTime:J

    .line 43
    const/4 v0, 0x1

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->started:Z

    .line 44
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->invalidateSelf()V

    .line 45
    return-void
.end method

.method public stop()V
    .registers 2

    .line 48
    const/4 v0, 0x0

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/RoundStatusDrawable;->started:Z

    .line 49
    return-void
.end method