.class Lcom/moji/forum/ui/NewTopicActivity$5;
.super Ljava/lang/Object;
.source "NewTopicActivity.java"

# interfaces
.implements Landroid/text/TextWatcher;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/moji/forum/ui/NewTopicActivity;->a()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/forum/ui/NewTopicActivity;

.field private b:I

.field private c:I

.field private d:Ljava/lang/CharSequence;


# direct methods
.method constructor <init>(Lcom/moji/forum/ui/NewTopicActivity;)V
    .locals 0

    .line 419
    iput-object p1, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->a:Lcom/moji/forum/ui/NewTopicActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public afterTextChanged(Landroid/text/Editable;)V
    .locals 3

    .line 435
    iget-object v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->a:Lcom/moji/forum/ui/NewTopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/NewTopicActivity;->j(Lcom/moji/forum/ui/NewTopicActivity;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/EditText;->getSelectionStart()I

    move-result v0

    iput v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->b:I

    .line 436
    iget-object v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->a:Lcom/moji/forum/ui/NewTopicActivity;

    invoke-static {v0}, Lcom/moji/forum/ui/NewTopicActivity;->j(Lcom/moji/forum/ui/NewTopicActivity;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/EditText;->getSelectionEnd()I

    move-result v0

    iput v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->c:I

    .line 437
    iget v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->b:I

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->d:Ljava/lang/CharSequence;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->d:Ljava/lang/CharSequence;

    invoke-interface {v0}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    const-string v1, " "

    const-string v2, ""

    invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v0

    const/16 v1, 0x14

    invoke-static {v0, v1}, Lcom/moji/tool/TextUtil;->a(Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 438
    iget-object v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->a:Lcom/moji/forum/ui/NewTopicActivity;

    invoke-virtual {v0}, Lcom/moji/forum/ui/NewTopicActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    sget v1, Lcom/moji/forum/R$string;->title_is_more_than_twenty:I

    invoke-static {v1}, Lcom/moji/forum/common/ResUtil;->b(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Lcom/moji/forum/common/ToastUtil;->a(Landroid/content/Context;Ljava/lang/String;I)V

    .line 439
    iget v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->b:I

    add-int/lit8 v0, v0, -0x1

    iget v1, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->c:I

    invoke-interface {p1, v0, v1}, Landroid/text/Editable;->delete(II)Landroid/text/Editable;

    .line 440
    iget-object p1, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->a:Lcom/moji/forum/ui/NewTopicActivity;

    invoke-static {p1}, Lcom/moji/forum/ui/NewTopicActivity;->j(Lcom/moji/forum/ui/NewTopicActivity;)Landroid/widget/EditText;

    move-result-object p1

    iget v0, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->b:I

    invoke-virtual {p1, v0}, Landroid/widget/EditText;->setSelection(I)V

    :cond_0
    return-void
.end method

.method public beforeTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    return-void
.end method

.method public onTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    .line 426
    iput-object p1, p0, Lcom/moji/forum/ui/NewTopicActivity$5;->d:Ljava/lang/CharSequence;

    return-void
.end method
