.class public Lcom/moji/camera/view/CameraShadow;
.super Landroid/view/View;
.source "CameraShadow.java"


# instance fields
.field private final a:Landroid/graphics/Paint;

.field private final b:Landroid/graphics/Paint;

.field private final c:Landroid/graphics/PorterDuffXfermode;

.field private final d:Landroid/graphics/Rect;

.field private e:I

.field private f:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    .line 43
    invoke-direct {p0, p1, v0}, Lcom/moji/camera/view/CameraShadow;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    const/4 v0, 0x0

    .line 47
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/camera/view/CameraShadow;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 3
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    .line 58
    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 59
    new-instance p1, Landroid/graphics/Paint;

    const/4 p2, 0x1

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

    iput-object p1, p0, Lcom/moji/camera/view/CameraShadow;->a:Landroid/graphics/Paint;

    .line 60
    new-instance p1, Landroid/graphics/Paint;

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

    iput-object p1, p0, Lcom/moji/camera/view/CameraShadow;->b:Landroid/graphics/Paint;

    .line 61
    new-instance p1, Landroid/graphics/PorterDuffXfermode;

    sget-object p2, Landroid/graphics/PorterDuff$Mode;->CLEAR:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {p1, p2}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    iput-object p1, p0, Lcom/moji/camera/view/CameraShadow;->c:Landroid/graphics/PorterDuffXfermode;

    .line 62
    iget-object p1, p0, Lcom/moji/camera/view/CameraShadow;->a:Landroid/graphics/Paint;

    sget p2, Lcom/moji/camera/R$color;->camera_shadow:I

    invoke-static {p2}, Lcom/moji/tool/DeviceTool;->e(I)I

    move-result p2

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

    const/high16 p1, 0x40800000    # 4.0f

    .line 64
    invoke-static {p1}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result p1

    .line 65
    sget p2, Lcom/moji/camera/R$dimen;->clip_top:I

    invoke-static {p2}, Lcom/moji/tool/DeviceTool;->a(I)F

    move-result p2

    float-to-int p2, p2

    add-int/2addr p2, p1

    int-to-float p2, p2

    .line 66
    sget p3, Lcom/moji/camera/R$dimen;->camera_margin:I

    invoke-static {p3}, Lcom/moji/tool/DeviceTool;->a(I)F

    move-result p3

    int-to-float p1, p1

    add-float/2addr p3, p1

    .line 67
    invoke-static {}, Lcom/moji/tool/DeviceTool;->b()I

    move-result p1

    int-to-float p1, p1

    const/high16 v0, 0x40000000    # 2.0f

    mul-float v0, v0, p3

    sub-float/2addr p1, v0

    .line 69
    new-instance v0, Landroid/graphics/Rect;

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

    iput-object v0, p0, Lcom/moji/camera/view/CameraShadow;->d:Landroid/graphics/Rect;

    .line 70
    iget-object v0, p0, Lcom/moji/camera/view/CameraShadow;->d:Landroid/graphics/Rect;

    float-to-int v1, p3

    float-to-int v2, p2

    add-float/2addr p3, p1

    float-to-int p3, p3

    add-float/2addr p2, p1

    float-to-int p1, p2

    const/high16 p2, 0x3f800000    # 1.0f

    invoke-static {p2}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result p2

    sub-int/2addr p1, p2

    invoke-virtual {v0, v1, v2, p3, p1}, Landroid/graphics/Rect;->set(IIII)V

    return-void
.end method


# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 8

    .line 32
    invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V

    .line 33
    invoke-virtual {p1}, Landroid/graphics/Canvas;->getWidth()I

    move-result v0

    int-to-float v4, v0

    invoke-virtual {p1}, Landroid/graphics/Canvas;->getHeight()I

    move-result v0

    int-to-float v5, v0

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v6, 0x0

    const/16 v7, 0x1f

    move-object v1, p1

    invoke-virtual/range {v1 .. v7}, Landroid/graphics/Canvas;->saveLayer(FFFFLandroid/graphics/Paint;I)I

    move-result v0

    .line 34
    iget v1, p0, Lcom/moji/camera/view/CameraShadow;->e:I

    int-to-float v5, v1

    iget v1, p0, Lcom/moji/camera/view/CameraShadow;->f:I

    int-to-float v6, v1

    iget-object v7, p0, Lcom/moji/camera/view/CameraShadow;->a:Landroid/graphics/Paint;

    const/4 v4, 0x0

    move-object v2, p1

    invoke-virtual/range {v2 .. v7}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    .line 35
    iget-object v1, p0, Lcom/moji/camera/view/CameraShadow;->b:Landroid/graphics/Paint;

    const v2, -0xff0100

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

    .line 36
    iget-object v1, p0, Lcom/moji/camera/view/CameraShadow;->b:Landroid/graphics/Paint;

    iget-object v2, p0, Lcom/moji/camera/view/CameraShadow;->c:Landroid/graphics/PorterDuffXfermode;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 37
    iget-object v1, p0, Lcom/moji/camera/view/CameraShadow;->d:Landroid/graphics/Rect;

    iget-object v2, p0, Lcom/moji/camera/view/CameraShadow;->b:Landroid/graphics/Paint;

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

    .line 38
    iget-object v1, p0, Lcom/moji/camera/view/CameraShadow;->b:Landroid/graphics/Paint;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    .line 39
    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V

    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 0

    .line 52
    invoke-super {p0, p1, p2, p3, p4}, Landroid/view/View;->onSizeChanged(IIII)V

    .line 53
    iput p1, p0, Lcom/moji/camera/view/CameraShadow;->e:I

    .line 54
    iput p2, p0, Lcom/moji/camera/view/CameraShadow;->f:I

    return-void
.end method
