Weather/smali_classes2/com/moji/mjweather/weather/window/LabelWindow.smali
2021-05-10 10:13:34 +02:00

856 lines
20 KiB
Smali

.class public Lcom/moji/mjweather/weather/window/LabelWindow;
.super Landroid/widget/RelativeLayout;
.source "LabelWindow.java"
# interfaces
.implements Lcom/moji/mjweather/weather/window/IWindow;
.implements Lcom/moji/mjweather/weather/window/IWindowEvent;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;,
Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;
}
.end annotation
# static fields
.field private static final e:I
# instance fields
.field protected a:Lcom/moji/http/show/IWindowData;
.field protected b:I
.field protected c:Ljava/lang/String;
.field private d:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
.field private f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
# direct methods
.method static constructor <clinit>()V
.locals 2
.line 34
sget v0, Lcom/moji/mjweather/weather/avatar/BaseAvatar;->b:F
const/high16 v1, 0x42300000 # 44.0f
mul-float v0, v0, v1
float-to-int v0, v0
sput v0, Lcom/moji/mjweather/weather/window/LabelWindow;->e:I
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.locals 0
.line 87
invoke-direct {p0, p1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V
const-string p1, ""
.line 33
iput-object p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->c:Ljava/lang/String;
.line 88
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->c()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 0
.line 92
invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const-string p1, ""
.line 33
iput-object p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->c:Ljava/lang/String;
.line 93
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->c()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 0
.line 97
invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
const-string p1, ""
.line 33
iput-object p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->c:Ljava/lang/String;
.line 98
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->c()V
return-void
.end method
.method static synthetic a(Lcom/moji/mjweather/weather/window/LabelWindow;)V
.locals 0
.line 28
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->d()V
return-void
.end method
.method static synthetic a(Lcom/moji/mjweather/weather/window/LabelWindow;Landroid/view/ViewGroup;)V
.locals 0
.line 28
invoke-direct {p0, p1}, Lcom/moji/mjweather/weather/window/LabelWindow;->b(Landroid/view/ViewGroup;)V
return-void
.end method
.method static synthetic b()I
.locals 1
.line 28
sget v0, Lcom/moji/mjweather/weather/window/LabelWindow;->e:I
return v0
.end method
.method private b(Landroid/view/ViewGroup;)V
.locals 1
.line 182
:try_start_0
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-nez v0, :cond_0
.line 183
invoke-virtual {p1, p0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
goto :goto_0
.line 184
:cond_0
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-eq v0, p1, :cond_1
.line 185
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getParent()Landroid/view/ViewParent;
move-result-object v0
check-cast v0, Landroid/view/ViewGroup;
invoke-virtual {v0, p0}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V
.line 186
invoke-virtual {p1, p0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p1
const-string v0, "LabelWindow"
.line 189
invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
:cond_1
:goto_0
return-void
.end method
.method private c()V
.locals 3
const/16 v0, 0x8
.line 107
invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/window/LabelWindow;->setVisibility(I)V
.line 108
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
move-result-object v0
const/4 v1, -0x1
if-nez v0, :cond_0
.line 110
new-instance v0, Landroid/view/ViewGroup$LayoutParams;
const/4 v2, -0x2
invoke-direct {v0, v1, v2}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V
.line 111
invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/window/LabelWindow;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
goto :goto_0
.line 113
:cond_0
iput v1, v0, Landroid/view/ViewGroup$LayoutParams;->width:I
.line 115
:goto_0
sget-object v0, Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;->AUTO:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
iput-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->d:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
.line 116
new-instance v0, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
invoke-direct {v0, p0}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;-><init>(Lcom/moji/mjweather/weather/window/LabelWindow;)V
iput-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
return-void
.end method
.method private d()V
.locals 0
.line 214
invoke-super {p0}, Landroid/widget/RelativeLayout;->removeAllViews()V
return-void
.end method
.method private h()V
.locals 2
.line 294
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->a:Lcom/moji/http/show/IWindowData;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->a:Lcom/moji/http/show/IWindowData;
invoke-interface {v0}, Lcom/moji/http/show/IWindowData;->g()I
move-result v0
const/4 v1, 0x1
if-ne v0, v1, :cond_0
.line 295
sget-object v0, Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;->MANUAL:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
iput-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->d:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
goto :goto_0
.line 297
:cond_0
sget-object v0, Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;->AUTO:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
iput-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->d:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
:goto_0
return-void
.end method
.method private i()Z
.locals 2
.line 301
invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;
move-result-object v0
invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;
move-result-object v1
if-ne v0, v1, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
# virtual methods
.method public a()V
.locals 2
.line 219
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x0
.line 220
invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/window/LabelWindow;->setVisibility(I)V
goto :goto_0
.line 222
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0x21
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->sendEmptyMessage(I)Z
:goto_0
return-void
.end method
.method protected a(I)V
.locals 6
.line 272
invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;
move-result-object v0
sget-object v1, Lcom/moji/statistics/EVENT_TAG;->AVATAR_WINDOWS_SHOW:Lcom/moji/statistics/EVENT_TAG;
iget-object v2, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->c:Ljava/lang/String;
const/4 v3, 0x3
new-array v3, v3, [Ljava/lang/Object;
iget v4, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->b:I
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
const/4 v5, 0x0
aput-object v4, v3, v5
iget-object v4, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->a:Lcom/moji/http/show/IWindowData;
if-nez v4, :cond_0
const-wide/16 v4, -0x1
goto :goto_0
:cond_0
iget-object v4, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->a:Lcom/moji/http/show/IWindowData;
invoke-interface {v4}, Lcom/moji/http/show/IWindowData;->k()J
move-result-wide v4
:goto_0
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v4
const/4 v5, 0x1
aput-object v4, v3, v5
const/4 v4, 0x2
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, v3, v4
invoke-static {v3}, Lcom/moji/statistics/EventParams;->getProperty([Ljava/lang/Object;)Lorg/json/JSONObject;
move-result-object p1
invoke-virtual {v0, v1, v2, p1}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;Ljava/lang/String;Lorg/json/JSONObject;)Lcom/moji/statistics/EventManager;
return-void
.end method
.method public a(Landroid/view/ViewGroup;)V
.locals 2
.line 171
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
.line 172
invoke-direct {p0, p1}, Lcom/moji/mjweather/weather/window/LabelWindow;->b(Landroid/view/ViewGroup;)V
goto :goto_0
.line 174
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0xb
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->obtainMessage(I)Landroid/os/Message;
move-result-object v0
.line 175
iput-object p1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;
.line 176
invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
:goto_0
return-void
.end method
.method public a(ZZ)V
.locals 0
.line 262
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->a()V
if-eqz p2, :cond_0
const/4 p1, 0x2
goto :goto_0
:cond_0
if-eqz p1, :cond_1
const/4 p1, 0x1
goto :goto_0
:cond_1
const/4 p1, 0x0
.line 268
:goto_0
invoke-virtual {p0, p1}, Lcom/moji/mjweather/weather/window/LabelWindow;->a(I)V
return-void
.end method
.method public addView(Landroid/view/View;)V
.locals 2
.line 195
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
.line 196
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;)V
goto :goto_0
.line 198
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0x16
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->obtainMessage(I)Landroid/os/Message;
move-result-object v0
.line 199
iput-object p1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;
.line 200
invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
:goto_0
return-void
.end method
.method public e()V
.locals 2
.line 228
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
const/16 v0, 0x8
.line 229
invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/window/LabelWindow;->setVisibility(I)V
goto :goto_0
.line 231
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0x2c
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->sendEmptyMessage(I)Z
:goto_0
return-void
.end method
.method public f()V
.locals 2
.line 238
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
const/16 v0, 0x8
.line 239
invoke-virtual {p0, v0}, Lcom/moji/mjweather/weather/window/LabelWindow;->setVisibility(I)V
goto :goto_0
.line 241
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0x37
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->sendEmptyMessage(I)Z
:goto_0
return-void
.end method
.method public g()Z
.locals 1
.line 247
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getParent()Landroid/view/ViewParent;
move-result-object v0
if-eqz v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
return v0
.end method
.method public getShowTime()J
.locals 2
const-wide/16 v0, 0x0
return-wide v0
.end method
.method public getShowType()Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
.locals 1
.line 282
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->d:Lcom/moji/mjweather/weather/window/IWindow$SHOW_TYPE;
return-object v0
.end method
.method public getView()Landroid/view/View;
.locals 0
return-object p0
.end method
.method protected onLayout(ZIIII)V
.locals 9
.line 121
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getChildCount()I
move-result p1
.line 122
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getMeasuredWidth()I
move-result p2
.line 123
invoke-virtual {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->getMeasuredHeight()I
move-result p3
const/4 p4, 0x0
:goto_0
if-ge p4, p1, :cond_2
.line 127
invoke-virtual {p0, p4}, Lcom/moji/mjweather/weather/window/LabelWindow;->getChildAt(I)Landroid/view/View;
move-result-object p5
.line 128
invoke-virtual {p5}, Landroid/view/View;->getVisibility()I
move-result v0
const/16 v1, 0x8
if-eq v0, v1, :cond_1
.line 129
invoke-virtual {p5}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v0
if-eqz v0, :cond_1
invoke-virtual {p5}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v0
instance-of v0, v0, Lcom/moji/mjweather/weather/window/ILabel;
if-eqz v0, :cond_1
.line 130
invoke-virtual {p5}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/moji/mjweather/weather/window/ILabel;
.line 131
invoke-virtual {p5}, Landroid/view/View;->getMeasuredWidth()I
move-result v1
.line 132
invoke-virtual {p5}, Landroid/view/View;->getMeasuredHeight()I
move-result v2
.line 134
sget-object v3, Lcom/moji/mjweather/weather/window/LabelWindow$1;->a:[I
invoke-interface {v0}, Lcom/moji/mjweather/weather/window/ILabel;->b()Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;
move-result-object v4
invoke-virtual {v4}, Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;->ordinal()I
move-result v4
aget v3, v3, v4
const/4 v4, 0x1
const-wide v5, 0x3fc999999999999aL # 0.2
if-eq v3, v4, :cond_0
sub-int v3, p2, v1
.line 145
invoke-interface {v0}, Lcom/moji/mjweather/weather/window/ILabel;->b()Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;
move-result-object v4
iget v4, v4, Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;->mMarginRight:I
sub-int/2addr v3, v4
.line 146
div-int/lit8 v4, v2, 0x2
sub-int v4, p3, v4
invoke-interface {v0}, Lcom/moji/mjweather/weather/window/ILabel;->b()Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;
move-result-object v0
iget v0, v0, Lcom/moji/mjweather/weather/window/LabelWindow$LABEL_POSITION;->mMarginBottom:I
sub-int/2addr v4, v0
sget v0, Lcom/moji/mjweather/weather/avatar/BaseAvatar;->a:I
int-to-double v7, v0
invoke-static {v7, v8}, Ljava/lang/Double;->isNaN(D)Z
mul-double v7, v7, v5
double-to-int v0, v7
sub-int/2addr v4, v0
add-int/2addr v1, v3
add-int/2addr v2, v4
.line 150
invoke-virtual {p5, v3, v4, v1, v2}, Landroid/view/View;->layout(IIII)V
goto :goto_1
:cond_0
sub-int v0, p2, v1
sub-int v1, p3, v2
.line 136
sget v3, Lcom/moji/mjweather/weather/avatar/BaseAvatar;->a:I
int-to-double v3, v3
invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z
mul-double v3, v3, v5
double-to-int v3, v3
sub-int/2addr v1, v3
div-int/lit8 v1, v1, 0x2
add-int/2addr v2, p3
sget v3, Lcom/moji/mjweather/weather/avatar/BaseAvatar;->a:I
int-to-double v3, v3
invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z
mul-double v3, v3, v5
double-to-int v3, v3
sub-int/2addr v2, v3
div-int/lit8 v2, v2, 0x2
invoke-virtual {p5, v0, v1, p2, v2}, Landroid/view/View;->layout(IIII)V
:cond_1
:goto_1
add-int/lit8 p4, p4, 0x1
goto/16 :goto_0
:cond_2
return-void
.end method
.method protected onMeasure(II)V
.locals 1
.line 165
sget p2, Lcom/moji/mjweather/weather/avatar/BaseAvatar;->a:I
const/high16 v0, 0x40000000 # 2.0f
invoke-static {p2, v0}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result p2
.line 166
invoke-super {p0, p1, p2}, Landroid/widget/RelativeLayout;->onMeasure(II)V
return-void
.end method
.method public removeAllViews()V
.locals 2
.line 206
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->i()Z
move-result v0
if-eqz v0, :cond_0
.line 207
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->d()V
goto :goto_0
.line 209
:cond_0
iget-object v0, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->f:Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;
const/16 v1, 0x42
invoke-virtual {v0, v1}, Lcom/moji/mjweather/weather/window/LabelWindow$ViewHandler;->sendEmptyMessage(I)Z
:goto_0
return-void
.end method
.method public setEventType(I)V
.locals 0
.line 252
iput p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->b:I
return-void
.end method
.method public setEventValue(Ljava/lang/String;)V
.locals 0
.line 257
iput-object p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->c:Ljava/lang/String;
return-void
.end method
.method public setWindowData(Lcom/moji/http/show/IWindowData;)V
.locals 0
.line 102
iput-object p1, p0, Lcom/moji/mjweather/weather/window/LabelWindow;->a:Lcom/moji/http/show/IWindowData;
.line 103
invoke-direct {p0}, Lcom/moji/mjweather/weather/window/LabelWindow;->h()V
return-void
.end method