.class public Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;
.super Lcom/moji/fancycoverflow/FancyCoverFlowAdapter;
.source "TopCircleAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;
    }
.end annotation


# instance fields
.field public a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;",
            ">;"
        }
    .end annotation
.end field

.field private b:Landroid/content/Context;


# virtual methods
.method public a(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 8

    const v0, 0x7f0901d0

    const/4 v1, 0x0

    if-nez p2, :cond_0

    .line 41
    iget-object p2, p0, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;->b:Landroid/content/Context;

    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p2

    const v2, 0x7f0b00b7

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

    move-result-object p2

    .line 42
    new-instance p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;

    invoke-direct {p3}, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;-><init>()V

    .line 43
    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    iput-object v2, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    .line 44
    invoke-virtual {p2, v0, p3}, Landroid/view/View;->setTag(ILjava/lang/Object;)V

    goto :goto_0

    .line 46
    :cond_0
    invoke-virtual {p2, v0}, Landroid/view/View;->getTag(I)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;

    .line 48
    :goto_0
    invoke-static {}, Lcom/moji/mjweather/setting/fragment/SettingDevelopConsoleFragment;->i()Z

    move-result v0

    if-eqz v0, :cond_1

    const v0, -0xff0100

    .line 49
    invoke-virtual {p2, v0}, Landroid/view/View;->setBackgroundColor(I)V

    .line 51
    :cond_1
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;->a(I)Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;

    move-result-object p1

    .line 52
    iget-object v0, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    iget v2, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->value:I

    iget v3, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->colour_level:I

    invoke-virtual {v0, v2, v3}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->a(II)V

    .line 53
    invoke-virtual {p2}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    const v2, 0x7f0e00ce

    invoke-virtual {v0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 54
    iget-boolean v2, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->isLocation:Z

    if-eqz v2, :cond_4

    .line 55
    iget-object v2, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    iget v3, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->averageValue:I

    iget-object v4, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->averageLevel:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->a(ILjava/lang/String;)V

    .line 56
    iget-object v2, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->nearby:Ljava/lang/String;

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

    move-result v2

    if-nez v2, :cond_2

    .line 57
    iget-object v0, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->nearby:Ljava/lang/String;

    .line 59
    :cond_2
    iget-object v2, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->nearby:Ljava/lang/String;

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

    move-result v2

    const/4 v3, 0x1

    if-nez v2, :cond_3

    iget-object v2, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->nearby:Ljava/lang/String;

    const-string v4, " "

    invoke-virtual {v2, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_3

    const-string v2, " "

    .line 60
    invoke-virtual {v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v2

    .line 61
    aget-object v4, v2, v1

    .line 62
    array-length v5, v2

    const/4 v6, 0x2

    if-ne v5, v6, :cond_3

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

    move-result v5

    if-nez v5, :cond_3

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v5

    const/4 v7, 0x6

    if-lt v5, v7, :cond_3

    .line 63
    new-instance v0, Ljava/lang/StringBuilder;

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

    const/4 v5, 0x3

    invoke-virtual {v4, v1, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

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

    const-string v1, "..."

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

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v1

    sub-int/2addr v1, v6

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v5

    invoke-virtual {v4, v1, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

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

    const-string v1, " "

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

    aget-object v1, v2, v3

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

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

    move-result-object v0

    .line 66
    :cond_3
    iget-object v1, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    invoke-virtual {v1, v3}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->setShowProgressLine(Z)V

    .line 68
    :cond_4
    iget-object v1, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    invoke-virtual {v1, v0}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->setAQIDesc(Ljava/lang/String;)V

    .line 69
    iget-object v0, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    iget-object p1, p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;->level:Ljava/lang/String;

    invoke-virtual {v0, p1}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->setAQILevelDesc(Ljava/lang/String;)V

    .line 70
    iget-object p1, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    invoke-virtual {p1}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->invalidate()V

    .line 71
    iget-object p1, p3, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter$ViewHolder;->a:Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;

    const-wide/16 v0, 0x3e8

    invoke-virtual {p1, v0, v1}, Lcom/moji/mjweather/aqi/view/CircleShadowAnimateView;->a(J)V

    return-object p2
.end method

.method public a(I)Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;
    .locals 1

    .line 83
    iget-object v0, p0, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;->a:Ljava/util/List;

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

    move-result-object p1

    check-cast p1, Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;

    return-object p1
.end method

.method public getCount()I
    .locals 1

    .line 78
    iget-object v0, p0, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;->a:Ljava/util/List;

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

    move-result v0

    return v0
.end method

.method public synthetic getItem(I)Ljava/lang/Object;
    .locals 0

    .line 23
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/aqi/adapter/TopCircleAdapter;->a(I)Lcom/moji/http/weather/entity/AqiDetailEntity$ResultBean$CityAqiBean;

    move-result-object p1

    return-object p1
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method
