1559 lines
37 KiB
Smali
1559 lines
37 KiB
Smali
.class public Lcom/yalantis/ucrop/view/OverlayView;
|
|
.super Landroid/view/View;
|
|
.source "OverlayView.java"
|
|
|
|
|
|
# instance fields
|
|
.field private final IR:Landroid/graphics/RectF;
|
|
|
|
.field private final aWC:Landroid/graphics/RectF;
|
|
|
|
.field protected aWD:I
|
|
|
|
.field protected aWE:I
|
|
|
|
.field protected aWF:[F
|
|
|
|
.field protected aWG:[F
|
|
|
|
.field aWH:I
|
|
|
|
.field aWI:I
|
|
|
|
.field private aWJ:[F
|
|
|
|
.field aWK:Z
|
|
|
|
.field aWL:Z
|
|
|
|
.field aWM:Z
|
|
|
|
.field aWN:I
|
|
|
|
.field private aWO:Landroid/graphics/Path;
|
|
|
|
.field aWP:Landroid/graphics/Paint;
|
|
|
|
.field aWQ:Landroid/graphics/Paint;
|
|
|
|
.field aWR:Landroid/graphics/Paint;
|
|
|
|
.field aWS:Landroid/graphics/Paint;
|
|
|
|
.field private aWT:I
|
|
|
|
.field private aWU:F
|
|
|
|
.field private aWV:F
|
|
|
|
.field private aWW:I
|
|
|
|
.field private aWX:I
|
|
|
|
.field private aWY:I
|
|
|
|
.field private aWZ:I
|
|
|
|
.field private aWb:F
|
|
|
|
.field private aXa:Lcom/yalantis/ucrop/a/d;
|
|
|
|
.field private aXb:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/yalantis/ucrop/view/OverlayView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;B)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;B)V
|
|
.locals 1
|
|
|
|
const/4 p3, 0x0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
new-instance p1, Landroid/graphics/RectF;
|
|
|
|
invoke-direct {p1}, Landroid/graphics/RectF;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
new-instance p1, Landroid/graphics/RectF;
|
|
|
|
invoke-direct {p1}, Landroid/graphics/RectF;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
new-instance p2, Landroid/graphics/Path;
|
|
|
|
invoke-direct {p2}, Landroid/graphics/Path;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWO:Landroid/graphics/Path;
|
|
|
|
new-instance p2, Landroid/graphics/Paint;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p2, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWP:Landroid/graphics/Paint;
|
|
|
|
new-instance p2, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {p2, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWQ:Landroid/graphics/Paint;
|
|
|
|
new-instance p2, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {p2, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWR:Landroid/graphics/Paint;
|
|
|
|
new-instance p2, Landroid/graphics/Paint;
|
|
|
|
invoke-direct {p2, v0}, Landroid/graphics/Paint;-><init>(I)V
|
|
|
|
iput-object p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWS:Landroid/graphics/Paint;
|
|
|
|
iput p3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
const/high16 p2, -0x40800000 # -1.0f
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
const/4 p2, -0x1
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
sget p3, Lcom/yalantis/ucrop/R$b;->ucrop_default_crop_rect_corner_touch_threshold:I
|
|
|
|
invoke-virtual {p2, p3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWX:I
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
sget p3, Lcom/yalantis/ucrop/R$b;->ucrop_default_crop_rect_min_size:I
|
|
|
|
invoke-virtual {p2, p3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWY:I
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
sget p3, Lcom/yalantis/ucrop/R$b;->ucrop_default_crop_rect_corner_touch_area_line_length:I
|
|
|
|
invoke-virtual {p2, p3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWZ:I
|
|
|
|
sget p2, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 p3, 0x12
|
|
|
|
if-ge p2, p3, :cond_0
|
|
|
|
invoke-virtual {p0, v0, p1}, Lcom/yalantis/ucrop/view/OverlayView;->setLayerType(ILandroid/graphics/Paint;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private wx()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-static {v0}, Lcom/yalantis/ucrop/c/g;->h(Landroid/graphics/RectF;)[F
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWF:[F
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-static {v0}, Lcom/yalantis/ucrop/c/g;->i(Landroid/graphics/RectF;)[F
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWG:[F
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWO:Landroid/graphics/Path;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Path;->reset()V
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWO:Landroid/graphics/Path;
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v1}, Landroid/graphics/RectF;->centerX()F
|
|
|
|
move-result v1
|
|
|
|
iget-object v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v2}, Landroid/graphics/RectF;->centerY()F
|
|
|
|
move-result v2
|
|
|
|
iget-object v3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v3}, Landroid/graphics/RectF;->width()F
|
|
|
|
move-result v3
|
|
|
|
iget-object v4, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v4}, Landroid/graphics/RectF;->height()F
|
|
|
|
move-result v4
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v3
|
|
|
|
const/high16 v4, 0x40000000 # 2.0f
|
|
|
|
div-float/2addr v3, v4
|
|
|
|
sget-object v4, Landroid/graphics/Path$Direction;->CW:Landroid/graphics/Path$Direction;
|
|
|
|
invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Path;->addCircle(FFFLandroid/graphics/Path$Direction;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getCropViewRect()Landroid/graphics/RectF;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getFreestyleCropMode()I
|
|
.locals 1
|
|
|
|
iget v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getOverlayViewChangeListener()Lcom/yalantis/ucrop/a/d;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXa:Lcom/yalantis/ucrop/a/d;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method protected onDraw(Landroid/graphics/Canvas;)V
|
|
.locals 8
|
|
|
|
invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
|
|
|
|
iget-boolean v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWM:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWO:Landroid/graphics/Path;
|
|
|
|
sget-object v1, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->clipPath(Landroid/graphics/Path;Landroid/graphics/Region$Op;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
sget-object v1, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/RectF;Landroid/graphics/Region$Op;)Z
|
|
|
|
:goto_0
|
|
iget v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWN:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->drawColor(I)V
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V
|
|
|
|
iget-boolean v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWM:Z
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/RectF;->centerX()F
|
|
|
|
move-result v0
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v1}, Landroid/graphics/RectF;->centerY()F
|
|
|
|
move-result v1
|
|
|
|
iget-object v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v2}, Landroid/graphics/RectF;->width()F
|
|
|
|
move-result v2
|
|
|
|
iget-object v3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v3}, Landroid/graphics/RectF;->height()F
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v2
|
|
|
|
const/high16 v3, 0x40000000 # 2.0f
|
|
|
|
div-float/2addr v2, v3
|
|
|
|
iget-object v3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWP:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V
|
|
|
|
:cond_1
|
|
iget-boolean v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWL:Z
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/RectF;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
iget v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWH:I
|
|
|
|
mul-int/lit8 v0, v0, 0x4
|
|
|
|
iget v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWI:I
|
|
|
|
mul-int/lit8 v1, v1, 0x4
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
new-array v0, v0, [F
|
|
|
|
iput-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_1
|
|
iget v3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWH:I
|
|
|
|
const/high16 v4, 0x3f800000 # 1.0f
|
|
|
|
if-ge v1, v3, :cond_2
|
|
|
|
iget-object v3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v5, v2, 0x1
|
|
|
|
iget-object v6, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->left:F
|
|
|
|
aput v6, v3, v2
|
|
|
|
iget-object v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v3, v5, 0x1
|
|
|
|
iget-object v6, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v6}, Landroid/graphics/RectF;->height()F
|
|
|
|
move-result v6
|
|
|
|
int-to-float v7, v1
|
|
|
|
add-float/2addr v7, v4
|
|
|
|
iget v4, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWH:I
|
|
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
int-to-float v4, v4
|
|
|
|
div-float v4, v7, v4
|
|
|
|
mul-float v6, v6, v4
|
|
|
|
iget-object v4, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v4, v4, Landroid/graphics/RectF;->top:F
|
|
|
|
add-float/2addr v6, v4
|
|
|
|
aput v6, v2, v5
|
|
|
|
iget-object v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v4, v3, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->right:F
|
|
|
|
aput v5, v2, v3
|
|
|
|
iget-object v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v3, v4, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v5}, Landroid/graphics/RectF;->height()F
|
|
|
|
move-result v5
|
|
|
|
iget v6, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWH:I
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
int-to-float v6, v6
|
|
|
|
div-float/2addr v7, v6
|
|
|
|
mul-float v5, v5, v7
|
|
|
|
iget-object v6, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->top:F
|
|
|
|
add-float/2addr v5, v6
|
|
|
|
aput v5, v2, v4
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
move v2, v3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
:goto_2
|
|
iget v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWI:I
|
|
|
|
if-ge v0, v1, :cond_3
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v3, v2, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v5}, Landroid/graphics/RectF;->width()F
|
|
|
|
move-result v5
|
|
|
|
int-to-float v6, v0
|
|
|
|
add-float/2addr v6, v4
|
|
|
|
iget v7, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWI:I
|
|
|
|
add-int/lit8 v7, v7, 0x1
|
|
|
|
int-to-float v7, v7
|
|
|
|
div-float v7, v6, v7
|
|
|
|
mul-float v5, v5, v7
|
|
|
|
iget-object v7, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v7, v7, Landroid/graphics/RectF;->left:F
|
|
|
|
add-float/2addr v5, v7
|
|
|
|
aput v5, v1, v2
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v2, v3, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->top:F
|
|
|
|
aput v5, v1, v3
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v3, v2, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v5}, Landroid/graphics/RectF;->width()F
|
|
|
|
move-result v5
|
|
|
|
iget v7, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWI:I
|
|
|
|
add-int/lit8 v7, v7, 0x1
|
|
|
|
int-to-float v7, v7
|
|
|
|
div-float/2addr v6, v7
|
|
|
|
mul-float v5, v5, v6
|
|
|
|
iget-object v6, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->left:F
|
|
|
|
add-float/2addr v5, v6
|
|
|
|
aput v5, v1, v2
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
add-int/lit8 v2, v3, 0x1
|
|
|
|
iget-object v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->bottom:F
|
|
|
|
aput v5, v1, v3
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWQ:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawLines([FLandroid/graphics/Paint;)V
|
|
|
|
:cond_4
|
|
iget-boolean v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWK:Z
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWR:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/RectF;Landroid/graphics/Paint;)V
|
|
|
|
:cond_5
|
|
iget v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/RectF;->set(Landroid/graphics/RectF;)V
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWZ:I
|
|
|
|
int-to-float v2, v1
|
|
|
|
neg-int v1, v1
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-virtual {v0, v2, v1}, Landroid/graphics/RectF;->inset(FF)V
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
sget-object v1, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/RectF;Landroid/graphics/Region$Op;)Z
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/RectF;->set(Landroid/graphics/RectF;)V
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWZ:I
|
|
|
|
neg-int v2, v1
|
|
|
|
int-to-float v2, v2
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-virtual {v0, v2, v1}, Landroid/graphics/RectF;->inset(FF)V
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
sget-object v1, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/RectF;Landroid/graphics/Region$Op;)Z
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWS:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/RectF;Landroid/graphics/Paint;)V
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V
|
|
|
|
:cond_6
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onLayout(ZIIII)V
|
|
.locals 0
|
|
|
|
invoke-super/range {p0 .. p5}, Landroid/view/View;->onLayout(ZIIII)V
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result p2
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getWidth()I
|
|
|
|
move-result p3
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingRight()I
|
|
|
|
move-result p4
|
|
|
|
sub-int/2addr p3, p4
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getHeight()I
|
|
|
|
move-result p4
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingBottom()I
|
|
|
|
move-result p5
|
|
|
|
sub-int/2addr p4, p5
|
|
|
|
sub-int/2addr p3, p1
|
|
|
|
iput p3, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWD:I
|
|
|
|
sub-int/2addr p4, p2
|
|
|
|
iput p4, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWE:I
|
|
|
|
iget-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXb:Z
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXb:Z
|
|
|
|
iget p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWb:F
|
|
|
|
invoke-virtual {p0, p1}, Lcom/yalantis/ucrop/view/OverlayView;->setTargetAspectRatio(F)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 17
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
iget-object v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v1}, Landroid/graphics/RectF;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_12
|
|
|
|
iget v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto/16 :goto_9
|
|
|
|
:cond_0
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getX()F
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getY()F
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I
|
|
|
|
move-result v4
|
|
|
|
and-int/lit16 v4, v4, 0xff
|
|
|
|
const/4 v7, 0x1
|
|
|
|
if-nez v4, :cond_7
|
|
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWX:I
|
|
|
|
int-to-double v8, v4
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v10, -0x1
|
|
|
|
:goto_0
|
|
const/16 v11, 0x8
|
|
|
|
if-ge v4, v11, :cond_2
|
|
|
|
iget-object v11, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWF:[F
|
|
|
|
aget v11, v11, v4
|
|
|
|
sub-float v11, v1, v11
|
|
|
|
float-to-double v11, v11
|
|
|
|
const-wide/high16 v13, 0x4000000000000000L # 2.0
|
|
|
|
invoke-static {v11, v12, v13, v14}, Ljava/lang/Math;->pow(DD)D
|
|
|
|
move-result-wide v11
|
|
|
|
iget-object v15, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWF:[F
|
|
|
|
add-int/lit8 v16, v4, 0x1
|
|
|
|
aget v15, v15, v16
|
|
|
|
sub-float v15, v3, v15
|
|
|
|
float-to-double v5, v15
|
|
|
|
invoke-static {v5, v6, v13, v14}, Ljava/lang/Math;->pow(DD)D
|
|
|
|
move-result-wide v5
|
|
|
|
add-double/2addr v11, v5
|
|
|
|
invoke-static {v11, v12}, Ljava/lang/Math;->sqrt(D)D
|
|
|
|
move-result-wide v5
|
|
|
|
cmpg-double v11, v5, v8
|
|
|
|
if-gez v11, :cond_1
|
|
|
|
div-int/lit8 v8, v4, 0x2
|
|
|
|
move v10, v8
|
|
|
|
move-wide v8, v5
|
|
|
|
:cond_1
|
|
add-int/lit8 v4, v4, 0x2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
if-ne v4, v7, :cond_3
|
|
|
|
if-gez v10, :cond_3
|
|
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v4, v1, v3}, Landroid/graphics/RectF;->contains(FF)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
const/4 v10, 0x4
|
|
|
|
:cond_3
|
|
iput v10, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-eq v4, v5, :cond_4
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:cond_4
|
|
if-nez v2, :cond_5
|
|
|
|
const/high16 v4, -0x40800000 # -1.0f
|
|
|
|
iput v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
iput v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
const/4 v5, 0x0
|
|
|
|
cmpg-float v4, v4, v5
|
|
|
|
if-gez v4, :cond_6
|
|
|
|
iput v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
iput v3, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
:cond_6
|
|
:goto_1
|
|
return v2
|
|
|
|
:cond_7
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I
|
|
|
|
move-result v4
|
|
|
|
and-int/lit16 v4, v4, 0xff
|
|
|
|
const/4 v5, 0x2
|
|
|
|
if-ne v4, v5, :cond_10
|
|
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getPointerCount()I
|
|
|
|
move-result v4
|
|
|
|
if-ne v4, v7, :cond_10
|
|
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-eq v4, v5, :cond_10
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-static {v1, v4}, Ljava/lang/Math;->max(FF)F
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getWidth()I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingRight()I
|
|
|
|
move-result v5
|
|
|
|
sub-int/2addr v4, v5
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-static {v1, v4}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->max(FF)F
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getHeight()I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingBottom()I
|
|
|
|
move-result v5
|
|
|
|
sub-int/2addr v4, v5
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v3
|
|
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v4, v5}, Landroid/graphics/RectF;->set(Landroid/graphics/RectF;)V
|
|
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
packed-switch v4, :pswitch_data_0
|
|
|
|
goto/16 :goto_2
|
|
|
|
:pswitch_0
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
sub-float v4, v1, v4
|
|
|
|
iget v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
sub-float v5, v3, v5
|
|
|
|
invoke-virtual {v2, v4, v5}, Landroid/graphics/RectF;->offset(FF)V
|
|
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v2, v2, Landroid/graphics/RectF;->left:F
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getLeft()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
cmpl-float v2, v2, v4
|
|
|
|
if-lez v2, :cond_f
|
|
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v2, v2, Landroid/graphics/RectF;->top:F
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getTop()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
cmpl-float v2, v2, v4
|
|
|
|
if-lez v2, :cond_f
|
|
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v2, v2, Landroid/graphics/RectF;->right:F
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getRight()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
cmpg-float v2, v2, v4
|
|
|
|
if-gez v2, :cond_f
|
|
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v2, v2, Landroid/graphics/RectF;->bottom:F
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->getBottom()I
|
|
|
|
move-result v4
|
|
|
|
int-to-float v4, v4
|
|
|
|
cmpg-float v2, v2, v4
|
|
|
|
if-gez v2, :cond_f
|
|
|
|
iget-object v2, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v2, v4}, Landroid/graphics/RectF;->set(Landroid/graphics/RectF;)V
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->wx()V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->postInvalidate()V
|
|
|
|
goto/16 :goto_8
|
|
|
|
:pswitch_1
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->top:F
|
|
|
|
iget-object v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->right:F
|
|
|
|
invoke-virtual {v4, v1, v5, v6, v3}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_2
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->left:F
|
|
|
|
iget-object v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->top:F
|
|
|
|
invoke-virtual {v4, v5, v6, v1, v3}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_3
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->left:F
|
|
|
|
iget-object v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->bottom:F
|
|
|
|
invoke-virtual {v4, v5, v3, v1, v6}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
goto :goto_2
|
|
|
|
:pswitch_4
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v5, v5, Landroid/graphics/RectF;->right:F
|
|
|
|
iget-object v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->bottom:F
|
|
|
|
invoke-virtual {v4, v1, v3, v5, v6}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
:goto_2
|
|
iget-object v4, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v4}, Landroid/graphics/RectF;->height()F
|
|
|
|
move-result v4
|
|
|
|
iget v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWY:I
|
|
|
|
int-to-float v5, v5
|
|
|
|
cmpl-float v4, v4, v5
|
|
|
|
if-ltz v4, :cond_8
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_8
|
|
const/4 v4, 0x0
|
|
|
|
:goto_3
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {v5}, Landroid/graphics/RectF;->width()F
|
|
|
|
move-result v5
|
|
|
|
iget v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWY:I
|
|
|
|
int-to-float v6, v6
|
|
|
|
cmpl-float v5, v5, v6
|
|
|
|
if-ltz v5, :cond_9
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:cond_9
|
|
iget-object v5, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
iget-object v6, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
iget v6, v6, Landroid/graphics/RectF;->left:F
|
|
|
|
goto :goto_4
|
|
|
|
:cond_a
|
|
iget v6, v5, Landroid/graphics/RectF;->left:F
|
|
|
|
:goto_4
|
|
if-eqz v4, :cond_b
|
|
|
|
iget-object v8, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
goto :goto_5
|
|
|
|
:cond_b
|
|
iget-object v8, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
:goto_5
|
|
iget v8, v8, Landroid/graphics/RectF;->top:F
|
|
|
|
if-eqz v2, :cond_c
|
|
|
|
iget-object v9, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
goto :goto_6
|
|
|
|
:cond_c
|
|
iget-object v9, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
:goto_6
|
|
iget v9, v9, Landroid/graphics/RectF;->right:F
|
|
|
|
if-eqz v4, :cond_d
|
|
|
|
iget-object v10, v0, Lcom/yalantis/ucrop/view/OverlayView;->IR:Landroid/graphics/RectF;
|
|
|
|
goto :goto_7
|
|
|
|
:cond_d
|
|
iget-object v10, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
:goto_7
|
|
iget v10, v10, Landroid/graphics/RectF;->bottom:F
|
|
|
|
invoke-virtual {v5, v6, v8, v9, v10}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
if-nez v4, :cond_e
|
|
|
|
if-eqz v2, :cond_f
|
|
|
|
:cond_e
|
|
invoke-direct/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->wx()V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Lcom/yalantis/ucrop/view/OverlayView;->postInvalidate()V
|
|
|
|
:cond_f
|
|
:goto_8
|
|
iput v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
iput v3, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
return v7
|
|
|
|
:cond_10
|
|
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I
|
|
|
|
move-result v1
|
|
|
|
and-int/lit16 v1, v1, 0xff
|
|
|
|
if-ne v1, v7, :cond_11
|
|
|
|
const/high16 v1, -0x40800000 # -1.0f
|
|
|
|
iput v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWU:F
|
|
|
|
iput v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWV:F
|
|
|
|
const/4 v1, -0x1
|
|
|
|
iput v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWW:I
|
|
|
|
iget-object v1, v0, Lcom/yalantis/ucrop/view/OverlayView;->aXa:Lcom/yalantis/ucrop/a/d;
|
|
|
|
if-eqz v1, :cond_11
|
|
|
|
iget-object v3, v0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-interface {v1, v3}, Lcom/yalantis/ucrop/a/d;->g(Landroid/graphics/RectF;)V
|
|
|
|
:cond_11
|
|
return v2
|
|
|
|
:cond_12
|
|
:goto_9
|
|
return v2
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x0
|
|
:pswitch_4
|
|
:pswitch_3
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method public setCircleDimmedLayer(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWM:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropFrameColor(I)V
|
|
.locals 1
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWR:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropFrameStrokeWidth(I)V
|
|
.locals 1
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = 0x0L
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWR:Landroid/graphics/Paint;
|
|
|
|
int-to-float p1, p1
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setStrokeWidth(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropGridColor(I)V
|
|
.locals 1
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWQ:Landroid/graphics/Paint;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropGridColumnCount(I)V
|
|
.locals 0
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = 0x0L
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWI:I
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropGridRowCount(I)V
|
|
.locals 0
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = 0x0L
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWH:I
|
|
|
|
const/4 p1, 0x0
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWJ:[F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCropGridStrokeWidth(I)V
|
|
.locals 1
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/IntRange;
|
|
from = 0x0L
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWQ:Landroid/graphics/Paint;
|
|
|
|
int-to-float p1, p1
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setStrokeWidth(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setDimmedColor(I)V
|
|
.locals 0
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWN:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setFreestyleCropEnabled(Z)V
|
|
.locals 0
|
|
.annotation runtime Ljava/lang/Deprecated;
|
|
.end annotation
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setFreestyleCropMode(I)V
|
|
.locals 0
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWT:I
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->postInvalidate()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setOverlayViewChangeListener(Lcom/yalantis/ucrop/a/d;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXa:Lcom/yalantis/ucrop/a/d;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setShowCropFrame(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWK:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setShowCropGrid(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWL:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setTargetAspectRatio(F)V
|
|
.locals 6
|
|
|
|
iput p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWb:F
|
|
|
|
iget p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWD:I
|
|
|
|
if-lez p1, :cond_2
|
|
|
|
int-to-float v0, p1
|
|
|
|
iget v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWb:F
|
|
|
|
div-float/2addr v0, v1
|
|
|
|
float-to-int v0, v0
|
|
|
|
iget v2, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWE:I
|
|
|
|
if-le v0, v2, :cond_0
|
|
|
|
int-to-float v0, v2
|
|
|
|
mul-float v0, v0, v1
|
|
|
|
float-to-int v0, v0
|
|
|
|
sub-int/2addr p1, v0
|
|
|
|
div-int/lit8 p1, p1, 0x2
|
|
|
|
iget-object v1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v2, p1
|
|
|
|
int-to-float v2, v2
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result v3
|
|
|
|
int-to-float v3, v3
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, v0
|
|
|
|
add-int/2addr v4, p1
|
|
|
|
int-to-float p1, v4
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result v0
|
|
|
|
iget v4, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWE:I
|
|
|
|
add-int/2addr v0, v4
|
|
|
|
int-to-float v0, v0
|
|
|
|
invoke-virtual {v1, v2, v3, p1, v0}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sub-int/2addr v2, v0
|
|
|
|
div-int/lit8 v2, v2, 0x2
|
|
|
|
iget-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result v1
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result v3
|
|
|
|
add-int/2addr v3, v2
|
|
|
|
int-to-float v3, v3
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingLeft()I
|
|
|
|
move-result v4
|
|
|
|
iget v5, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWD:I
|
|
|
|
add-int/2addr v4, v5
|
|
|
|
int-to-float v4, v4
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->getPaddingTop()I
|
|
|
|
move-result v5
|
|
|
|
add-int/2addr v5, v0
|
|
|
|
add-int/2addr v5, v2
|
|
|
|
int-to-float v0, v5
|
|
|
|
invoke-virtual {p1, v1, v3, v4, v0}, Landroid/graphics/RectF;->set(FFFF)V
|
|
|
|
:goto_0
|
|
iget-object p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXa:Lcom/yalantis/ucrop/a/d;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/yalantis/ucrop/view/OverlayView;->aWC:Landroid/graphics/RectF;
|
|
|
|
invoke-interface {p1, v0}, Lcom/yalantis/ucrop/a/d;->g(Landroid/graphics/RectF;)V
|
|
|
|
:cond_1
|
|
invoke-direct {p0}, Lcom/yalantis/ucrop/view/OverlayView;->wx()V
|
|
|
|
invoke-virtual {p0}, Lcom/yalantis/ucrop/view/OverlayView;->postInvalidate()V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/yalantis/ucrop/view/OverlayView;->aXb:Z
|
|
|
|
return-void
|
|
.end method
|