RevealDrawable.smali

.class public Lcom/rey/material/drawable/RevealDrawable;
.super Landroid/graphics/drawable/Drawable;
.source "RevealDrawable.java"

# interfaces
.implements Landroid/graphics/drawable/Animatable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;
    }
.end annotation


# static fields
.field private static final GRADIENT_RADIUS:F = 16.0f

.field private static final GRADIENT_STOPS:[F


# instance fields
.field private mAnimProgress:F

.field private mCurColor:I

.field private mCurColorTransparent:Z

.field private mCurTask:I

.field private mFillPaint:Landroid/graphics/Paint;

.field private mMatrix:Landroid/graphics/Matrix;

.field private mMaxRadius:F

.field private mNextColorTransparent:Z

.field private mRect:Landroid/graphics/RectF;

.field private mRunning:Z

.field private mShader:Landroid/graphics/RadialGradient;

.field private mShaderPaint:Landroid/graphics/Paint;

.field private mStartTime:J

.field private mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

.field private final mUpdater:Ljava/lang/Runnable;


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

    const/4 v0, 0x3

    new-array v0, v0, [F

    .line 42
    fill-array-data v0, :array_a

    sput-object v0, Lcom/rey/material/drawable/RevealDrawable;->GRADIENT_STOPS:[F

    return-void

    nop

    :array_a
    .array-data 4
        0x0
        0x3f7d70a4    # 0.99f
        0x3f800000    # 1.0f
    .end array-data
.end method

.method public constructor <init>(I)V
    .registers 5

    .line 45
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable;-><init>()V

    const/4 v0, 0x0

    .line 24
    iput-boolean v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mRunning:Z

    .line 243
    new-instance v0, Lcom/rey/material/drawable/RevealDrawable$1;

    invoke-direct {v0, p0}, Lcom/rey/material/drawable/RevealDrawable$1;-><init>(Lcom/rey/material/drawable/RevealDrawable;)V

    iput-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mUpdater:Ljava/lang/Runnable;

    .line 46
    new-instance v0, Landroid/graphics/Paint;

    const/4 v1, 0x1

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

    iput-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mShaderPaint:Landroid/graphics/Paint;

    .line 47
    sget-object v2, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 49
    new-instance v0, Landroid/graphics/Paint;

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

    iput-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

    .line 50
    sget-object v1, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 52
    iput p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    .line 54
    new-instance p1, Landroid/graphics/RectF;

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

    iput-object p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mRect:Landroid/graphics/RectF;

    .line 56
    new-instance p1, Landroid/graphics/Matrix;

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

    iput-object p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mMatrix:Landroid/graphics/Matrix;

    return-void
.end method

.method static synthetic access$000(Lcom/rey/material/drawable/RevealDrawable;)V
    .registers 1

    .line 22
    invoke-direct {p0}, Lcom/rey/material/drawable/RevealDrawable;->update()V

    return-void
.end method

.method private fillCanvas(Landroid/graphics/Canvas;IZ)V
    .registers 4

    if-eqz p3, :cond_3

    return-void

    .line 97
    :cond_3
    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

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

    .line 98
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->getBounds()Landroid/graphics/Rect;

    move-result-object p2

    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

    invoke-virtual {p1, p2, p3}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    return-void
.end method

.method private fillCanvasWithHole(Landroid/graphics/Canvas;Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;FZ)V
    .registers 7

    if-eqz p4, :cond_3

    return-void

    :cond_3
    const/high16 p4, 0x41800000    # 16.0f

    div-float/2addr p3, p4

    .line 107
    iget-object p4, p0, Lcom/rey/material/drawable/RevealDrawable;->mMatrix:Landroid/graphics/Matrix;

    invoke-virtual {p4}, Landroid/graphics/Matrix;->reset()V

    .line 108
    iget-object p4, p0, Lcom/rey/material/drawable/RevealDrawable;->mMatrix:Landroid/graphics/Matrix;

    iget v0, p2, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget v1, p2, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    invoke-virtual {p4, p3, p3, v0, v1}, Landroid/graphics/Matrix;->postScale(FFFF)Z

    .line 109
    invoke-direct {p0, p2}, Lcom/rey/material/drawable/RevealDrawable;->getShader(Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;)Landroid/graphics/RadialGradient;

    move-result-object p2

    .line 110
    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mMatrix:Landroid/graphics/Matrix;

    invoke-virtual {p2, p3}, Landroid/graphics/RadialGradient;->setLocalMatrix(Landroid/graphics/Matrix;)V

    .line 111
    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mShaderPaint:Landroid/graphics/Paint;

    invoke-virtual {p3, p2}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    .line 112
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->getBounds()Landroid/graphics/Rect;

    move-result-object p2

    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mShaderPaint:Landroid/graphics/Paint;

    invoke-virtual {p1, p2, p3}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    return-void
.end method

.method private fillCircle(Landroid/graphics/Canvas;FFFIZ)V
    .registers 8

    if-eqz p6, :cond_3

    return-void

    .line 119
    :cond_3
    iget-object p6, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

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

    .line 120
    iget-object p5, p0, Lcom/rey/material/drawable/RevealDrawable;->mRect:Landroid/graphics/RectF;

    sub-float p6, p2, p4

    sub-float v0, p3, p4

    add-float/2addr p2, p4

    add-float/2addr p3, p4

    invoke-virtual {p5, p6, v0, p2, p3}, Landroid/graphics/RectF;->set(FFFF)V

    .line 121
    iget-object p2, p0, Lcom/rey/material/drawable/RevealDrawable;->mRect:Landroid/graphics/RectF;

    iget-object p3, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

    invoke-virtual {p1, p2, p3}, Landroid/graphics/Canvas;->drawOval(Landroid/graphics/RectF;Landroid/graphics/Paint;)V

    return-void
.end method

.method private getMaxRadius(FFLandroid/graphics/Rect;)F
    .registers 8

    .line 72
    invoke-virtual {p3}, Landroid/graphics/Rect;->centerX()I

    move-result v0

    int-to-float v0, v0

    cmpg-float v0, p1, v0

    if-gez v0, :cond_c

    iget v0, p3, Landroid/graphics/Rect;->right:I

    goto :goto_e

    :cond_c
    iget v0, p3, Landroid/graphics/Rect;->left:I

    :goto_e
    int-to-float v0, v0

    .line 73
    invoke-virtual {p3}, Landroid/graphics/Rect;->centerY()I

    move-result v1

    int-to-float v1, v1

    cmpg-float v1, p2, v1

    if-gez v1, :cond_1b

    iget p3, p3, Landroid/graphics/Rect;->bottom:I

    goto :goto_1d

    :cond_1b
    iget p3, p3, Landroid/graphics/Rect;->top:I

    :goto_1d
    int-to-float p3, p3

    sub-float/2addr v0, p1

    float-to-double v0, v0

    const-wide/high16 v2, 0x4000000000000000L    # 2.0

    .line 75
    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v0

    sub-float/2addr p3, p2

    float-to-double p1, p3

    invoke-static {p1, p2, v2, v3}, Ljava/lang/Math;->pow(DD)D

    move-result-wide p1

    add-double/2addr v0, p1

    invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide p1

    double-to-float p1, p1

    return p1
.end method

.method private getShader(Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;)Landroid/graphics/RadialGradient;
    .registers 15

    .line 79
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mShader:Landroid/graphics/RadialGradient;

    if-nez v0, :cond_52

    .line 80
    iget-boolean v0, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->isOut:Z

    const/4 v1, 0x2

    const/4 v2, 0x1

    const/4 v3, 0x3

    const/4 v4, 0x0

    const/4 v5, 0x0

    if-eqz v0, :cond_30

    .line 81
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    invoke-static {v0, v4}, Lcom/rey/material/util/ColorUtil;->getColor(IF)I

    move-result v0

    .line 82
    new-instance v4, Landroid/graphics/RadialGradient;

    iget v7, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget v8, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    const/high16 v9, 0x41800000    # 16.0f

    new-array v10, v3, [I

    aput v5, v10, v5

    aput v0, v10, v2

    iget p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    aput p1, v10, v1

    sget-object v11, Lcom/rey/material/drawable/RevealDrawable;->GRADIENT_STOPS:[F

    sget-object v12, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    move-object v6, v4

    invoke-direct/range {v6 .. v12}, Landroid/graphics/RadialGradient;-><init>(FFF[I[FLandroid/graphics/Shader$TileMode;)V

    iput-object v4, p0, Lcom/rey/material/drawable/RevealDrawable;->mShader:Landroid/graphics/RadialGradient;

    goto :goto_52

    .line 85
    :cond_30
    iget v0, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    invoke-static {v0, v4}, Lcom/rey/material/util/ColorUtil;->getColor(IF)I

    move-result v0

    .line 86
    new-instance v4, Landroid/graphics/RadialGradient;

    iget v7, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget v8, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    const/high16 v9, 0x41800000    # 16.0f

    new-array v10, v3, [I

    aput v5, v10, v5

    aput v0, v10, v2

    iget p1, p1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    aput p1, v10, v1

    sget-object v11, Lcom/rey/material/drawable/RevealDrawable;->GRADIENT_STOPS:[F

    sget-object v12, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    move-object v6, v4

    invoke-direct/range {v6 .. v12}, Landroid/graphics/RadialGradient;-><init>(FFF[I[FLandroid/graphics/Shader$TileMode;)V

    iput-object v4, p0, Lcom/rey/material/drawable/RevealDrawable;->mShader:Landroid/graphics/RadialGradient;

    .line 90
    :cond_52
    :goto_52
    iget-object p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mShader:Landroid/graphics/RadialGradient;

    return-object p1
.end method

.method private resetAnimation()V
    .registers 5

    .line 202
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mStartTime:J

    const/4 v0, 0x0

    .line 203
    iput v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mAnimProgress:F

    .line 204
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    invoke-static {v0}, Landroid/graphics/Color;->alpha(I)I

    move-result v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-nez v0, :cond_15

    const/4 v0, 0x1

    goto :goto_16

    :cond_15
    const/4 v0, 0x0

    :goto_16
    iput-boolean v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    .line 205
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v0, v0, v3

    iget v0, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    invoke-static {v0}, Landroid/graphics/Color;->alpha(I)I

    move-result v0

    if-nez v0, :cond_27

    goto :goto_28

    :cond_27
    const/4 v1, 0x0

    :goto_28
    iput-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mNextColorTransparent:Z

    .line 206
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v0, v0, v1

    iget v0, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget-object v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v2, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v1, v1, v2

    iget v1, v1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v2

    invoke-direct {p0, v0, v1, v2}, Lcom/rey/material/drawable/RevealDrawable;->getMaxRadius(FFLandroid/graphics/Rect;)F

    move-result v0

    iput v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mMaxRadius:F

    const/4 v0, 0x0

    .line 207
    iput-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mShader:Landroid/graphics/RadialGradient;

    return-void
.end method

.method private update()V
    .registers 6

    .line 253
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v0

    .line 254
    const-class v2, Lcom/rey/material/drawable/RevealDrawable;

    monitor-enter v2

    .line 255
    :try_start_7
    iget-wide v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mStartTime:J

    sub-long/2addr v0, v3

    long-to-float v0, v0

    iget-object v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v1, v1, v3

    iget v1, v1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->duration:I

    int-to-float v1, v1

    div-float/2addr v0, v1

    const/high16 v1, 0x3f800000    # 1.0f

    invoke-static {v1, v0}, Ljava/lang/Math;->min(FF)F

    move-result v0

    iput v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mAnimProgress:F

    cmpl-float v0, v0, v1

    if-nez v0, :cond_5a

    .line 258
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v0, v0, v1

    iget v0, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    invoke-virtual {p0, v0}, Lcom/rey/material/drawable/RevealDrawable;->setCurColor(I)V

    .line 259
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    :goto_32
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    iget-object v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    array-length v1, v1

    if-ge v0, v1, :cond_50

    .line 260
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v0, v0, v1

    iget v0, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    if-eq v0, v1, :cond_49

    .line 261
    invoke-direct {p0}, Lcom/rey/material/drawable/RevealDrawable;->resetAnimation()V

    goto :goto_50

    .line 259
    :cond_49
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    goto :goto_32

    .line 265
    :cond_50
    :goto_50
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    iget-object v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    array-length v1, v1

    if-ne v0, v1, :cond_5a

    .line 266
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->stop()V

    .line 268
    :cond_5a
    monitor-exit v2
    :try_end_5b
    .catchall {:try_start_7 .. :try_end_5b} :catchall_71

    .line 270
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->invalidateSelf()V

    .line 272
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->isRunning()Z

    move-result v0

    if-eqz v0, :cond_70

    .line 273
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mUpdater:Ljava/lang/Runnable;

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v1

    const-wide/16 v3, 0x10

    add-long/2addr v1, v3

    invoke-virtual {p0, v0, v1, v2}, Lcom/rey/material/drawable/RevealDrawable;->scheduleSelf(Ljava/lang/Runnable;J)V

    :cond_70
    return-void

    :catchall_71
    move-exception v0

    .line 268
    :try_start_72
    monitor-exit v2
    :try_end_73
    .catchall {:try_start_72 .. :try_end_73} :catchall_71

    throw v0
.end method


# virtual methods
.method public changeColor(IILandroid/view/animation/Interpolator;FFZ)V
    .registers 16

    const/4 v0, 0x1

    new-array v0, v0, [Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    .line 159
    new-instance v8, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    move-object v1, v8

    move v2, p1

    move v3, p2

    move-object v4, p3

    move v5, p4

    move v6, p5

    move v7, p6

    invoke-direct/range {v1 .. v7}, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;-><init>(IILandroid/view/animation/Interpolator;FFZ)V

    const/4 p1, 0x0

    aput-object v8, v0, p1

    invoke-virtual {p0, v0}, Lcom/rey/material/drawable/RevealDrawable;->changeColor([Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;)V

    return-void
.end method

.method public varargs changeColor([Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;)V
    .registers 8

    .line 163
    const-class v0, Lcom/rey/material/drawable/RevealDrawable;

    monitor-enter v0

    .line 164
    :try_start_3
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->isRunning()Z

    move-result v1

    const/4 v2, 0x0

    if-nez v1, :cond_20

    .line 165
    :goto_a
    array-length v1, p1

    if-ge v2, v1, :cond_39

    .line 166
    aget-object v1, p1, v2

    iget v1, v1, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    iget v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    if-eq v1, v3, :cond_1d

    .line 167
    iput v2, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    .line 168
    iput-object p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    .line 169
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->start()V

    goto :goto_39

    :cond_1d
    add-int/lit8 v2, v2, 0x1

    goto :goto_a

    .line 174
    :cond_20
    iget-object v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    array-length v1, v1

    iget v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    sub-int/2addr v1, v3

    .line 175
    array-length v3, p1

    add-int/2addr v3, v1

    new-array v3, v3, [Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    .line 176
    iget-object v4, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v5, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    invoke-static {v4, v5, v3, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 177
    array-length v4, p1

    invoke-static {p1, v2, v3, v1, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 178
    iput-object v3, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    .line 179
    iput v2, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    .line 181
    :cond_39
    :goto_39
    monitor-exit v0

    return-void

    :catchall_3b
    move-exception p1

    monitor-exit v0
    :try_end_3d
    .catchall {:try_start_3 .. :try_end_3d} :catchall_3b

    throw p1
.end method

.method public draw(Landroid/graphics/Canvas;)V
    .registers 13

    .line 126
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->isRunning()Z

    move-result v0

    if-nez v0, :cond_f

    .line 127
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    iget-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    invoke-direct {p0, p1, v0, v1}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvas(Landroid/graphics/Canvas;IZ)V

    goto/16 :goto_96

    .line 129
    :cond_f
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurTask:I

    aget-object v0, v0, v1

    .line 131
    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mAnimProgress:F

    const/4 v2, 0x0

    cmpl-float v2, v1, v2

    if-nez v2, :cond_25

    .line 132
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    iget-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    invoke-direct {p0, p1, v0, v1}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvas(Landroid/graphics/Canvas;IZ)V

    goto/16 :goto_96

    :cond_25
    const/high16 v2, 0x3f800000    # 1.0f

    cmpl-float v1, v1, v2

    if-nez v1, :cond_33

    .line 134
    iget v0, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    iget-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mNextColorTransparent:Z

    invoke-direct {p0, p1, v0, v1}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvas(Landroid/graphics/Canvas;IZ)V

    goto :goto_96

    .line 135
    :cond_33
    iget-boolean v1, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->isOut:Z

    const/16 v2, 0xff

    if-eqz v1, :cond_68

    .line 136
    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mMaxRadius:F

    iget-object v3, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->interpolator:Landroid/view/animation/Interpolator;

    iget v4, p0, Lcom/rey/material/drawable/RevealDrawable;->mAnimProgress:F

    invoke-interface {v3, v4}, Landroid/view/animation/Interpolator;->getInterpolation(F)F

    move-result v3

    mul-float v8, v1, v3

    .line 138
    iget v1, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    invoke-static {v1}, Landroid/graphics/Color;->alpha(I)I

    move-result v1

    if-ne v1, v2, :cond_55

    .line 139
    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    iget-boolean v2, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    invoke-direct {p0, p1, v1, v2}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvas(Landroid/graphics/Canvas;IZ)V

    goto :goto_5a

    .line 141
    :cond_55
    iget-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    invoke-direct {p0, p1, v0, v8, v1}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvasWithHole(Landroid/graphics/Canvas;Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;FZ)V

    .line 143
    :goto_5a
    iget v6, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget v7, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    iget v9, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    iget-boolean v10, p0, Lcom/rey/material/drawable/RevealDrawable;->mNextColorTransparent:Z

    move-object v4, p0

    move-object v5, p1

    invoke-direct/range {v4 .. v10}, Lcom/rey/material/drawable/RevealDrawable;->fillCircle(Landroid/graphics/Canvas;FFFIZ)V

    goto :goto_96

    .line 146
    :cond_68
    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mMaxRadius:F

    iget-object v3, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->interpolator:Landroid/view/animation/Interpolator;

    iget v4, p0, Lcom/rey/material/drawable/RevealDrawable;->mAnimProgress:F

    invoke-interface {v3, v4}, Landroid/view/animation/Interpolator;->getInterpolation(F)F

    move-result v3

    mul-float v8, v1, v3

    .line 148
    iget v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    invoke-static {v1}, Landroid/graphics/Color;->alpha(I)I

    move-result v1

    if-ne v1, v2, :cond_84

    .line 149
    iget v1, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->color:I

    iget-boolean v2, p0, Lcom/rey/material/drawable/RevealDrawable;->mNextColorTransparent:Z

    invoke-direct {p0, p1, v1, v2}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvas(Landroid/graphics/Canvas;IZ)V

    goto :goto_89

    .line 151
    :cond_84
    iget-boolean v1, p0, Lcom/rey/material/drawable/RevealDrawable;->mNextColorTransparent:Z

    invoke-direct {p0, p1, v0, v8, v1}, Lcom/rey/material/drawable/RevealDrawable;->fillCanvasWithHole(Landroid/graphics/Canvas;Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;FZ)V

    .line 153
    :goto_89
    iget v6, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->x:F

    iget v7, v0, Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;->y:F

    iget v9, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    iget-boolean v10, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    move-object v4, p0

    move-object v5, p1

    invoke-direct/range {v4 .. v10}, Lcom/rey/material/drawable/RevealDrawable;->fillCircle(Landroid/graphics/Canvas;FFFIZ)V

    :goto_96
    return-void
.end method

.method public getCurColor()I
    .registers 2

    .line 60
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    return v0
.end method

.method public getOpacity()I
    .registers 2

    const/4 v0, -0x3

    return v0
.end method

.method public isRunning()Z
    .registers 2

    .line 234
    iget-boolean v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mRunning:Z

    return v0
.end method

.method public scheduleSelf(Ljava/lang/Runnable;J)V
    .registers 5

    const/4 v0, 0x1

    .line 239
    iput-boolean v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mRunning:Z

    .line 240
    invoke-super {p0, p1, p2, p3}, Landroid/graphics/drawable/Drawable;->scheduleSelf(Ljava/lang/Runnable;J)V

    return-void
.end method

.method public setAlpha(I)V
    .registers 3

    .line 186
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mShaderPaint:Landroid/graphics/Paint;

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

    .line 187
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

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

    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .registers 3

    .line 192
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mShaderPaint:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColorFilter(Landroid/graphics/ColorFilter;)Landroid/graphics/ColorFilter;

    .line 193
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mFillPaint:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColorFilter(Landroid/graphics/ColorFilter;)Landroid/graphics/ColorFilter;

    return-void
.end method

.method public setCurColor(I)V
    .registers 3

    .line 64
    iget v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    if-eq v0, p1, :cond_14

    .line 65
    iput p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColor:I

    .line 66
    invoke-static {p1}, Landroid/graphics/Color;->alpha(I)I

    move-result p1

    if-nez p1, :cond_e

    const/4 p1, 0x1

    goto :goto_f

    :cond_e
    const/4 p1, 0x0

    :goto_f
    iput-boolean p1, p0, Lcom/rey/material/drawable/RevealDrawable;->mCurColorTransparent:Z

    .line 67
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->invalidateSelf()V

    :cond_14
    return-void
.end method

.method public start()V
    .registers 6

    .line 212
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->isRunning()Z

    move-result v0

    if-eqz v0, :cond_7

    return-void

    .line 215
    :cond_7
    invoke-direct {p0}, Lcom/rey/material/drawable/RevealDrawable;->resetAnimation()V

    .line 217
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mUpdater:Ljava/lang/Runnable;

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v1

    const-wide/16 v3, 0x10

    add-long/2addr v1, v3

    invoke-virtual {p0, v0, v1, v2}, Lcom/rey/material/drawable/RevealDrawable;->scheduleSelf(Ljava/lang/Runnable;J)V

    .line 218
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->invalidateSelf()V

    return-void
.end method

.method public stop()V
    .registers 2

    .line 223
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->isRunning()Z

    move-result v0

    if-nez v0, :cond_7

    return-void

    :cond_7
    const/4 v0, 0x0

    .line 226
    iput-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mTasks:[Lcom/rey/material/drawable/RevealDrawable$ColorChangeTask;

    const/4 v0, 0x0

    .line 227
    iput-boolean v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mRunning:Z

    .line 228
    iget-object v0, p0, Lcom/rey/material/drawable/RevealDrawable;->mUpdater:Ljava/lang/Runnable;

    invoke-virtual {p0, v0}, Lcom/rey/material/drawable/RevealDrawable;->unscheduleSelf(Ljava/lang/Runnable;)V

    .line 229
    invoke-virtual {p0}, Lcom/rey/material/drawable/RevealDrawable;->invalidateSelf()V

    return-void
.end method