.class public Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;
.super Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;
.source "WeatherUnUseState.java"


# instance fields
.field private l:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarStateControl;)V
    .locals 0

    .line 31
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;-><init>(Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarStateControl;)V

    return-void
.end method


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

    .line 83
    invoke-super {p0}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;->a()V

    .line 84
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    sget-object v1, Lcom/moji/mjad/avatar/data/AVATAR_STATUS;->AVATAR_STATE_AVAILABLE:Lcom/moji/mjad/avatar/data/AVATAR_STATUS;

    iput-object v1, v0, Lcom/moji/mjad/avatar/data/AvatarInfo;->status:Lcom/moji/mjad/avatar/data/AVATAR_STATUS;

    return-void
.end method

.method public a(F)V
    .locals 0

    .line 89
    invoke-super {p0, p1}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;->a(F)V

    return-void
.end method

.method public a(Lcom/moji/mjweather/weather/avatar/AvatarView;Landroid/widget/ImageView;)V
    .locals 1

    .line 36
    invoke-super {p0, p1, p2}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;->a(Lcom/moji/mjweather/weather/avatar/AvatarView;Landroid/widget/ImageView;)V

    .line 37
    invoke-static {}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->b()Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->l:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    .line 39
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->l:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    invoke-virtual {p1}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->h()V

    .line 40
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->l:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget v0, v0, Lcom/moji/mjad/avatar/data/AvatarInfo;->voiceId:I

    invoke-virtual {p1, v0, p2}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->a(ILandroid/widget/ImageView;)V

    .line 41
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget-object p1, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->prefix:Ljava/lang/String;

    iget-object p2, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget p2, p2, Lcom/moji/mjad/avatar/data/AvatarInfo;->id:I

    const/4 v0, 0x1

    invoke-virtual {p0, v0, p1, p2}, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->a(ZLjava/lang/String;I)V

    const-string p1, "chao1"

    const-string p2, "preformClick:UnUseSate"

    .line 43
    invoke-static {p1, p2}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a(ZLjava/lang/Object;)V
    .locals 0

    .line 48
    invoke-super {p0, p1, p2}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;->a(ZLjava/lang/Object;)V

    .line 49
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    sget-object p2, Lcom/moji/mjad/avatar/data/AVATAR_STATUS;->AVATAR_STATE_USING:Lcom/moji/mjad/avatar/data/AVATAR_STATUS;

    iput-object p2, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->status:Lcom/moji/mjad/avatar/data/AVATAR_STATUS;

    return-void
.end method

.method public a(ZLjava/lang/String;I)V
    .locals 3

    .line 55
    new-instance v0, Ljava/io/File;

    new-instance v1, Ljava/lang/StringBuilder;

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

    sget-object v2, Lcom/moji/mjweather/weather/avatar/AvatarImageUtil;->a:Ljava/lang/String;

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

    const-string v2, "avatar"

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

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

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

    move-result-object v1

    const-string v2, "mona.gif"

    invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v1, 0x0

    const/16 v2, 0x8

    if-ne p3, v2, :cond_0

    .line 56
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 59
    :try_start_0
    new-instance p2, Lpl/droidsonroids/gif/GifDrawable;

    invoke-direct {p2, v0}, Lpl/droidsonroids/gif/GifDrawable;-><init>(Ljava/io/File;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p2

    .line 61
    invoke-virtual {p2}, Ljava/io/IOException;->printStackTrace()V

    move-object p2, v1

    :goto_0
    if-eqz p2, :cond_2

    .line 64
    iget-object p3, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->g:Lcom/moji/mjweather/weather/avatar/AvatarView;

    invoke-virtual {p3}, Lcom/moji/mjweather/weather/avatar/AvatarView;->getmAvatarIV()Lcom/moji/mjweather/weather/avatar/CityImageView;

    move-result-object p3

    invoke-virtual {p3, v1}, Lcom/moji/mjweather/weather/avatar/CityImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 65
    iget-object p3, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->g:Lcom/moji/mjweather/weather/avatar/AvatarView;

    invoke-static {p3, p2}, Landroid/support/v4/view/ViewCompat;->setBackground(Landroid/view/View;Landroid/graphics/drawable/Drawable;)V

    goto :goto_1

    .line 68
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->g:Lcom/moji/mjweather/weather/avatar/AvatarView;

    invoke-static {v0, v1}, Landroid/support/v4/view/ViewCompat;->setBackground(Landroid/view/View;Landroid/graphics/drawable/Drawable;)V

    .line 69
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->g:Lcom/moji/mjweather/weather/avatar/AvatarView;

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

    move-result v2

    if-eqz v2, :cond_1

    new-instance p2, Ljava/lang/StringBuilder;

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

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

    const-string p3, ""

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

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

    move-result-object p2

    :cond_1
    invoke-virtual {v0, p2}, Lcom/moji/mjweather/weather/avatar/AvatarView;->setDefaultAvatar(Ljava/lang/String;)V

    .line 72
    :cond_2
    :goto_1
    iget-object p2, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->l:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    iget-object p3, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    invoke-virtual {p2, p3}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->b(Lcom/moji/mjad/avatar/data/AvatarInfo;)V

    .line 74
    iget-object p2, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->e:Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter;

    iget-object p3, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget p3, p3, Lcom/moji/mjad/avatar/data/AvatarInfo;->id:I

    invoke-virtual {p2, p3}, Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter;->g(I)V

    .line 76
    invoke-virtual {p0, p1, v1}, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->a(ZLjava/lang/Object;)V

    .line 78
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object p1

    sget-object p2, Lcom/moji/statistics/EVENT_TAG;->AVATAR_PREVIEW_SUCCESS:Lcom/moji/statistics/EVENT_TAG;

    invoke-virtual {p1, p2}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;)Lcom/moji/statistics/EventManager;

    return-void
.end method

.method public b()V
    .locals 3

    .line 94
    invoke-super {p0}, Lcom/moji/mjweather/assshop/weather/state/WeatherAvatarState;->b()V

    const-string v0, "chao"

    .line 95
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "initAvatarUI-UnUse:"

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

    iget-object v2, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->c:Lcom/moji/mjad/avatar/data/AvatarInfo;

    iget-object v2, v2, Lcom/moji/mjad/avatar/data/AvatarInfo;->name:Ljava/lang/String;

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

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

    move-result-object v1

    invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 96
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->d:Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;

    iget-object v0, v0, Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;->s:Landroid/widget/ImageView;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 97
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->d:Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;

    iget-object v0, v0, Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;->q:Lcom/moji/circleprogress/SectorProgressView;

    invoke-virtual {v0, v1}, Lcom/moji/circleprogress/SectorProgressView;->setVisibility(I)V

    .line 98
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->d:Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;

    iget-object v0, v0, Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;->q:Lcom/moji/circleprogress/SectorProgressView;

    const/high16 v1, 0x44fa0000    # 2000.0f

    invoke-virtual {v0, v1}, Lcom/moji/circleprogress/SectorProgressView;->setProgress(F)V

    .line 99
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/state/WeatherUnUseState;->d:Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;

    iget-object v0, v0, Lcom/moji/mjweather/assshop/weather/adapter/WeatherAvatarAdapter$AvatarHolder;->p:Landroid/widget/TextView;

    const v1, 0x7f06023a

    invoke-static {v1}, Lcom/moji/tool/DeviceTool;->e(I)I

    move-result v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    return-void
.end method
