a.smali
.class public Lcom/fulishe/shadow/toast/c/a;
.super Ljava/lang/Object;
.source ""
# static fields
.field public static a:Ljava/util/Timer;
.field public static b:Ljava/util/TimerTask;
.field public static c:Landroid/os/Handler;
.field public static d:Landroid/view/WindowManager$LayoutParams;
.field public static e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
# instance fields
.field public f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
.field public g:Landroid/view/WindowManager;
.field public h:Ljava/lang/Long;
.field public i:Landroid/view/View;
.field public j:Ljava/lang/CharSequence;
# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/CharSequence;II)V
.registers 11
const-wide/16 v2, 0x7d0
const/4 v1, 0x0
const/4 v5, 0x1
const/4 v4, -0x2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
iput-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->h:Ljava/lang/Long;
const-string v0, "window"
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/WindowManager;
iput-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->g:Landroid/view/WindowManager;
iput-object p2, p0, Lcom/fulishe/shadow/toast/c/a;->j:Ljava/lang/CharSequence;
if-nez p3, :cond_84
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
iput-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->h:Ljava/lang/Long;
:cond_22
:goto_22
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
if-nez v0, :cond_4f
new-instance v0, Landroid/view/WindowManager$LayoutParams;
invoke-direct {v0}, Landroid/view/WindowManager$LayoutParams;-><init>()V
sput-object v0, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
iput v4, v0, Landroid/view/WindowManager$LayoutParams;->height:I
iput v4, v0, Landroid/view/WindowManager$LayoutParams;->width:I
const/4 v2, -0x3
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->format:I
const/4 v2, -0x1
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
const/16 v2, 0x98
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
const/16 v2, 0x10
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->gravity:I
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0x17
if-le v0, v2, :cond_96
const/16 v2, 0x1a
if-lt v0, v2, :cond_8f
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
const/16 v2, 0x7f6
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->type:I
:cond_4f
:goto_4f
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->c:Landroid/os/Handler;
if-nez v0, :cond_5a
new-instance v0, Lcom/fulishe/shadow/toast/c/a$a;
invoke-direct {v0, p0}, Lcom/fulishe/shadow/toast/c/a$a;-><init>(Lcom/fulishe/shadow/toast/c/a;)V
sput-object v0, Lcom/fulishe/shadow/toast/c/a;->c:Landroid/os/Handler;
:cond_5a
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
if-nez v0, :cond_83
new-instance v0, Lcom/fulishe/shadow/toast/XMPrimaryToast;
invoke-direct {v0, p1}, Lcom/fulishe/shadow/toast/XMPrimaryToast;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
const-string v0, "layout_inflater"
invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/LayoutInflater;
if-eq p4, v5, :cond_9d
move-object v0, v1
:goto_70
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
invoke-virtual {v1, p2}, Lcom/fulishe/shadow/toast/XMPrimaryToast;->setText(Ljava/lang/CharSequence;)V
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
invoke-virtual {v1, v0}, Landroid/widget/Toast;->setView(Landroid/view/View;)V
iget-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
invoke-virtual {v0}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v0
invoke-direct {p0, v0}, Lcom/fulishe/shadow/toast/c/a;->a(Landroid/view/View;)V
:cond_83
return-void
:cond_84
if-ne p3, v5, :cond_22
const-wide/16 v2, 0xdac
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
iput-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->h:Ljava/lang/Long;
goto :goto_22
:cond_8f
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
const/16 v2, 0x7d2
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->type:I
goto :goto_4f
:cond_96
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
const/16 v2, 0x7d5
iput v2, v0, Landroid/view/WindowManager$LayoutParams;->type:I
goto :goto_4f
:cond_9d
sget v2, Lcom/fulishe/mediation/R$layout;->xm_layout_toast:I
invoke-virtual {v0, v2, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v1
iget-object v2, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
sget v0, Lcom/fulishe/mediation/R$id;->msg:I
invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
invoke-virtual {v2, v0}, Lcom/fulishe/shadow/toast/XMPrimaryToast;->a(Landroid/widget/TextView;)V
move-object v0, v1
goto :goto_70
.end method
.method public static synthetic a()Landroid/os/Handler;
.registers 1
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->c:Landroid/os/Handler;
return-object v0
.end method
.method public static a(Landroid/content/Context;Ljava/lang/CharSequence;I)Lcom/fulishe/shadow/toast/c/a;
.registers 5
new-instance v0, Lcom/fulishe/shadow/toast/c/a;
const/4 v1, 0x1
invoke-direct {v0, p0, p1, p2, v1}, Lcom/fulishe/shadow/toast/c/a;-><init>(Landroid/content/Context;Ljava/lang/CharSequence;II)V
return-object v0
.end method
.method private a(Landroid/view/View;)V
.registers 4
iget-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->i:Landroid/view/View;
if-eqz v0, :cond_9
:try_start_4
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->g:Landroid/view/WindowManager;
invoke-interface {v1, v0}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V
:try_end_9
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_9} :catch_c
:cond_9
:goto_9
iput-object p1, p0, Lcom/fulishe/shadow/toast/c/a;->i:Landroid/view/View;
return-void
:catch_c
move-exception v0
goto :goto_9
.end method
# virtual methods
.method public b()V
.registers 5
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->a:Ljava/util/Timer;
if-nez v0, :cond_b
new-instance v0, Ljava/util/Timer;
invoke-direct {v0}, Ljava/util/Timer;-><init>()V
sput-object v0, Lcom/fulishe/shadow/toast/c/a;->a:Ljava/util/Timer;
:cond_b
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
if-nez v0, :cond_2f
iget-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
sput-object v0, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
:try_start_13
iget-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->g:Landroid/view/WindowManager;
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->i:Landroid/view/View;
sget-object v2, Lcom/fulishe/shadow/toast/c/a;->d:Landroid/view/WindowManager$LayoutParams;
invoke-interface {v0, v1, v2}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
:try_end_1c
.catchall {:try_start_13 .. :try_end_1c} :catchall_3e
:goto_1c
new-instance v0, Lcom/fulishe/shadow/toast/c/b;
invoke-direct {v0, p0}, Lcom/fulishe/shadow/toast/c/b;-><init>(Lcom/fulishe/shadow/toast/c/a;)V
sput-object v0, Lcom/fulishe/shadow/toast/c/a;->b:Ljava/util/TimerTask;
sget-object v1, Lcom/fulishe/shadow/toast/c/a;->a:Ljava/util/Timer;
iget-object v2, p0, Lcom/fulishe/shadow/toast/c/a;->h:Ljava/lang/Long;
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
move-result-wide v2
invoke-virtual {v1, v0, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V
return-void
:cond_2f
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->b:Ljava/util/TimerTask;
if-eqz v0, :cond_36
invoke-virtual {v0}, Ljava/util/TimerTask;->cancel()Z
:cond_36
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->j:Ljava/lang/CharSequence;
invoke-virtual {v0, v1}, Lcom/fulishe/shadow/toast/XMPrimaryToast;->setText(Ljava/lang/CharSequence;)V
goto :goto_1c
:catchall_3e
move-exception v0
goto :goto_1c
.end method
.method public c()V
.registers 4
const/4 v2, 0x0
:try_start_1
iget-object v0, p0, Lcom/fulishe/shadow/toast/c/a;->g:Landroid/view/WindowManager;
iget-object v1, p0, Lcom/fulishe/shadow/toast/c/a;->i:Landroid/view/View;
invoke-interface {v0, v1}, Landroid/view/WindowManager;->removeView(Landroid/view/View;)V
:try_end_8
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_8} :catch_21
:goto_8
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->b:Ljava/util/TimerTask;
if-eqz v0, :cond_11
invoke-virtual {v0}, Ljava/util/TimerTask;->cancel()Z
sput-object v2, Lcom/fulishe/shadow/toast/c/a;->b:Ljava/util/TimerTask;
:cond_11
sget-object v0, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
if-eqz v0, :cond_1a
invoke-virtual {v0}, Landroid/widget/Toast;->cancel()V
sput-object v2, Lcom/fulishe/shadow/toast/c/a;->e:Lcom/fulishe/shadow/toast/XMPrimaryToast;
:cond_1a
iput-object v2, p0, Lcom/fulishe/shadow/toast/c/a;->f:Lcom/fulishe/shadow/toast/XMPrimaryToast;
iput-object v2, p0, Lcom/fulishe/shadow/toast/c/a;->i:Landroid/view/View;
sput-object v2, Lcom/fulishe/shadow/toast/c/a;->c:Landroid/os/Handler;
return-void
:catch_21
move-exception v0
goto :goto_8
.end method