469 lines
11 KiB
Smali
469 lines
11 KiB
Smali
.class public final enum Lcom/moji/preferences/units/UNIT_TEMP;
|
|
.super Ljava/lang/Enum;
|
|
.source "UNIT_TEMP.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Enum<",
|
|
"Lcom/moji/preferences/units/UNIT_TEMP;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final synthetic $VALUES:[Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
.field public static final enum CENTIGRADE:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
.field public static final enum FAHENHEIT:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
.field private static mContext:Landroid/content/Context;
|
|
|
|
|
|
# instance fields
|
|
.field private mHttpTag:Ljava/lang/String;
|
|
|
|
.field private mNameId:I
|
|
|
|
.field private mUnitSymbolId:I
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 13
|
|
|
|
.line 12
|
|
new-instance v6, Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
const-string v1, "CENTIGRADE"
|
|
|
|
sget v3, Lcom/moji/mjcore/R$string;->units_temp_c:I
|
|
|
|
sget v4, Lcom/moji/mjcore/R$string;->units_temp_c_symbol:I
|
|
|
|
const-string v5, "c"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
move-object v0, v6
|
|
|
|
invoke-direct/range {v0 .. v5}, Lcom/moji/preferences/units/UNIT_TEMP;-><init>(Ljava/lang/String;IIILjava/lang/String;)V
|
|
|
|
sput-object v6, Lcom/moji/preferences/units/UNIT_TEMP;->CENTIGRADE:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
.line 13
|
|
new-instance v0, Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
const-string v8, "FAHENHEIT"
|
|
|
|
sget v10, Lcom/moji/mjcore/R$string;->units_temp_f:I
|
|
|
|
sget v11, Lcom/moji/mjcore/R$string;->units_temp_f_symbol:I
|
|
|
|
const-string v12, "f"
|
|
|
|
const/4 v9, 0x1
|
|
|
|
move-object v7, v0
|
|
|
|
invoke-direct/range {v7 .. v12}, Lcom/moji/preferences/units/UNIT_TEMP;-><init>(Ljava/lang/String;IIILjava/lang/String;)V
|
|
|
|
sput-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->FAHENHEIT:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
const/4 v0, 0x2
|
|
|
|
.line 11
|
|
new-array v0, v0, [Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
sget-object v1, Lcom/moji/preferences/units/UNIT_TEMP;->CENTIGRADE:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sget-object v1, Lcom/moji/preferences/units/UNIT_TEMP;->FAHENHEIT:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->$VALUES:[Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
.line 19
|
|
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->mContext:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>(Ljava/lang/String;IIILjava/lang/String;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(II",
|
|
"Ljava/lang/String;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 20
|
|
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
|
|
.line 21
|
|
iput p3, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mNameId:I
|
|
|
|
.line 22
|
|
iput p4, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mUnitSymbolId:I
|
|
|
|
.line 23
|
|
iput-object p5, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mHttpTag:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static containsName(Ljava/lang/String;)Z
|
|
.locals 5
|
|
|
|
.line 50
|
|
invoke-static {}, Lcom/moji/preferences/units/UNIT_TEMP;->values()[Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
move-result-object v0
|
|
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v3, v1, :cond_1
|
|
|
|
aget-object v4, v0, v3
|
|
|
|
.line 51
|
|
invoke-virtual {v4}, Lcom/moji/preferences/units/UNIT_TEMP;->name()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return v2
|
|
.end method
|
|
|
|
.method public static getSymbolByCurrentUnitTemp()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
.line 63
|
|
invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/units/SettingCenter;->e()Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/units/UNIT_TEMP;->getSymbol()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getUnitTempByCurrentLanguage()Lcom/moji/preferences/units/UNIT_TEMP;
|
|
.locals 1
|
|
|
|
.line 59
|
|
sget-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->CENTIGRADE:Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getValueStringByCurrentUnitTemp(DZ)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
.line 67
|
|
invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/units/SettingCenter;->e()Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
move-result-object v0
|
|
|
|
.line 68
|
|
invoke-static {p0, p1, p2, v0}, Lcom/moji/preferences/units/UNIT_TEMP;->getValueStringByCurrentUnitTemp(DZLcom/moji/preferences/units/UNIT_TEMP;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getValueStringByCurrentUnitTemp(DZLcom/moji/preferences/units/UNIT_TEMP;)Ljava/lang/String;
|
|
.locals 3
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
.line 74
|
|
invoke-static {p0, p1}, Ljava/lang/Math;->round(D)J
|
|
|
|
move-result-wide p0
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string v0, ""
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
.line 80
|
|
invoke-virtual {p3}, Lcom/moji/preferences/units/UNIT_TEMP;->getSymbol()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 83
|
|
:cond_1
|
|
sget-object p2, Lcom/moji/preferences/units/UNIT_TEMP$1;->a:[I
|
|
|
|
invoke-virtual {p3}, Lcom/moji/preferences/units/UNIT_TEMP;->ordinal()I
|
|
|
|
move-result p3
|
|
|
|
aget p2, p2, p3
|
|
|
|
packed-switch p2, :pswitch_data_0
|
|
|
|
.line 91
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/Math;->round(D)J
|
|
|
|
move-result-wide p0
|
|
|
|
invoke-virtual {p2, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 88
|
|
:pswitch_0
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-wide v1, 0x3ffcccccc0000000L # 1.7999999523162842
|
|
|
|
mul-double p0, p0, v1
|
|
|
|
const-wide/high16 v1, 0x4040000000000000L # 32.0
|
|
|
|
add-double/2addr p0, v1
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/Math;->round(D)J
|
|
|
|
move-result-wide p0
|
|
|
|
invoke-virtual {p2, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 85
|
|
:pswitch_1
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/Math;->round(D)J
|
|
|
|
move-result-wide p0
|
|
|
|
invoke-virtual {p2, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
return-object p0
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method private isNull(Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
.line 98
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const-string v0, "null"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p1, 0x1
|
|
|
|
:goto_1
|
|
return p1
|
|
.end method
|
|
|
|
.method public static valueOf(Ljava/lang/String;)Lcom/moji/preferences/units/UNIT_TEMP;
|
|
.locals 1
|
|
|
|
.line 11
|
|
const-class v0, Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static values()[Lcom/moji/preferences/units/UNIT_TEMP;
|
|
.locals 1
|
|
|
|
.line 11
|
|
sget-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->$VALUES:[Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
invoke-virtual {v0}, [Lcom/moji/preferences/units/UNIT_TEMP;->clone()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, [Lcom/moji/preferences/units/UNIT_TEMP;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getHttpTag()Ljava/lang/String;
|
|
.locals 1
|
|
|
|
.line 46
|
|
iget-object v0, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mHttpTag:Ljava/lang/String;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getName()Ljava/lang/String;
|
|
.locals 2
|
|
|
|
.line 36
|
|
sget-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mNameId:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 37
|
|
invoke-direct {p0, v0}, Lcom/moji/preferences/units/UNIT_TEMP;->isNull(Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const-string v0, ""
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getSymbol()Ljava/lang/String;
|
|
.locals 2
|
|
|
|
.line 27
|
|
sget-object v0, Lcom/moji/preferences/units/UNIT_TEMP;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lcom/moji/preferences/units/UNIT_TEMP;->mUnitSymbolId:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 28
|
|
invoke-direct {p0, v0}, Lcom/moji/preferences/units/UNIT_TEMP;->isNull(Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const-string v0, ""
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|