395 lines
8.3 KiB
Smali
395 lines
8.3 KiB
Smali
.class public Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
.super Ljava/util/Observable;
|
|
.source "AvatarConfig.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;
|
|
|
|
|
|
# static fields
|
|
.field private static a:Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
|
|
|
|
# instance fields
|
|
.field private b:Z
|
|
|
|
.field private c:Z
|
|
|
|
.field private d:Landroid/util/SparseBooleanArray;
|
|
|
|
.field private e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
.field private f:Landroid/widget/ImageView;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private g:I
|
|
|
|
.field private h:I
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 24
|
|
new-instance v0, Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
|
|
invoke-direct {v0}, Lcom/moji/weathersence/avatar/AvatarConfig;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/weathersence/avatar/AvatarConfig;->a:Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 38
|
|
invoke-direct {p0}, Ljava/util/Observable;-><init>()V
|
|
|
|
.line 29
|
|
new-instance v0, Landroid/util/SparseBooleanArray;
|
|
|
|
invoke-direct {v0}, Landroid/util/SparseBooleanArray;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->d:Landroid/util/SparseBooleanArray;
|
|
|
|
.line 39
|
|
new-instance v0, Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
invoke-direct {v0}, Lcom/moji/preferences/DefaultPrefer;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
.line 40
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/preferences/DefaultPrefer;->a(Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;)V
|
|
|
|
.line 41
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
invoke-direct {p0, v0}, Lcom/moji/weathersence/avatar/AvatarConfig;->a(Lcom/moji/preferences/DefaultPrefer;)Z
|
|
|
|
move-result v0
|
|
|
|
iput-boolean v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->b:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a()Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
.locals 1
|
|
|
|
.line 33
|
|
sget-object v0, Lcom/moji/weathersence/avatar/AvatarConfig;->a:Lcom/moji/weathersence/avatar/AvatarConfig;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private declared-synchronized a(Lcom/moji/preferences/DefaultPrefer;)Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
.line 45
|
|
:try_start_0
|
|
invoke-virtual {p1}, Lcom/moji/preferences/DefaultPrefer;->f()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/moji/preferences/DefaultPrefer;->e()I
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
const/16 v0, 0x8
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(I)V
|
|
.locals 0
|
|
|
|
.line 119
|
|
iput p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->g:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Landroid/widget/ImageView;)V
|
|
.locals 0
|
|
.param p1 # Landroid/widget/ImageView;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 104
|
|
iput-object p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->f:Landroid/widget/ImageView;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Lcom/moji/common/area/AreaInfo;Z)V
|
|
.locals 2
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 53
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->d:Landroid/util/SparseBooleanArray;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/common/area/AreaInfo;->getCacheKey()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1, p2}, Landroid/util/SparseBooleanArray;->put(IZ)V
|
|
|
|
.line 54
|
|
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Lcom/moji/common/area/AreaInfo;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 55
|
|
invoke-virtual {p0}, Lcom/moji/weathersence/avatar/AvatarConfig;->setChanged()V
|
|
|
|
.line 56
|
|
invoke-virtual {p0}, Lcom/moji/weathersence/avatar/AvatarConfig;->notifyObservers()V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Z)V
|
|
.locals 0
|
|
|
|
.line 96
|
|
iput-boolean p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->c:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Lcom/moji/common/area/AreaInfo;)Z
|
|
.locals 2
|
|
|
|
.line 62
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->W()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 66
|
|
:cond_0
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->Y()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_5
|
|
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->Z()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 69
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/DefaultPrefer;->f()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
return v1
|
|
|
|
.line 73
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->d:Landroid/util/SparseBooleanArray;
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/moji/common/area/AreaInfo;->getCacheKey()I
|
|
|
|
move-result p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const/4 p1, -0x1
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, p1, v1}, Landroid/util/SparseBooleanArray;->get(IZ)Z
|
|
|
|
move-result p1
|
|
|
|
.line 74
|
|
iget-boolean v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->b:Z
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
if-nez p1, :cond_4
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_4
|
|
return v1
|
|
|
|
:cond_5
|
|
:goto_1
|
|
return v1
|
|
.end method
|
|
|
|
.method public b(I)V
|
|
.locals 0
|
|
|
|
.line 129
|
|
iput p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->h:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b()Z
|
|
.locals 1
|
|
|
|
.line 78
|
|
iget-boolean v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->c:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public c()Z
|
|
.locals 2
|
|
|
|
.line 108
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->f:Landroid/widget/ImageView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->f:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {v0}, Landroid/widget/ImageView;->getAlpha()F
|
|
|
|
move-result v0
|
|
|
|
const v1, 0x3f666666 # 0.9f
|
|
|
|
cmpl-float v0, v0, v1
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public d()I
|
|
.locals 1
|
|
|
|
.line 115
|
|
iget v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->g:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public e()I
|
|
.locals 1
|
|
|
|
.line 125
|
|
iget v0, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->h:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public onSharedPreferenceChanged(Landroid/content/SharedPreferences;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
.line 83
|
|
sget-object p1, Lcom/moji/preferences/DefaultPrefer$KeyConstant;->AVATAR_ID:Lcom/moji/preferences/DefaultPrefer$KeyConstant;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/preferences/DefaultPrefer$KeyConstant;->name()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const-string p1, "SettingAssistKey"
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 84
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->e:Lcom/moji/preferences/DefaultPrefer;
|
|
|
|
invoke-direct {p0, p1}, Lcom/moji/weathersence/avatar/AvatarConfig;->a(Lcom/moji/preferences/DefaultPrefer;)Z
|
|
|
|
move-result p1
|
|
|
|
iput-boolean p1, p0, Lcom/moji/weathersence/avatar/AvatarConfig;->b:Z
|
|
|
|
.line 85
|
|
invoke-virtual {p0}, Lcom/moji/weathersence/avatar/AvatarConfig;->setChanged()V
|
|
|
|
.line 86
|
|
invoke-virtual {p0}, Lcom/moji/weathersence/avatar/AvatarConfig;->notifyObservers()V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|