.class public Lcom/moji/crop/RectView;
.super Landroid/view/View;
.source "RectView.java"


# instance fields
.field private a:I

.field private b:I

.field private c:Landroid/graphics/Rect;

.field private d:Landroid/graphics/drawable/NinePatchDrawable;

.field private e:I


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

    const/4 v0, 0x0

    .line 39
    invoke-direct {p0, p1, v0}, Lcom/moji/crop/RectView;-><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 43
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/crop/RectView;-><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 2
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

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

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

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

    move-result p1

    float-to-int p1, p1

    iput p1, p0, Lcom/moji/crop/RectView;->a:I

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

    move-result p1

    iput p1, p0, Lcom/moji/crop/RectView;->e:I

    .line 50
    iget p1, p0, Lcom/moji/crop/RectView;->e:I

    iget p2, p0, Lcom/moji/crop/RectView;->a:I

    mul-int/lit8 p2, p2, 0x2

    sub-int/2addr p1, p2

    iput p1, p0, Lcom/moji/crop/RectView;->b:I

    .line 51
    new-instance p1, Landroid/graphics/Rect;

    iget p2, p0, Lcom/moji/crop/RectView;->a:I

    iget p3, p0, Lcom/moji/crop/RectView;->a:I

    iget v0, p0, Lcom/moji/crop/RectView;->b:I

    add-int/2addr p3, v0

    iget v0, p0, Lcom/moji/crop/RectView;->b:I

    const/4 v1, 0x0

    invoke-direct {p1, p2, v1, p3, v0}, Landroid/graphics/Rect;-><init>(IIII)V

    iput-object p1, p0, Lcom/moji/crop/RectView;->c:Landroid/graphics/Rect;

    .line 53
    sget p1, Lcom/moji/camera/R$drawable;->camera_line:I

    invoke-static {p1}, Lcom/moji/tool/DeviceTool;->c(I)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    check-cast p1, Landroid/graphics/drawable/NinePatchDrawable;

    iput-object p1, p0, Lcom/moji/crop/RectView;->d:Landroid/graphics/drawable/NinePatchDrawable;

    .line 54
    iget-object p1, p0, Lcom/moji/crop/RectView;->d:Landroid/graphics/drawable/NinePatchDrawable;

    iget-object p2, p0, Lcom/moji/crop/RectView;->c:Landroid/graphics/Rect;

    invoke-virtual {p1, p2}, Landroid/graphics/drawable/NinePatchDrawable;->setBounds(Landroid/graphics/Rect;)V

    return-void
.end method


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

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

    .line 29
    iget-object v0, p0, Lcom/moji/crop/RectView;->d:Landroid/graphics/drawable/NinePatchDrawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/NinePatchDrawable;->draw(Landroid/graphics/Canvas;)V

    return-void
.end method

.method protected onMeasure(II)V
    .locals 0

    .line 35
    iget p1, p0, Lcom/moji/crop/RectView;->e:I

    iget p2, p0, Lcom/moji/crop/RectView;->b:I

    invoke-virtual {p0, p1, p2}, Lcom/moji/crop/RectView;->setMeasuredDimension(II)V

    return-void
.end method
