.class public Lcom/moji/forum/ui/DelPictureActivity;
.super Lcom/moji/forum/base/ForumBaseActivity;
.source "DelPictureActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;
    }
.end annotation


# static fields
.field public static final CURRENT_POS:Ljava/lang/String; = "current_pos"

.field public static final TOTAL_IMAGE_ID:Ljava/lang/String; = "total_iamge_id"


# instance fields
.field private i:Landroid/support/v4/view/ViewPager;

.field private j:Lcom/moji/emotion/CityIndexControlView;

.field private k:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/moji/http/ugc/bean/ImageInfo;",
            ">;"
        }
    .end annotation
.end field

.field private l:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/moji/imageview/TouchImageView;",
            ">;"
        }
    .end annotation
.end field

.field private m:Z

.field private n:Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;

.field private o:I


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 23
    invoke-direct {p0}, Lcom/moji/forum/base/ForumBaseActivity;-><init>()V

    .line 29
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    .line 30
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    const/4 v0, 0x0

    .line 31
    iput-boolean v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->m:Z

    return-void
.end method

.method static synthetic a(Lcom/moji/forum/ui/DelPictureActivity;I)I
    .locals 0

    .line 23
    iput p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    return p1
.end method

.method static synthetic a(Lcom/moji/forum/ui/DelPictureActivity;)Ljava/util/ArrayList;
    .locals 0

    .line 23
    iget-object p0, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    return-object p0
.end method

.method static synthetic a(Lcom/moji/forum/ui/DelPictureActivity;Landroid/widget/ImageView;Ljava/lang/String;)V
    .locals 0

    .line 23
    invoke-virtual {p0, p1, p2}, Lcom/moji/forum/ui/DelPictureActivity;->a(Landroid/widget/ImageView;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic b(Lcom/moji/forum/ui/DelPictureActivity;)Lcom/moji/emotion/CityIndexControlView;
    .locals 0

    .line 23
    iget-object p0, p0, Lcom/moji/forum/ui/DelPictureActivity;->j:Lcom/moji/emotion/CityIndexControlView;

    return-object p0
.end method

.method static synthetic c(Lcom/moji/forum/ui/DelPictureActivity;)I
    .locals 0

    .line 23
    iget p0, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    return p0
.end method

.method static synthetic d(Lcom/moji/forum/ui/DelPictureActivity;)Landroid/widget/TextView;
    .locals 0

    .line 23
    iget-object p0, p0, Lcom/moji/forum/ui/DelPictureActivity;->c:Landroid/widget/TextView;

    return-object p0
.end method

.method static synthetic e(Lcom/moji/forum/ui/DelPictureActivity;)Ljava/util/ArrayList;
    .locals 0

    .line 23
    iget-object p0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    return-object p0
.end method

.method private j()V
    .locals 3

    .line 139
    iget-boolean v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->m:Z

    if-eqz v0, :cond_0

    .line 140
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    const-string v1, "total_iamge_id"

    .line 141
    iget-object v2, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    const/4 v1, 0x0

    .line 142
    invoke-virtual {p0, v1, v0}, Lcom/moji/forum/ui/DelPictureActivity;->setResult(ILandroid/content/Intent;)V

    .line 144
    :cond_0
    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->finish()V

    return-void
.end method


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

    .line 55
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    new-instance v1, Lcom/moji/forum/ui/DelPictureActivity$1;

    invoke-direct {v1, p0}, Lcom/moji/forum/ui/DelPictureActivity$1;-><init>(Lcom/moji/forum/ui/DelPictureActivity;)V

    invoke-virtual {v0, v1}, Landroid/support/v4/view/ViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    return-void
.end method

.method protected b()V
    .locals 5

    .line 78
    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v2, "total_iamge_id"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 80
    :try_start_0
    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v2, "total_iamge_id"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Ljava/util/ArrayList;

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    .line 81
    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v2, "current_pos"

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 85
    :catch_0
    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v2, 0x1

    if-ge v1, v0, :cond_3

    .line 86
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/http/ugc/bean/ImageInfo;

    iget v0, v0, Lcom/moji/http/ugc/bean/ImageInfo;->type:I

    if-ne v0, v2, :cond_1

    .line 87
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

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

    goto :goto_1

    .line 89
    :cond_1
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/http/ugc/bean/ImageInfo;

    iget v0, v0, Lcom/moji/http/ugc/bean/ImageInfo;->type:I

    if-nez v0, :cond_2

    .line 90
    new-instance v0, Lcom/moji/imageview/TouchImageView;

    invoke-direct {v0, p0}, Lcom/moji/imageview/TouchImageView;-><init>(Landroid/content/Context;)V

    .line 91
    new-instance v3, Landroid/view/ViewGroup$LayoutParams;

    const/4 v4, -0x1

    invoke-direct {v3, v4, v4}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v3}, Lcom/moji/imageview/TouchImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 92
    iget-object v3, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    :cond_2
    :goto_1
    add-int/2addr v1, v2

    goto :goto_0

    .line 95
    :cond_3
    new-instance v0, Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;

    invoke-direct {v0, p0}, Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;-><init>(Lcom/moji/forum/ui/DelPictureActivity;)V

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->n:Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;

    .line 96
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    iget-object v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->n:Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;

    invoke-virtual {v0, v1}, Landroid/support/v4/view/ViewPager;->setAdapter(Landroid/support/v4/view/PagerAdapter;)V

    .line 97
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    iget v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {v0, v1}, Landroid/support/v4/view/ViewPager;->setCurrentItem(I)V

    .line 98
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->j:Lcom/moji/emotion/CityIndexControlView;

    iget-object v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    iget v3, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {v0, v1, v3}, Lcom/moji/emotion/CityIndexControlView;->c(II)V

    .line 99
    iget-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->c:Landroid/widget/TextView;

    new-instance v1, Ljava/lang/StringBuilder;

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

    iget v3, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    add-int/2addr v3, v2

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

    const-string v2, "/"

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

    iget-object v2, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

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

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

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    return-void
.end method

.method protected c()V
    .locals 3

    .line 43
    invoke-virtual {p0}, Lcom/moji/forum/ui/DelPictureActivity;->d()V

    .line 45
    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    sget v1, Lcom/moji/forum/R$layout;->del_picture_menu:I

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 46
    sget v1, Lcom/moji/forum/R$id;->fl_del_pic:I

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

    move-result-object v1

    check-cast v1, Landroid/widget/FrameLayout;

    .line 47
    invoke-virtual {v1, p0}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 48
    invoke-virtual {p0, v0}, Lcom/moji/forum/ui/DelPictureActivity;->a(Landroid/view/View;)V

    .line 49
    sget v0, Lcom/moji/forum/R$id;->imagePager:I

    invoke-virtual {p0, v0}, Lcom/moji/forum/ui/DelPictureActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/support/v4/view/ViewPager;

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    .line 50
    sget v0, Lcom/moji/forum/R$id;->image_index_control:I

    invoke-virtual {p0, v0}, Lcom/moji/forum/ui/DelPictureActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/moji/emotion/CityIndexControlView;

    iput-object v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->j:Lcom/moji/emotion/CityIndexControlView;

    return-void
.end method

.method protected e()V
    .locals 1

    .line 37
    sget v0, Lcom/moji/forum/R$layout;->activity_del_picture:I

    invoke-virtual {p0, v0}, Lcom/moji/forum/ui/DelPictureActivity;->setContentView(I)V

    return-void
.end method

.method public onBackPressed()V
    .locals 0

    .line 149
    invoke-direct {p0}, Lcom/moji/forum/ui/DelPictureActivity;->j()V

    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 3

    .line 154
    invoke-static {}, Lcom/moji/forum/common/ForumUtil;->d()Z

    move-result v0

    if-nez v0, :cond_0

    return-void

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

    move-result p1

    .line 158
    sget v0, Lcom/moji/forum/R$id;->fl_del_pic:I

    if-ne p1, v0, :cond_3

    .line 159
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    iget v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 160
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    iget v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 161
    iget p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    const/4 v0, 0x1

    sub-int/2addr p1, v0

    if-ltz p1, :cond_1

    iget p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    sub-int/2addr p1, v0

    goto :goto_0

    :cond_1
    const/4 p1, 0x0

    :goto_0
    iput p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    .line 162
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->j:Lcom/moji/emotion/CityIndexControlView;

    iget-object v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    iget v2, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {p1, v1, v2}, Lcom/moji/emotion/CityIndexControlView;->c(II)V

    .line 163
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result p1

    if-eqz p1, :cond_2

    .line 164
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->c:Landroid/widget/TextView;

    new-instance v1, Ljava/lang/StringBuilder;

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

    iget v2, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    add-int/2addr v2, v0

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

    const-string v2, "/"

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

    iget-object v2, p0, Lcom/moji/forum/ui/DelPictureActivity;->l:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

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

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

    move-result-object v1

    invoke-virtual {p1, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 165
    :cond_2
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    iget-object v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->n:Lcom/moji/forum/ui/DelPictureActivity$ImagePagerAdapter;

    invoke-virtual {p1, v1}, Landroid/support/v4/view/ViewPager;->setAdapter(Landroid/support/v4/view/PagerAdapter;)V

    .line 166
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->i:Landroid/support/v4/view/ViewPager;

    iget v1, p0, Lcom/moji/forum/ui/DelPictureActivity;->o:I

    invoke-virtual {p1, v1}, Landroid/support/v4/view/ViewPager;->setCurrentItem(I)V

    .line 167
    iput-boolean v0, p0, Lcom/moji/forum/ui/DelPictureActivity;->m:Z

    .line 168
    iget-object p1, p0, Lcom/moji/forum/ui/DelPictureActivity;->k:Ljava/util/ArrayList;

    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result p1

    if-nez p1, :cond_4

    .line 169
    invoke-direct {p0}, Lcom/moji/forum/ui/DelPictureActivity;->j()V

    goto :goto_1

    .line 171
    :cond_3
    sget v0, Lcom/moji/forum/R$id;->iv_title_back:I

    if-ne p1, v0, :cond_4

    .line 172
    invoke-direct {p0}, Lcom/moji/forum/ui/DelPictureActivity;->j()V

    :cond_4
    :goto_1
    return-void
.end method
