.class public Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;
.super Ljava/lang/Object;
.source "WeatherAvatarUtil.java"

# interfaces
.implements Landroid/media/MediaPlayer$OnCompletionListener;
.implements Landroid/media/MediaPlayer$OnPreparedListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil$WeatherAvatarInstanceHolder;
    }
.end annotation


# instance fields
.field public a:Lcom/moji/mjweather/weather/avatar/BaseAvatarView;

.field public b:Lcom/moji/mjweather/assshop/weather/listener/WeatherAvatarListViewListener;

.field private final c:Lcom/moji/mjweather/assshop/voice/VoicePathManger;

.field private d:Landroid/media/MediaPlayer;

.field private e:Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;

.field private f:I

.field private g:Landroid/widget/ImageView;

.field private h:Lcom/moji/mjad/avatar/data/AvatarInfo;

.field private i:I

.field private j:Z

.field private k:I

.field private l:I

.field private m:Lcom/moji/tool/drawable/MJStateDrawable;

.field private n:Z

.field private o:I


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

    .line 86
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 59
    iput-boolean v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->j:Z

    const v0, 0x7f080151

    .line 60
    iput v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->k:I

    const v0, 0x7f080501

    .line 61
    iput v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l:I

    const/4 v1, -0x1

    .line 64
    iput v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    const/4 v1, 0x0

    .line 67
    iput-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->a:Lcom/moji/mjweather/weather/avatar/BaseAvatarView;

    .line 68
    iput-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->b:Lcom/moji/mjweather/assshop/weather/listener/WeatherAvatarListViewListener;

    .line 87
    new-instance v1, Landroid/media/MediaPlayer;

    invoke-direct {v1}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    .line 88
    new-instance v1, Lcom/moji/mjweather/assshop/voice/VoicePathManger;

    invoke-direct {v1}, Lcom/moji/mjweather/assshop/voice/VoicePathManger;-><init>()V

    iput-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->c:Lcom/moji/mjweather/assshop/voice/VoicePathManger;

    .line 89
    iget-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    .line 90
    iget-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 91
    new-instance v1, Lcom/moji/tool/drawable/MJStateDrawable;

    invoke-direct {v1, v0}, Lcom/moji/tool/drawable/MJStateDrawable;-><init>(I)V

    iput-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->m:Lcom/moji/tool/drawable/MJStateDrawable;

    return-void
.end method

.method public static b()Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;
    .locals 1

    .line 79
    sget-object v0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil$WeatherAvatarInstanceHolder;->a:Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;

    return-object v0
.end method

.method private c(Lcom/moji/mjad/avatar/data/AvatarInfo;)V
    .locals 5

    .line 152
    new-instance v0, Lcom/moji/preferences/DefaultPrefer;

    invoke-direct {v0}, Lcom/moji/preferences/DefaultPrefer;-><init>()V

    .line 153
    new-instance v1, Lcom/moji/preferences/DefaultPrefer;

    invoke-direct {v1}, Lcom/moji/preferences/DefaultPrefer;-><init>()V

    invoke-virtual {v1}, Lcom/moji/preferences/DefaultPrefer;->f()Z

    move-result v1

    if-eqz p1, :cond_1

    if-eqz v1, :cond_1

    .line 156
    iget v1, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->id:I

    invoke-virtual {v0, v1}, Lcom/moji/preferences/DefaultPrefer;->a(I)V

    const/4 v1, 0x1

    .line 158
    invoke-virtual {v0, v1}, Lcom/moji/preferences/DefaultPrefer;->a(Z)V

    const-string v2, "ad_suit_avatar"

    .line 159
    iget-object v3, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->strartDate:Ljava/lang/String;

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

    move-result v2

    if-eqz v2, :cond_0

    .line 160
    iget v2, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->id:I

    invoke-virtual {v0, v2}, Lcom/moji/preferences/DefaultPrefer;->e(I)V

    goto :goto_0

    :cond_0
    const/4 v2, -0x1

    .line 162
    invoke-virtual {v0, v2}, Lcom/moji/preferences/DefaultPrefer;->e(I)V

    .line 164
    :goto_0
    sget-object v2, Lcom/moji/preferences/DefaultPrefer$KeyConstant;->AVATAR_TYPE:Lcom/moji/preferences/DefaultPrefer$KeyConstant;

    iget v3, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->type:I

    invoke-virtual {v0, v2, v3}, Lcom/moji/preferences/DefaultPrefer;->b(Lcom/moji/tool/preferences/core/IPreferKey;I)V

    .line 165
    sget-object v2, Lcom/moji/preferences/DefaultPrefer$KeyConstant;->AVATAR_NAME:Lcom/moji/preferences/DefaultPrefer$KeyConstant;

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

    invoke-virtual {v0, v2, v3}, Lcom/moji/preferences/DefaultPrefer;->b(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/String;)V

    .line 166
    sget-object v2, Lcom/moji/preferences/DefaultPrefer$KeyConstant;->AVATAR_AD_SHOW_TIME:Lcom/moji/preferences/DefaultPrefer$KeyConstant;

    new-instance v3, Ljava/lang/StringBuilder;

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

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

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

    const-string v4, "/"

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

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

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

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

    move-result-object v3

    invoke-virtual {v0, v2, v3}, Lcom/moji/preferences/DefaultPrefer;->b(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/String;)V

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

    iget p1, p1, Lcom/moji/mjad/avatar/data/AvatarInfo;->sex:I

    invoke-virtual {p0, v0, p1}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->a(II)V

    .line 170
    new-instance p1, Lcom/moji/mjweather/weather/event/ChangeAvatarEvent;

    invoke-direct {p1}, Lcom/moji/mjweather/weather/event/ChangeAvatarEvent;-><init>()V

    .line 171
    invoke-virtual {p1, v1}, Lcom/moji/mjweather/weather/event/ChangeAvatarEvent;->a(Z)V

    .line 172
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object v0

    invoke-virtual {v0, p1}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    goto :goto_1

    :cond_1
    if-nez v1, :cond_2

    const p1, 0x7f0e0119

    .line 176
    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    :cond_2
    :goto_1
    return-void
.end method

.method private l()V
    .locals 2

    .line 270
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 271
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    instance-of v0, v0, Landroid/graphics/drawable/AnimationDrawable;

    if-eqz v0, :cond_0

    .line 272
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    check-cast v0, Landroid/graphics/drawable/AnimationDrawable;

    .line 273
    invoke-virtual {v0}, Landroid/graphics/drawable/AnimationDrawable;->stop()V

    .line 275
    :cond_0
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l:I

    const v1, 0x7f080501

    if-ne v0, v1, :cond_1

    .line 276
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    iget-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->m:Lcom/moji/tool/drawable/MJStateDrawable;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 278
    :cond_1
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    iget v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l:I

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

    :cond_2
    :goto_0
    return-void
.end method


# virtual methods
.method public a(I)V
    .locals 0

    .line 120
    iput p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->i:I

    return-void
.end method

.method public a(II)V
    .locals 1

    .line 103
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->e:Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;

    if-nez v0, :cond_0

    .line 104
    new-instance v0, Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;

    invoke-direct {v0}, Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;-><init>()V

    iput-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->e:Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;

    .line 106
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->e:Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;

    invoke-virtual {v0, p1, p2}, Lcom/moji/mjweather/assshop/voice/modle/VoiceDataManager;->a(II)V

    return-void
.end method

.method public a(ILandroid/widget/ImageView;)V
    .locals 2

    .line 196
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    .line 197
    new-instance v0, Landroid/media/MediaPlayer;

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

    iput-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    .line 198
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0, p0}, Landroid/media/MediaPlayer;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    .line 199
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 201
    :cond_0
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->f:I

    if-ne p1, v0, :cond_1

    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 202
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {p1}, Landroid/media/MediaPlayer;->stop()V

    .line 203
    invoke-direct {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l()V

    return-void

    .line 206
    :cond_1
    iput p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->f:I

    .line 209
    :try_start_0
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->reset()V

    .line 210
    invoke-direct {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l()V

    .line 211
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    iget-object v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->c:Lcom/moji/mjweather/assshop/voice/VoicePathManger;

    invoke-virtual {v1, p1}, Lcom/moji/mjweather/assshop/voice/VoicePathManger;->c(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 212
    iget-object p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {p1}, Landroid/media/MediaPlayer;->prepareAsync()V

    .line 213
    iput-object p2, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    const-string p2, "WeatherAvatarUtil"

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

    :goto_0
    return-void
.end method

.method public a(Lcom/moji/mjad/avatar/data/AvatarInfo;)V
    .locals 0

    .line 95
    iput-object p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->h:Lcom/moji/mjad/avatar/data/AvatarInfo;

    return-void
.end method

.method public a(Z)V
    .locals 0

    .line 75
    iput-boolean p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->j:Z

    return-void
.end method

.method public a()Z
    .locals 1

    .line 71
    iget-boolean v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->j:Z

    return v0
.end method

.method public b(I)V
    .locals 0
    .param p1    # I
        .annotation build Landroid/support/annotation/DrawableRes;
        .end annotation
    .end param

    .line 182
    iput p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->k:I

    return-void
.end method

.method public b(Lcom/moji/mjad/avatar/data/AvatarInfo;)V
    .locals 0

    if-eqz p1, :cond_0

    .line 111
    invoke-direct {p0, p1}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->c(Lcom/moji/mjad/avatar/data/AvatarInfo;)V

    :cond_0
    return-void
.end method

.method public c()Lcom/moji/mjad/avatar/data/AvatarInfo;
    .locals 1

    .line 99
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->h:Lcom/moji/mjad/avatar/data/AvatarInfo;

    return-object v0
.end method

.method public c(I)V
    .locals 0
    .param p1    # I
        .annotation build Landroid/support/annotation/DrawableRes;
        .end annotation
    .end param

    .line 192
    iput p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l:I

    return-void
.end method

.method public d(I)V
    .locals 0

    .line 252
    iput p1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    return-void
.end method

.method public d()Z
    .locals 2

    .line 124
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->i:I

    invoke-static {}, Lcom/moji/mjweather/weather/avatar/AvatarImageUtil;->c()I

    move-result v1

    if-eq v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method public e()V
    .locals 1

    const/4 v0, 0x1

    .line 128
    iput-boolean v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->n:Z

    return-void
.end method

.method public f()I
    .locals 1

    .line 133
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->i:I

    return v0
.end method

.method g()V
    .locals 3

    .line 137
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d()Z

    move-result v0

    if-nez v0, :cond_0

    return-void

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

    move-result-object v0

    sget-object v1, Lcom/moji/statistics/EVENT_TAG;->AVATAR_CHANGE_SUCCESS:Lcom/moji/statistics/EVENT_TAG;

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

    .line 141
    invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->c()Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 143
    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_1

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

    move-result-object v1

    check-cast v1, Lcom/moji/common/area/AreaInfo;

    .line 144
    invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->b()Lcom/moji/weatherprovider/provider/WeatherProvider;

    move-result-object v2

    invoke-virtual {v2, v1}, Lcom/moji/weatherprovider/provider/WeatherProvider;->c(Lcom/moji/common/area/AreaInfo;)V

    goto :goto_0

    .line 147
    :cond_1
    new-instance v0, Lcom/moji/weatherprovider/update/WeatherUpdater;

    invoke-direct {v0}, Lcom/moji/weatherprovider/update/WeatherUpdater;-><init>()V

    invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/moji/weatherprovider/update/WeatherUpdater;->a(Lcom/moji/common/area/AreaInfo;Lcom/moji/weatherprovider/update/WeatherUpdateListener;)V

    .line 148
    invoke-virtual {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->k()V

    return-void
.end method

.method public h()V
    .locals 1

    const v0, 0x7f080151

    .line 187
    iput v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->k:I

    const v0, 0x7f080501

    .line 188
    iput v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l:I

    return-void
.end method

.method public i()V
    .locals 1

    .line 256
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_0

    .line 257
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V

    const/4 v0, 0x0

    .line 258
    iput-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    :cond_0
    return-void
.end method

.method public j()V
    .locals 1

    .line 263
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 264
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->d:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V

    .line 265
    invoke-direct {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l()V

    :cond_0
    return-void
.end method

.method public k()V
    .locals 2

    .line 287
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->h:Lcom/moji/mjad/avatar/data/AvatarInfo;

    if-eqz v0, :cond_0

    .line 288
    new-instance v0, Lcom/moji/mjad/MojiAdRequest;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/moji/mjad/MojiAdRequest;-><init>(Landroid/content/Context;)V

    new-instance v1, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil$1;

    invoke-direct {v1, p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil$1;-><init>(Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;)V

    invoke-virtual {v0, v1}, Lcom/moji/mjad/MojiAdRequest;->a(Lcom/moji/mjad/avatar/network/AvatarDownloadStatisticsRequestCallback;)V

    :cond_0
    return-void
.end method

.method public onCompletion(Landroid/media/MediaPlayer;)V
    .locals 0

    .line 247
    invoke-virtual {p1}, Landroid/media/MediaPlayer;->reset()V

    .line 248
    invoke-direct {p0}, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->l()V

    return-void
.end method

.method public onPrepared(Landroid/media/MediaPlayer;)V
    .locals 4

    .line 221
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    if-eqz v0, :cond_2

    .line 222
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    iget v1, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->k:I

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

    .line 223
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    check-cast v0, Landroid/graphics/drawable/AnimationDrawable;

    .line 224
    invoke-virtual {v0}, Landroid/graphics/drawable/AnimationDrawable;->start()V

    .line 226
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "audio"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/AudioManager;

    const/4 v1, 0x3

    .line 227
    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->getStreamVolume(I)I

    move-result v0

    if-nez v0, :cond_2

    .line 229
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    if-gtz v0, :cond_0

    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    const/4 v1, -0x1

    if-ne v0, v1, :cond_2

    .line 230
    :cond_0
    iget-object v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->g:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f0e0a27

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    .line 231
    invoke-static {}, Lcom/moji/tool/DeviceTool;->c()I

    move-result v1

    const/16 v3, 0x2d0

    if-lt v1, v3, :cond_1

    const/16 v3, 0x10

    .line 233
    div-int/lit8 v1, v1, 0x4

    invoke-virtual {v0, v3, v2, v1}, Landroid/widget/Toast;->setGravity(III)V

    .line 235
    :cond_1
    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 236
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    if-lez v0, :cond_2

    .line 237
    iget v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

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

    iput v0, p0, Lcom/moji/mjweather/assshop/weather/WeatherAvatarUtil;->o:I

    .line 242
    :cond_2
    invoke-virtual {p1}, Landroid/media/MediaPlayer;->start()V

    return-void
.end method
