.class public Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;
.super Landroid/widget/LinearLayout;
.source "PhotoTagChooseLayout.java"

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


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;
    }
.end annotation


# instance fields
.field private a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/moji/mjweather/thunderstorm/TsTagLayout;",
            ">;"
        }
    .end annotation
.end field

.field private b:Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;


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

    .line 24
    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 19
    new-instance p1, Ljava/util/ArrayList;

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

    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

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

    .line 19
    new-instance p1, Ljava/util/ArrayList;

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

    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .param p2    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

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

    .line 19
    new-instance p1, Ljava/util/ArrayList;

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

    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    return-void
.end method

.method private a(ZLjava/lang/String;)V
    .locals 1

    .line 71
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->b:Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;

    if-eqz v0, :cond_0

    .line 72
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->b:Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;

    invoke-interface {v0, p0, p1, p2}, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;->a(Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;ZLjava/lang/String;)V

    :cond_0
    return-void
.end method


# virtual methods
.method public getChoose()Ljava/lang/String;
    .locals 3

    .line 87
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

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

    move-result-object v0

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

    move-result v1

    if-eqz v1, :cond_1

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

    move-result-object v1

    check-cast v1, Lcom/moji/mjweather/thunderstorm/TsTagLayout;

    .line 88
    invoke-virtual {v1}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->isSelected()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 89
    invoke-virtual {v1}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->getText()Ljava/lang/CharSequence;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_1
    const-string v0, ""

    return-object v0
.end method

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

    .line 55
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

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

    move-result-object v0

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

    move-result v1

    if-eqz v1, :cond_2

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

    move-result-object v1

    check-cast v1, Lcom/moji/mjweather/thunderstorm/TsTagLayout;

    .line 56
    invoke-virtual {v1, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v2

    const/4 v3, 0x0

    if-eqz v2, :cond_1

    .line 57
    invoke-virtual {v1}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->isSelected()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 58
    invoke-virtual {v1, v3}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->setSelected(Z)V

    .line 59
    invoke-virtual {v1}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->getText()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v3, v1}, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a(ZLjava/lang/String;)V

    goto :goto_0

    :cond_0
    const/4 v2, 0x1

    .line 61
    invoke-virtual {v1, v2}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->setSelected(Z)V

    .line 62
    invoke-virtual {v1}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->getText()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v2, v1}, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a(ZLjava/lang/String;)V

    goto :goto_0

    .line 65
    :cond_1
    invoke-virtual {v1, v3}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->setSelectedWithOutAnimation(Z)V

    goto :goto_0

    :cond_2
    return-void
.end method

.method protected onFinishInflate()V
    .locals 4

    .line 38
    invoke-super {p0}, Landroid/widget/LinearLayout;->onFinishInflate()V

    .line 39
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 40
    :goto_0
    invoke-virtual {p0}, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->getChildCount()I

    move-result v2

    if-ge v1, v2, :cond_1

    .line 41
    invoke-virtual {p0, v1}, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 42
    instance-of v3, v2, Landroid/widget/LinearLayout;

    if-eqz v3, :cond_0

    .line 43
    check-cast v2, Landroid/widget/LinearLayout;

    invoke-virtual {v2, v0}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 44
    instance-of v3, v2, Lcom/moji/mjweather/thunderstorm/TsTagLayout;

    if-eqz v3, :cond_0

    .line 45
    invoke-virtual {v2, p0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 46
    iget-object v3, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    check-cast v2, Lcom/moji/mjweather/thunderstorm/TsTagLayout;

    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

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

    goto :goto_0

    :cond_1
    return-void
.end method

.method public setOnSelectedCallback(Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;)V
    .locals 0

    .line 83
    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->b:Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout$onSelectedCallback;

    return-void
.end method

.method public varargs setText([Ljava/lang/String;)V
    .locals 3

    const/4 v0, 0x0

    .line 77
    :goto_0
    iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 78
    iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/PhotoTagChooseLayout;->a:Ljava/util/List;

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

    move-result-object v1

    check-cast v1, Lcom/moji/mjweather/thunderstorm/TsTagLayout;

    aget-object v2, p1, v0

    invoke-virtual {v1, v2}, Lcom/moji/mjweather/thunderstorm/TsTagLayout;->setText(Ljava/lang/CharSequence;)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method
