CloseableLayout.smali

.class public Lcom/proxy/ad/impl/banner/view/CloseableLayout;
.super Landroid/widget/FrameLayout;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;,
        Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;,
        Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;
    }
.end annotation


# instance fields
.field public final a:Landroid/graphics/drawable/Drawable;

.field private final b:I

.field private c:Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;

.field private d:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

.field private final e:I

.field private final f:I

.field private final g:I

.field private h:Z

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

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

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

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

.field private m:Z

.field private n:Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;


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

    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-direct {p0, p1, v0, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .registers 4

    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;-><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
    .registers 4

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    new-instance p2, Landroid/graphics/Rect;

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

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->i:Landroid/graphics/Rect;

    new-instance p2, Landroid/graphics/Rect;

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

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

    new-instance p2, Landroid/graphics/Rect;

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

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->k:Landroid/graphics/Rect;

    new-instance p2, Landroid/graphics/Rect;

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

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->l:Landroid/graphics/Rect;

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p2

    sget p3, Lcom/proxy/ad/bigoadsdk/R$drawable;->bigo_ad_ic_close:I

    invoke-virtual {p2, p3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    sget-object p2, Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;->c:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

    iput-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->d:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

    iget-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    sget-object p3, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->EMPTY_STATE_SET:[I

    invoke-virtual {p2, p3}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    iget-object p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p2, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object p2

    invoke-virtual {p2}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I

    move-result p2

    iput p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->b:I

    const/16 p2, 0x32

    invoke-static {p1, p2}, Lcom/proxy/ad/h/d;->a(Landroid/content/Context;I)I

    move-result p2

    iput p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->e:I

    const/16 p2, 0x1e

    invoke-static {p1, p2}, Lcom/proxy/ad/h/d;->a(Landroid/content/Context;I)I

    move-result p2

    iput p2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->f:I

    const/16 p2, 0x8

    invoke-static {p1, p2}, Lcom/proxy/ad/h/d;->a(Landroid/content/Context;I)I

    move-result p1

    iput p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->g:I

    const/4 p1, 0x0

    invoke-virtual {p0, p1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->setWillNotDraw(Z)V

    const/4 p1, 0x1

    iput-boolean p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->m:Z

    return-void
.end method

.method private static a(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;ILandroid/graphics/Rect;Landroid/graphics/Rect;)V
    .registers 4

    iget p0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;->h:I

    invoke-static {p0, p1, p1, p2, p3}, Landroid/view/Gravity;->apply(IIILandroid/graphics/Rect;Landroid/graphics/Rect;)V

    return-void
.end method

.method static synthetic a(Lcom/proxy/ad/impl/banner/view/CloseableLayout;)V
    .registers 2

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->setClosePressed(Z)V

    return-void
.end method

.method private a()Z
    .registers 3

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getState()[I

    move-result-object v0

    sget-object v1, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->SELECTED_STATE_SET:[I

    if-ne v0, v1, :cond_c

    const/4 v0, 0x1

    return v0

    :cond_c
    const/4 v0, 0x0

    return v0
.end method

.method private a(III)Z
    .registers 5

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    sub-int/2addr v0, p3

    if-lt p1, v0, :cond_1e

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    sub-int/2addr v0, p3

    if-lt p2, v0, :cond_1e

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    add-int/2addr v0, p3

    if-ge p1, v0, :cond_1e

    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    add-int/2addr p1, p3

    if-ge p2, p1, :cond_1e

    const/4 p1, 0x1

    return p1

    :cond_1e
    const/4 p1, 0x0

    return p1
.end method

.method private setClosePressed(Z)V
    .registers 3

    invoke-direct {p0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a()Z

    move-result v0

    if-ne p1, v0, :cond_7

    return-void

    :cond_7
    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    if-eqz p1, :cond_e

    sget-object p1, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->SELECTED_STATE_SET:[I

    goto :goto_10

    :cond_e
    sget-object p1, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->EMPTY_STATE_SET:[I

    :goto_10
    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

    invoke-virtual {p0, p1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->invalidate(Landroid/graphics/Rect;)V

    return-void
.end method


# virtual methods
.method public final a(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
    .registers 5

    iget v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->e:I

    invoke-static {p1, v0, p2, p3}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;ILandroid/graphics/Rect;Landroid/graphics/Rect;)V

    return-void
.end method

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

    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->draw(Landroid/graphics/Canvas;)V

    iget-boolean v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->h:Z

    if-eqz v0, :cond_40

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->h:Z

    iget-object v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->i:Landroid/graphics/Rect;

    invoke-virtual {p0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->getWidth()I

    move-result v2

    invoke-virtual {p0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->getHeight()I

    move-result v3

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

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->d:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

    iget-object v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->i:Landroid/graphics/Rect;

    iget-object v2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

    invoke-virtual {p0, v0, v1, v2}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;Landroid/graphics/Rect;Landroid/graphics/Rect;)V

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->l:Landroid/graphics/Rect;

    iget-object v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->l:Landroid/graphics/Rect;

    iget v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->g:I

    invoke-virtual {v0, v1, v1}, Landroid/graphics/Rect;->inset(II)V

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->d:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

    iget-object v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->l:Landroid/graphics/Rect;

    iget-object v2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->k:Landroid/graphics/Rect;

    iget v3, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->f:I

    invoke-static {v0, v3, v1, v2}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;ILandroid/graphics/Rect;Landroid/graphics/Rect;)V

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    iget-object v1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->k:Landroid/graphics/Rect;

    invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V

    :cond_40
    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isVisible()Z

    move-result v0

    if-eqz v0, :cond_4d

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

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

    :cond_4d
    return-void
.end method

.method getCloseBounds()Landroid/graphics/Rect;
    .registers 2

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

    return-object v0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 4

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_8

    return v1

    :cond_8
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v0

    float-to-int v0, v0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result p1

    float-to-int p1, p1

    invoke-direct {p0, v0, p1, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a(III)Z

    move-result p1

    return p1
.end method

.method protected onSizeChanged(IIII)V
    .registers 5

    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/FrameLayout;->onSizeChanged(IIII)V

    const/4 p1, 0x1

    iput-boolean p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->h:Z

    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 7

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v0

    float-to-int v0, v0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v1

    float-to-int v1, v1

    iget v2, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->b:I

    invoke-direct {p0, v0, v1, v2}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a(III)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_61

    iget-boolean v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->m:Z

    const/4 v2, 0x1

    if-nez v0, :cond_23

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->isVisible()Z

    move-result v0

    if-eqz v0, :cond_21

    goto :goto_23

    :cond_21
    const/4 v0, 0x0

    goto :goto_24

    :cond_23
    :goto_23
    const/4 v0, 0x1

    :goto_24
    if-nez v0, :cond_27

    goto :goto_61

    :cond_27
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result p1

    if-eqz p1, :cond_5d

    if-eq p1, v2, :cond_37

    const/4 v0, 0x3

    if-eq p1, v0, :cond_33

    goto :goto_60

    :cond_33
    invoke-direct {p0, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->setClosePressed(Z)V

    goto :goto_60

    :cond_37
    invoke-direct {p0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a()Z

    move-result p1

    if-eqz p1, :cond_60

    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->n:Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;

    if-nez p1, :cond_48

    new-instance p1, Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;

    invoke-direct {p1, p0, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;-><init>(Lcom/proxy/ad/impl/banner/view/CloseableLayout;B)V

    iput-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->n:Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;

    :cond_48
    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->n:Lcom/proxy/ad/impl/banner/view/CloseableLayout$c;

    invoke-static {}, Landroid/view/ViewConfiguration;->getPressedStateDuration()I

    move-result v0

    int-to-long v3, v0

    invoke-virtual {p0, p1, v3, v4}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->postDelayed(Ljava/lang/Runnable;J)Z

    invoke-virtual {p0, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->playSoundEffect(I)V

    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->c:Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;

    if-eqz p1, :cond_60

    invoke-interface {p1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;->a()V

    goto :goto_60

    :cond_5d
    invoke-direct {p0, v2}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->setClosePressed(Z)V

    :cond_60
    :goto_60
    return v2

    :cond_61
    :goto_61
    invoke-direct {p0, v1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->setClosePressed(Z)V

    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z

    return v1
.end method

.method public setCloseAlwaysInteractable(Z)V
    .registers 2

    iput-boolean p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->m:Z

    return-void
.end method

.method setCloseBoundChanged(Z)V
    .registers 2

    iput-boolean p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->h:Z

    return-void
.end method

.method setCloseBounds(Landroid/graphics/Rect;)V
    .registers 3

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

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

    return-void
.end method

.method public setClosePosition(Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;)V
    .registers 2

    iput-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->d:Lcom/proxy/ad/impl/banner/view/CloseableLayout$a;

    const/4 p1, 0x1

    iput-boolean p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->h:Z

    invoke-virtual {p0}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->invalidate()V

    return-void
.end method

.method public setCloseVisible(Z)V
    .registers 4

    iget-object v0, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->a:Landroid/graphics/drawable/Drawable;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, v1}, Landroid/graphics/drawable/Drawable;->setVisible(ZZ)Z

    move-result p1

    if-eqz p1, :cond_e

    iget-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->j:Landroid/graphics/Rect;

    invoke-virtual {p0, p1}, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->invalidate(Landroid/graphics/Rect;)V

    :cond_e
    return-void
.end method

.method public setOnCloseListener(Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;)V
    .registers 2

    iput-object p1, p0, Lcom/proxy/ad/impl/banner/view/CloseableLayout;->c:Lcom/proxy/ad/impl/banner/view/CloseableLayout$b;

    return-void
.end method