SendingFileDrawable.smali

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


# instance fields
.field private isChat:Z

.field private lastUpdateTime:J

.field private progress:F

.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/SendingFileDrawable;->isChat:Z

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

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

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

    return-void
.end method

.method private update()V
    .registers 8

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

    move-result-wide v0

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

    sub-long v2, v0, v2

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

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

    cmp-long v6, v2, v4

    if-lez v6, :cond_12

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

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

    long-to-float v5, v2

    const/high16 v6, 0x43fa0000    # 500.0f

    div-float/2addr v5, v6

    add-float/2addr v4, v5

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

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

    const/high16 v5, 0x3f800000    # 1.0f

    cmpl-float v6, v4, v5

    if-lez v6, :cond_27

    .line 31
    sub-float/2addr v4, v5

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

    goto :goto_1b

    .line 33
    :cond_27
    invoke-virtual {p0}, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->invalidateSelf()V

    .line 34
    return-void
.end method


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

    .line 48
    const/4 v0, 0x0

    .local v0, "a":I
    :goto_1
    const/4 v1, 0x3

    if-ge v0, v1, :cond_9a

    .line 49
    const/high16 v1, 0x437f0000    # 255.0f

    if-nez v0, :cond_13

    .line 50
    sget-object v2, Lim/tpelyyftgw/ui/actionbar/Theme;->chat_statusRecordPaint:Landroid/graphics/Paint;

    iget v3, p0, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->progress:F

    mul-float v3, v3, v1

    float-to-int v1, v3

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

    goto :goto_2b

    .line 51
    :cond_13
    const/4 v2, 0x2

    if-ne v0, v2, :cond_24

    .line 52
    sget-object v2, Lim/tpelyyftgw/ui/actionbar/Theme;->chat_statusRecordPaint:Landroid/graphics/Paint;

    const/high16 v3, 0x3f800000    # 1.0f

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

    sub-float/2addr v3, v4

    mul-float v3, v3, v1

    float-to-int v1, v3

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

    goto :goto_2b

    .line 54
    :cond_24
    sget-object v1, Lim/tpelyyftgw/ui/actionbar/Theme;->chat_statusRecordPaint:Landroid/graphics/Paint;

    const/16 v2, 0xff

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

    .line 56
    :goto_2b
    const/high16 v1, 0x40a00000    # 5.0f

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

    move-result v2

    mul-int v2, v2, v0

    int-to-float v2, v2

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

    move-result v1

    int-to-float v1, v1

    iget v3, p0, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->progress:F

    mul-float v1, v1, v3

    add-float/2addr v2, v1

    .line 57
    .local v2, "side":F
    iget-boolean v1, p0, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->isChat:Z

    const/high16 v9, 0x40800000    # 4.0f

    if-eqz v1, :cond_47

    const/high16 v1, 0x40400000    # 3.0f

    goto :goto_49

    :cond_47
    const/high16 v1, 0x40800000    # 4.0f

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

    move-result v1

    int-to-float v5, v1

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

    move-result v1

    int-to-float v1, v1

    add-float v6, v2, v1

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

    const/high16 v10, 0x40e00000    # 7.0f

    const/high16 v11, 0x41000000    # 8.0f

    if-eqz v1, :cond_60

    const/high16 v1, 0x40e00000    # 7.0f

    goto :goto_62

    :cond_60
    const/high16 v1, 0x41000000    # 8.0f

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

    move-result v1

    int-to-float v7, v1

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

    move-object v3, p1

    move v4, v2

    invoke-virtual/range {v3 .. v8}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    .line 58
    iget-boolean v1, p0, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->isChat:Z

    if-eqz v1, :cond_75

    const/high16 v1, 0x41300000    # 11.0f

    goto :goto_77

    :cond_75
    const/high16 v1, 0x41400000    # 12.0f

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

    move-result v1

    int-to-float v5, v1

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

    move-result v1

    int-to-float v1, v1

    add-float v6, v2, v1

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

    if-eqz v1, :cond_88

    goto :goto_8a

    :cond_88
    const/high16 v10, 0x41000000    # 8.0f

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

    move-result v1

    int-to-float v7, v1

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

    move-object v3, p1

    move v4, v2

    invoke-virtual/range {v3 .. v8}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V

    .line 48
    .end local v2    # "side":F
    add-int/lit8 v0, v0, 0x1

    goto/16 :goto_1

    .line 61
    .end local v0    # "a":I
    :cond_9a
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/SendingFileDrawable;->started:Z

    if-eqz v0, :cond_a1

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

    .line 64
    :cond_a1
    return-void
.end method

.method public getIntrinsicHeight()I
    .registers 2

    .line 88
    const/high16 v0, 0x41600000    # 14.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 83
    const/high16 v0, 0x41900000    # 18.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 78
    const/4 v0, 0x0

    return v0
.end method

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

    .line 69
    return-void
.end method

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

    .line 74
    return-void
.end method

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

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

    .line 20
    return-void
.end method

.method public start()V
    .registers 3

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

    move-result-wide v0

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

    .line 38
    const/4 v0, 0x1

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

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

    .line 40
    return-void
.end method

.method public stop()V
    .registers 2

    .line 43
    const/4 v0, 0x0

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

    .line 44
    return-void
.end method