KeyboardStateDetector.smali

.class public Lsg/bigo/live/support64/widget/KeyboardStateDetector;
.super Landroid/widget/FrameLayout;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lsg/bigo/live/support64/widget/KeyboardStateDetector$c;,
        Lsg/bigo/live/support64/widget/KeyboardStateDetector$b;,
        Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;
    }
.end annotation


# instance fields
.field private final a:F

.field private b:I

.field private c:I

.field private d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

.field private e:Z

.field private f:Landroid/graphics/Rect;


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

    const/4 v0, 0x0

    .line 32
    invoke-direct {p0, p1, v0}, Lsg/bigo/live/support64/widget/KeyboardStateDetector;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-void
.end method

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

    const/4 v0, 0x0

    .line 36
    invoke-direct {p0, p1, p2, v0}, Lsg/bigo/live/support64/widget/KeyboardStateDetector;-><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

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

    const/4 p1, -0x1

    .line 22
    iput p1, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->b:I

    .line 24
    iput p1, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->c:I

    const/high16 p1, 0x430c0000    # 140.0f

    .line 42
    invoke-static {p1}, Lsg/bigo/common/k;->a(F)I

    move-result p1

    int-to-float p1, p1

    iput p1, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->a:F

    return-void
.end method


# virtual methods
.method protected onLayout(ZIIII)V
    .registers 6

    .line 51
    invoke-super/range {p0 .. p5}, Landroid/widget/FrameLayout;->onLayout(ZIIII)V

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

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

    .line 54
    invoke-virtual {p0, p1}, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->getWindowVisibleDisplayFrame(Landroid/graphics/Rect;)V

    .line 56
    iget-object p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->f:Landroid/graphics/Rect;

    if-eqz p2, :cond_16

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

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

    if-ne p2, p3, :cond_16

    return-void

    .line 59
    :cond_16
    iput-object p1, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->f:Landroid/graphics/Rect;

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

    .line 1120
    iget p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->b:I

    sub-int p3, p2, p1

    const/4 p4, -0x1

    if-eq p2, p4, :cond_39

    if-gez p3, :cond_39

    .line 1121
    invoke-static {p3}, Ljava/lang/Math;->abs(I)I

    move-result p2

    int-to-float p2, p2

    iget p4, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->a:F

    cmpl-float p2, p2, p4

    if-lez p2, :cond_39

    .line 1123
    iget-object p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    if-eqz p2, :cond_35

    .line 1124
    invoke-virtual {p2, p0}, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;->b(Landroid/view/View;)V

    :cond_35
    const/4 p2, 0x0

    .line 1126
    iput-boolean p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->e:Z

    goto :goto_81

    :cond_39
    if-lez p3, :cond_62

    .line 1127
    invoke-static {p3}, Ljava/lang/Math;->abs(I)I

    move-result p2

    int-to-float p2, p2

    iget p4, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->a:F

    cmpl-float p2, p2, p4

    if-lez p2, :cond_62

    .line 1129
    iget-object p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    if-eqz p2, :cond_4d

    .line 1130
    invoke-virtual {p2, p0}, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;->a(Landroid/view/View;)V

    .line 1133
    :cond_4d
    iget p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->c:I

    .line 1134
    invoke-static {p3}, Ljava/lang/Math;->abs(I)I

    move-result p3

    iput p3, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->c:I

    .line 1136
    iget-object p4, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    if-eqz p4, :cond_5e

    if-eq p2, p3, :cond_5e

    .line 1137
    invoke-virtual {p4, p0, p2, p3}, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;->a(Lsg/bigo/live/support64/widget/KeyboardStateDetector;II)V

    :cond_5e
    const/4 p2, 0x1

    .line 1140
    iput-boolean p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->e:Z

    goto :goto_81

    .line 1141
    :cond_62
    invoke-static {p3}, Ljava/lang/Math;->abs(I)I

    move-result p2

    if-lez p2, :cond_81

    invoke-static {p3}, Ljava/lang/Math;->abs(I)I

    move-result p2

    int-to-float p2, p2

    iget p4, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->a:F

    cmpg-float p2, p2, p4

    if-gez p2, :cond_81

    .line 1142
    iget p2, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->c:I

    add-int/2addr p3, p2

    .line 1143
    iput p3, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->c:I

    .line 1145
    iget-object p4, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    if-eqz p4, :cond_81

    if-eq p2, p3, :cond_81

    .line 1146
    invoke-virtual {p4, p0, p2, p3}, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;->a(Lsg/bigo/live/support64/widget/KeyboardStateDetector;II)V

    .line 1149
    :cond_81
    :goto_81
    iput p1, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->b:I

    return-void
.end method

.method public setListener(Lsg/bigo/live/support64/widget/KeyboardStateDetector$b;)V
    .registers 3

    .line 154
    new-instance v0, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    invoke-direct {v0, p0, p1}, Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;-><init>(Lsg/bigo/live/support64/widget/KeyboardStateDetector;Lsg/bigo/live/support64/widget/KeyboardStateDetector$b;)V

    iput-object v0, p0, Lsg/bigo/live/support64/widget/KeyboardStateDetector;->d:Lsg/bigo/live/support64/widget/KeyboardStateDetector$a;

    return-void
.end method