LinkPath.smali

.class public Lim/tpelyyftgw/ui/components/LinkPath;
.super Landroid/graphics/Path;
.source "LinkPath.java"


# instance fields
.field private allowReset:Z

.field private baselineShift:I

.field private currentLayout:Landroid/text/StaticLayout;

.field private currentLine:I

.field private heightOffset:F

.field private lastTop:F

.field private lineHeight:I

.field private rect:Landroid/graphics/RectF;

.field private useRoundRect:Z


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

    return-void
.end method

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

    .line 25
    invoke-direct {p0}, Landroid/graphics/Path;-><init>()V

    .line 16
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    .line 20
    const/4 v0, 0x1

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->allowReset:Z

    .line 26
    return-void
.end method

.method public constructor <init>(Z)V
    .registers 3
    .param p1, "roundRect"    # Z

    .line 29
    invoke-direct {p0}, Landroid/graphics/Path;-><init>()V

    .line 16
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    .line 20
    const/4 v0, 0x1

    iput-boolean v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->allowReset:Z

    .line 30
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->useRoundRect:Z

    .line 31
    return-void
.end method


# virtual methods
.method public addRect(FFFFLandroid/graphics/Path$Direction;)V
    .registers 16
    .param p1, "left"    # F
    .param p2, "top"    # F
    .param p3, "right"    # F
    .param p4, "bottom"    # F
    .param p5, "dir"    # Landroid/graphics/Path$Direction;

    .line 64
    iget v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->heightOffset:F

    add-float/2addr p2, v0

    .line 65
    add-float/2addr p4, v0

    .line 66
    iget v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    const/high16 v1, -0x40800000    # -1.0f

    cmpl-float v1, v0, v1

    if-nez v1, :cond_f

    .line 67
    iput p2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    goto :goto_1b

    .line 68
    :cond_f
    cmpl-float v0, v0, p2

    if-eqz v0, :cond_1b

    .line 69
    iput p2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    .line 70
    iget v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    .line 72
    :cond_1b
    :goto_1b
    iget-object v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    iget v1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    invoke-virtual {v0, v1}, Landroid/text/StaticLayout;->getLineRight(I)F

    move-result v0

    .line 73
    .local v0, "lineRight":F
    iget-object v1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    iget v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    invoke-virtual {v1, v2}, Landroid/text/StaticLayout;->getLineLeft(I)F

    move-result v1

    .line 74
    .local v1, "lineLeft":F
    cmpl-float v2, p1, v0

    if-gez v2, :cond_d7

    cmpg-float v2, p1, v1

    if-gtz v2, :cond_39

    cmpg-float v2, p3, v1

    if-gtz v2, :cond_39

    goto/16 :goto_d7

    .line 77
    :cond_39
    cmpl-float v2, p3, v0

    if-lez v2, :cond_3e

    .line 78
    move p3, v0

    .line 80
    :cond_3e
    cmpg-float v2, p1, v1

    if-gez v2, :cond_43

    .line 81
    move p1, v1

    .line 83
    :cond_43
    move v2, p2

    .line 85
    .local v2, "y":F
    sget v3, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v4, 0x1c

    const/4 v5, 0x0

    if-lt v3, v4, :cond_75

    .line 86
    move v3, p4

    .line 87
    .local v3, "y2":F
    sub-float v4, p4, p2

    iget v6, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lineHeight:I

    int-to-float v6, v6

    cmpl-float v4, v4, v6

    if-lez v4, :cond_88

    .line 88
    iget v4, p0, Lim/tpelyyftgw/ui/components/LinkPath;->heightOffset:F

    iget-object v6, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    invoke-virtual {v6}, Landroid/text/StaticLayout;->getHeight()I

    move-result v6

    int-to-float v6, v6

    cmpl-float v6, p4, v6

    if-eqz v6, :cond_72

    iget-object v5, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    iget v6, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    invoke-virtual {v5, v6}, Landroid/text/StaticLayout;->getLineBottom(I)I

    move-result v5

    int-to-float v5, v5

    iget-object v6, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    invoke-virtual {v6}, Landroid/text/StaticLayout;->getSpacingAdd()F

    move-result v6

    sub-float/2addr v5, v6

    :cond_72
    add-float v3, v4, v5

    goto :goto_88

    .line 91
    .end local v3    # "y2":F
    :cond_75
    iget-object v3, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    invoke-virtual {v3}, Landroid/text/StaticLayout;->getHeight()I

    move-result v3

    int-to-float v3, v3

    cmpl-float v3, p4, v3

    if-eqz v3, :cond_86

    iget-object v3, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    invoke-virtual {v3}, Landroid/text/StaticLayout;->getSpacingAdd()F

    move-result v5

    :cond_86
    sub-float v3, p4, v5

    .line 93
    .restart local v3    # "y2":F
    :cond_88
    :goto_88
    iget v4, p0, Lim/tpelyyftgw/ui/components/LinkPath;->baselineShift:I

    if-gez v4, :cond_91

    .line 94
    int-to-float v4, v4

    add-float/2addr v3, v4

    move v8, v2

    move v9, v3

    goto :goto_9a

    .line 95
    :cond_91
    if-lez v4, :cond_98

    .line 96
    int-to-float v4, v4

    add-float/2addr v2, v4

    move v8, v2

    move v9, v3

    goto :goto_9a

    .line 95
    :cond_98
    move v8, v2

    move v9, v3

    .line 98
    .end local v2    # "y":F
    .end local v3    # "y2":F
    .local v8, "y":F
    .local v9, "y2":F
    :goto_9a
    iget-boolean v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->useRoundRect:Z

    if-eqz v2, :cond_cd

    .line 99
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->rect:Landroid/graphics/RectF;

    if-nez v2, :cond_a9

    .line 100
    new-instance v2, Landroid/graphics/RectF;

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

    iput-object v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->rect:Landroid/graphics/RectF;

    .line 102
    :cond_a9
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->rect:Landroid/graphics/RectF;

    const/high16 v3, 0x40800000    # 4.0f

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

    move-result v4

    int-to-float v4, v4

    sub-float v4, p1, v4

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

    move-result v5

    int-to-float v5, v5

    add-float/2addr v5, p3

    invoke-virtual {v2, v4, v8, v5, v9}, Landroid/graphics/RectF;->set(FFFF)V

    .line 103
    iget-object v2, p0, Lim/tpelyyftgw/ui/components/LinkPath;->rect:Landroid/graphics/RectF;

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

    move-result v4

    int-to-float v4, v4

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

    move-result v3

    int-to-float v3, v3

    invoke-super {p0, v2, v4, v3, p5}, Landroid/graphics/Path;->addRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Path$Direction;)V

    goto :goto_d6

    .line 105
    :cond_cd
    move-object v2, p0

    move v3, p1

    move v4, v8

    move v5, p3

    move v6, v9

    move-object v7, p5

    invoke-super/range {v2 .. v7}, Landroid/graphics/Path;->addRect(FFFFLandroid/graphics/Path$Direction;)V

    .line 107
    :goto_d6
    return-void

    .line 75
    .end local v8    # "y":F
    .end local v9    # "y2":F
    :cond_d7
    :goto_d7
    return-void
.end method

.method public isUsingRoundRect()Z
    .registers 2

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

    return v0
.end method

.method public reset()V
    .registers 2

    .line 111
    iget-boolean v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->allowReset:Z

    if-nez v0, :cond_5

    .line 112
    return-void

    .line 114
    :cond_5
    invoke-super {p0}, Landroid/graphics/Path;->reset()V

    .line 115
    return-void
.end method

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

    .line 47
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->allowReset:Z

    .line 48
    return-void
.end method

.method public setBaselineShift(I)V
    .registers 2
    .param p1, "value"    # I

    .line 59
    iput p1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->baselineShift:I

    .line 60
    return-void
.end method

.method public setCurrentLayout(Landroid/text/StaticLayout;IF)V
    .registers 7
    .param p1, "layout"    # Landroid/text/StaticLayout;
    .param p2, "start"    # I
    .param p3, "yOffset"    # F

    .line 34
    iput-object p1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLayout:Landroid/text/StaticLayout;

    .line 35
    invoke-virtual {p1, p2}, Landroid/text/StaticLayout;->getLineForOffset(I)I

    move-result v0

    iput v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->currentLine:I

    .line 36
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lastTop:F

    .line 37
    iput p3, p0, Lim/tpelyyftgw/ui/components/LinkPath;->heightOffset:F

    .line 38
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x1c

    if-lt v0, v1, :cond_29

    .line 39
    invoke-virtual {p1}, Landroid/text/StaticLayout;->getLineCount()I

    move-result v0

    .line 40
    .local v0, "lineCount":I
    if-lez v0, :cond_29

    .line 41
    add-int/lit8 v1, v0, -0x1

    invoke-virtual {p1, v1}, Landroid/text/StaticLayout;->getLineBottom(I)I

    move-result v1

    add-int/lit8 v2, v0, -0x1

    invoke-virtual {p1, v2}, Landroid/text/StaticLayout;->getLineTop(I)I

    move-result v2

    sub-int/2addr v1, v2

    iput v1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->lineHeight:I

    .line 44
    .end local v0    # "lineCount":I
    :cond_29
    return-void
.end method

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

    .line 51
    iput-boolean p1, p0, Lim/tpelyyftgw/ui/components/LinkPath;->useRoundRect:Z

    .line 52
    return-void
.end method