.class Lcom/moji/forum/ui/TopicListAdapter$1;
.super Lcom/moji/requestcore/MJHttpCallback;
.source "TopicListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/moji/forum/ui/TopicListAdapter;->c(Lcom/moji/http/mqn/entity/TopicList$Topic;)V
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/requestcore/MJHttpCallback<",
        "Lcom/moji/http/mqn/entity/TopicPraise;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/http/mqn/entity/TopicList$Topic;

.field final synthetic b:Lcom/moji/forum/ui/TopicListAdapter;


# direct methods
.method constructor <init>(Lcom/moji/forum/ui/TopicListAdapter;Lcom/moji/http/mqn/entity/TopicList$Topic;)V
    .locals 0

    .line 573
    iput-object p1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->b:Lcom/moji/forum/ui/TopicListAdapter;

    iput-object p2, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->a:Lcom/moji/http/mqn/entity/TopicList$Topic;

    invoke-direct {p0}, Lcom/moji/requestcore/MJHttpCallback;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Lcom/moji/http/mqn/entity/TopicPraise;)V
    .locals 3

    .line 576
    iget-object p1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->b:Lcom/moji/forum/ui/TopicListAdapter;

    invoke-static {p1}, Lcom/moji/forum/ui/TopicListAdapter;->a(Lcom/moji/forum/ui/TopicListAdapter;)Ljava/util/List;

    move-result-object p1

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :cond_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/http/mqn/entity/TopicList$Topic;

    .line 577
    iget-object v1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->a:Lcom/moji/http/mqn/entity/TopicList$Topic;

    iget-object v1, v1, Lcom/moji/http/mqn/entity/TopicList$Topic;->id:Ljava/lang/String;

    iget-object v2, v0, Lcom/moji/http/mqn/entity/TopicList$Topic;->id:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    const/4 p1, 0x1

    .line 578
    iput-boolean p1, v0, Lcom/moji/http/mqn/entity/TopicList$Topic;->is_praise:Z

    const/4 v0, 0x0

    .line 580
    iget-object v1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->a:Lcom/moji/http/mqn/entity/TopicList$Topic;

    iget-object v1, v1, Lcom/moji/http/mqn/entity/TopicList$Topic;->praise_count:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 582
    :try_start_0
    iget-object v1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->a:Lcom/moji/http/mqn/entity/TopicList$Topic;

    iget-object v1, v1, Lcom/moji/http/mqn/entity/TopicList$Topic;->praise_count:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    move v0, v1

    :catch_0
    :cond_1
    add-int/2addr v0, p1

    .line 588
    iget-object p1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->a:Lcom/moji/http/mqn/entity/TopicList$Topic;

    new-instance v1, Ljava/lang/StringBuilder;

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

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, ""

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p1, Lcom/moji/http/mqn/entity/TopicList$Topic;->praise_count:Ljava/lang/String;

    .line 592
    :cond_2
    iget-object p1, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->b:Lcom/moji/forum/ui/TopicListAdapter;

    invoke-virtual {p1}, Lcom/moji/forum/ui/TopicListAdapter;->notifyDataSetChanged()V

    return-void
.end method

.method protected a(Lcom/moji/requestcore/entity/IResult;)V
    .locals 2

    .line 597
    iget-object v0, p0, Lcom/moji/forum/ui/TopicListAdapter$1;->b:Lcom/moji/forum/ui/TopicListAdapter;

    iget-object v0, v0, Lcom/moji/forum/ui/TopicListAdapter;->a:Landroid/content/Context;

    invoke-virtual {p1}, Lcom/moji/requestcore/entity/IResult;->b()Ljava/lang/String;

    move-result-object p1

    const/4 v1, 0x0

    invoke-static {v0, p1, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object p1

    invoke-virtual {p1}, Landroid/widget/Toast;->show()V

    return-void
.end method

.method protected onFailed(Lcom/moji/requestcore/MJException;)V
    .locals 0

    return-void
.end method

.method public synthetic onSuccess(Ljava/lang/Object;)V
    .locals 0

    .line 573
    check-cast p1, Lcom/moji/http/mqn/entity/TopicPraise;

    invoke-virtual {p0, p1}, Lcom/moji/forum/ui/TopicListAdapter$1;->a(Lcom/moji/http/mqn/entity/TopicPraise;)V

    return-void
.end method
