.class public Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;
.super Lcom/moji/mjweather/ipc/view/comment/ResizeLayout;
.source "AutoHeightLayout.java"

# interfaces
.implements Lcom/moji/mjweather/ipc/view/comment/ResizeLayout$OnResizeListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;,
        Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;
    }
.end annotation


# instance fields
.field protected a:Landroid/content/Context;

.field protected b:I

.field protected c:I

.field protected d:Landroid/view/View;

.field protected e:I

.field private f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

.field private g:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;


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

    .line 45
    invoke-direct {p0, p1}, Lcom/moji/mjweather/ipc/view/comment/ResizeLayout;-><init>(Landroid/content/Context;)V

    const/16 v0, 0x64

    .line 26
    iput v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    .line 46
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->a:Landroid/content/Context;

    .line 47
    invoke-static {p1}, Lcom/moji/mjweather/ipc/view/comment/Utils;->a(Landroid/content/Context;)I

    move-result p1

    iput p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    const/4 p1, 0x1

    .line 48
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setListener(Z)V

    return-void
.end method

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

    .line 31
    invoke-direct {p0, p1, p2}, Lcom/moji/mjweather/ipc/view/comment/ResizeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/16 p2, 0x64

    .line 26
    iput p2, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    .line 32
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->a:Landroid/content/Context;

    .line 33
    invoke-static {p1}, Lcom/moji/mjweather/ipc/view/comment/Utils;->a(Landroid/content/Context;)I

    move-result p1

    iput p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    const/4 p1, 0x1

    .line 34
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setListener(Z)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    .line 38
    invoke-direct {p0, p1, p2, p3}, Lcom/moji/mjweather/ipc/view/comment/ResizeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/16 p2, 0x64

    .line 26
    iput p2, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    .line 39
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->a:Landroid/content/Context;

    .line 40
    invoke-static {p1}, Lcom/moji/mjweather/ipc/view/comment/Utils;->a(Landroid/content/Context;)I

    move-result p1

    iput p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    const/4 p1, 0x1

    .line 41
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setListener(Z)V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 2

    .line 122
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    if-eqz v0, :cond_0

    .line 123
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    invoke-interface {v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;->c()V

    .line 124
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->g:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;

    if-eqz v0, :cond_1

    .line 125
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->g:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;->a(Z)V

    .line 126
    :cond_1
    new-instance v0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$1;

    invoke-direct {v0, p0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$1;-><init>(Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;)V

    invoke-virtual {p0, v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->post(Ljava/lang/Runnable;)Z

    const/16 v0, 0x64

    .line 136
    iput v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    return-void
.end method

.method public a(I)V
    .locals 1

    .line 151
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    if-eqz v0, :cond_0

    .line 152
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    invoke-interface {v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;->a()V

    :cond_0
    const/16 v0, 0x67

    .line 153
    iput v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    .line 154
    new-instance v0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$2;

    invoke-direct {v0, p0, p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$2;-><init>(Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;I)V

    invoke-virtual {p0, v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public a(Landroid/content/Context;)V
    .locals 2

    const-string v0, "input_method"

    .line 185
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/inputmethod/InputMethodManager;

    if-eqz v0, :cond_0

    .line 186
    check-cast p1, Landroid/app/Activity;

    invoke-virtual {p1}, Landroid/app/Activity;->getCurrentFocus()Landroid/view/View;

    move-result-object v1

    if-eqz v1, :cond_0

    .line 187
    invoke-virtual {p1}, Landroid/app/Activity;->getCurrentFocus()Landroid/view/View;

    move-result-object p1

    .line 188
    invoke-virtual {p1}, Landroid/view/View;->getWindowToken()Landroid/os/IBinder;

    move-result-object p1

    const/4 v1, 0x2

    .line 187
    invoke-virtual {v0, p1, v1}, Landroid/view/inputmethod/InputMethodManager;->hideSoftInputFromWindow(Landroid/os/IBinder;I)Z

    :cond_0
    return-void
.end method

.method public addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
    .locals 3

    .line 80
    invoke-virtual {p0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->getChildCount()I

    move-result v0

    .line 81
    invoke-virtual {p0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->getChildCount()I

    move-result v1

    const/4 v2, 0x1

    if-gt v1, v2, :cond_3

    .line 84
    invoke-super {p0, p1, p2, p3}, Lcom/moji/mjweather/ipc/view/comment/ResizeLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

    if-nez v0, :cond_1

    .line 87
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result p2

    iput p2, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->b:I

    .line 88
    iget p2, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->b:I

    if-gez p2, :cond_0

    .line 89
    invoke-virtual {p1, v2}, Landroid/view/View;->setId(I)V

    .line 90
    iput v2, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->b:I

    .line 92
    :cond_0
    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object p2

    check-cast p2, Landroid/widget/RelativeLayout$LayoutParams;

    const/16 p3, 0xc

    .line 93
    invoke-virtual {p2, p3}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    .line 94
    invoke-virtual {p1, p2}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0

    :cond_1
    if-ne v0, v2, :cond_2

    .line 96
    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object p2

    check-cast p2, Landroid/widget/RelativeLayout$LayoutParams;

    const/4 p3, 0x2

    .line 97
    iget v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->b:I

    invoke-virtual {p2, p3, v0}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V

    .line 98
    invoke-virtual {p1, p2}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    :cond_2
    :goto_0
    return-void

    .line 82
    :cond_3
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "can host only one direct child"

    invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public b(I)V
    .locals 1

    .line 164
    iget-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    if-eqz p1, :cond_0

    .line 165
    iget-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    invoke-interface {p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;->b()V

    .line 166
    :cond_0
    iget p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    const/16 v0, 0x67

    if-ne p1, v0, :cond_1

    const/16 p1, 0x66

    goto :goto_0

    :cond_1
    const/16 p1, 0x64

    :goto_0
    iput p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    return-void
.end method

.method public c(I)V
    .locals 2

    .line 171
    iget v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    const/16 v1, 0x64

    if-ne v0, v1, :cond_0

    return-void

    .line 173
    :cond_0
    new-instance v0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$3;

    invoke-direct {v0, p0, p1}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$3;-><init>(Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;I)V

    invoke-virtual {p0, v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public getKeyBoardState()I
    .locals 1

    .line 75
    iget v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->e:I

    return v0
.end method

.method public setAutoHeightLayoutView(Landroid/view/View;)V
    .locals 0

    .line 103
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->d:Landroid/view/View;

    return-void
.end method

.method public setAutoViewHeight(I)V
    .locals 2

    int-to-float v0, p1

    .line 107
    invoke-static {v0}, Lcom/moji/tool/DeviceTool;->c(F)F

    move-result v0

    float-to-int v0, v0

    if-lez v0, :cond_0

    .line 108
    iget v1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    if-eq v0, v1, :cond_0

    .line 109
    iput v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    .line 110
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->a:Landroid/content/Context;

    iget v1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->c:I

    invoke-static {v0, v1}, Lcom/moji/mjweather/ipc/view/comment/Utils;->a(Landroid/content/Context;I)V

    .line 113
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->d:Landroid/view/View;

    if-eqz v0, :cond_1

    .line 114
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->d:Landroid/view/View;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 115
    iget-object v0, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->d:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout$LayoutParams;

    .line 116
    iput p1, v0, Landroid/widget/LinearLayout$LayoutParams;->height:I

    .line 117
    iget-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->d:Landroid/view/View;

    invoke-virtual {p1, v0}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    :cond_1
    return-void
.end method

.method public setListener(Z)V
    .locals 1

    const/4 v0, 0x0

    if-eqz p1, :cond_0

    .line 53
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setOnResizeListener(Lcom/moji/mjweather/ipc/view/comment/ResizeLayout$OnResizeListener;)V

    .line 54
    invoke-virtual {p0, p0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setOnResizeListener(Lcom/moji/mjweather/ipc/view/comment/ResizeLayout$OnResizeListener;)V

    goto :goto_0

    .line 56
    :cond_0
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->setOnResizeListener(Lcom/moji/mjweather/ipc/view/comment/ResizeLayout$OnResizeListener;)V

    :goto_0
    return-void
.end method

.method public setOnAutoResizeListener(Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;)V
    .locals 0

    .line 61
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->f:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoResizeListener;

    return-void
.end method

.method public setOnAutoViewStateChangedListener(Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;)V
    .locals 0

    .line 65
    iput-object p1, p0, Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout;->g:Lcom/moji/mjweather/ipc/view/comment/AutoHeightLayout$OnAutoViewStateChangedListener;

    return-void
.end method
