ToastUtils.smali
.class public final Lim/tpelyyftgw/ui/components/toast/ToastUtils;
.super Ljava/lang/Object;
.source "ToastUtils.java"
# static fields
.field private static sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
.field private static sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
.field private static sToast:Landroid/widget/Toast;
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method private constructor <init>()V
.registers 1
.line 39
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 40
return-void
.end method
.method public static declared-synchronized cancel()V
.registers 2
const-class v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;
monitor-enter v0
.line 138
:try_start_3
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 140
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;->cancel()V
:try_end_b
.catchall {:try_start_3 .. :try_end_b} :catchall_d
.line 141
monitor-exit v0
return-void
.line 137
:catchall_d
move-exception v1
monitor-exit v0
throw v1
.end method
.method private static checkNullPointer(Ljava/lang/Object;)V
.registers 3
.param p0, "object" # Ljava/lang/Object;
.line 261
if-eqz p0, :cond_3
.line 264
return-void
.line 262
:cond_3
new-instance v0, Ljava/lang/NullPointerException;
const-string v1, "are you ok?"
invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private static checkToastState()V
.registers 2
.line 252
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
if-eqz v0, :cond_5
.line 255
return-void
.line 253
:cond_5
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "ToastUtils has not been initialized"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private static createTextView(Landroid/content/Context;)Landroid/widget/TextView;
.registers 8
.param p0, "context" # Landroid/content/Context;
.line 271
new-instance v0, Landroid/graphics/drawable/GradientDrawable;
invoke-direct {v0}, Landroid/graphics/drawable/GradientDrawable;-><init>()V
.line 273
.local v0, "drawable":Landroid/graphics/drawable/GradientDrawable;
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getBackgroundColor()I
move-result v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setColor(I)V
.line 275
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getCornerRadius()I
move-result v1
int-to-float v1, v1
invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setCornerRadius(F)V
.line 277
new-instance v1, Landroid/widget/TextView;
invoke-direct {v1, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
.line 278
.local v1, "textView":Landroid/widget/TextView;
const v2, 0x102000b
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setId(I)V
.line 279
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getTextColor()I
move-result v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTextColor(I)V
.line 280
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getTextSize()F
move-result v2
const/4 v3, 0x2
invoke-virtual {v1, v3, v2}, Landroid/widget/TextView;->setTextSize(IF)V
.line 281
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getMinimumWidth()I
move-result v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setMinimumWidth(I)V
.line 282
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getMinimumHeight()I
move-result v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setMinimumHeight(I)V
.line 283
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getTypeFace()Landroid/graphics/Typeface;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
.line 284
const/16 v2, 0x11
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setGravity(I)V
.line 289
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x10
if-lt v2, v3, :cond_78
.line 290
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingStart()I
move-result v2
sget-object v4, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v4}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingTop()I
move-result v4
sget-object v5, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v5}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingEnd()I
move-result v5
sget-object v6, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v6}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingBottom()I
move-result v6
invoke-virtual {v1, v2, v4, v5, v6}, Landroid/widget/TextView;->setPaddingRelative(IIII)V
goto :goto_93
.line 292
:cond_78
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingStart()I
move-result v2
sget-object v4, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v4}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingTop()I
move-result v4
sget-object v5, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v5}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingEnd()I
move-result v5
sget-object v6, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v6}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getPaddingBottom()I
move-result v6
invoke-virtual {v1, v2, v4, v5, v6}, Landroid/widget/TextView;->setPadding(IIII)V
.line 295
:goto_93
new-instance v2, Landroid/view/ViewGroup$LayoutParams;
const/4 v4, -0x2
invoke-direct {v2, v4, v4}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 298
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
if-lt v2, v3, :cond_a4
.line 299
invoke-virtual {v1, v0}, Landroid/widget/TextView;->setBackground(Landroid/graphics/drawable/Drawable;)V
goto :goto_a7
.line 301
:cond_a4
invoke-virtual {v1, v0}, Landroid/widget/TextView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V
.line 305
:goto_a7
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v3, 0x15
if-lt v2, v3, :cond_b7
.line 306
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getZ()I
move-result v2
int-to-float v2, v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setZ(F)V
.line 310
:cond_b7
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getMaxLines()I
move-result v2
if-lez v2, :cond_c8
.line 311
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getMaxLines()I
move-result v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setMaxLines(I)V
.line 314
:cond_c8
return-object v1
.end method
.method public static getToast()Landroid/widget/Toast;
.registers 1
.line 244
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
return-object v0
.end method
.method public static getView()Landroid/view/View;
.registers 1
.annotation system Ldalvik/annotation/Signature;
value = {
"<V:",
"Landroid/view/View;",
">()TV;"
}
.end annotation
.line 195
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 197
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v0}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v0
return-object v0
.end method
.method public static init(Landroid/content/Context;)V
.registers 4
.param p0, "context" # Landroid/content/Context;
.line 48
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkNullPointer(Ljava/lang/Object;)V
.line 51
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
if-nez v0, :cond_f
.line 52
new-instance v0, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
invoke-direct {v0}, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;-><init>()V
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setToastHandler(Lim/tpelyyftgw/ui/components/toast/ToastStrategy;)V
.line 56
:cond_f
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
if-nez v0, :cond_1b
.line 57
new-instance v0, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-direct {v0}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;-><init>()V
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->initStyle(Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;)V
.line 61
:cond_1b
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->isNotificationEnabled(Landroid/content/Context;)Z
move-result v0
if-eqz v0, :cond_39
.line 62
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x19
if-ne v0, v1, :cond_30
.line 64
new-instance v0, Lim/tpelyyftgw/ui/components/toast/SafeToast;
invoke-direct {v0, p0}, Lim/tpelyyftgw/ui/components/toast/SafeToast;-><init>(Landroid/content/Context;)V
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setToast(Landroid/widget/Toast;)V
goto :goto_41
.line 66
:cond_30
new-instance v0, Lim/tpelyyftgw/ui/components/toast/BaseToast;
invoke-direct {v0, p0}, Lim/tpelyyftgw/ui/components/toast/BaseToast;-><init>(Landroid/content/Context;)V
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setToast(Landroid/widget/Toast;)V
goto :goto_41
.line 70
:cond_39
new-instance v0, Lim/tpelyyftgw/ui/components/toast/SupportToast;
invoke-direct {v0, p0}, Lim/tpelyyftgw/ui/components/toast/SupportToast;-><init>(Landroid/content/Context;)V
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setToast(Landroid/widget/Toast;)V
.line 74
:goto_41
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->createTextView(Landroid/content/Context;)Landroid/widget/TextView;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setView(Landroid/view/View;)V
.line 77
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getGravity()I
move-result v0
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getXOffset()I
move-result v1
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getYOffset()I
move-result v2
invoke-static {v0, v1, v2}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setGravity(III)V
.line 78
return-void
.end method
.method private static initStyle(Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;)V
.registers 5
.param p0, "style" # Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
.line 207
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkNullPointer(Ljava/lang/Object;)V
.line 208
sput-object p0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
.line 210
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
if-eqz v0, :cond_38
.line 212
invoke-virtual {v0}, Landroid/widget/Toast;->cancel()V
.line 213
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v0}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v1
invoke-virtual {v1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v1
invoke-static {v1}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->createTextView(Landroid/content/Context;)Landroid/widget/TextView;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/Toast;->setView(Landroid/view/View;)V
.line 214
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v1}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getGravity()I
move-result v1
sget-object v2, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getXOffset()I
move-result v2
sget-object v3, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStyle:Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;
invoke-virtual {v3}, Lim/tpelyyftgw/ui/components/toast/ToastBlackStyle;->getYOffset()I
move-result v3
invoke-virtual {v0, v1, v2, v3}, Landroid/widget/Toast;->setGravity(III)V
.line 216
:cond_38
return-void
.end method
.method private static isNotificationEnabled(Landroid/content/Context;)Z
.registers 14
.param p0, "context" # Landroid/content/Context;
.line 322
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_13
.line 323
const-string v0, "notification"
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/NotificationManager;
invoke-virtual {v0}, Landroid/app/NotificationManager;->areNotificationsEnabled()Z
move-result v0
return v0
.line 324
:cond_13
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x13
const/4 v2, 0x1
if-lt v0, v1, :cond_8e
.line 325
const-string v0, "appops"
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/AppOpsManager;
.line 326
.local v0, "appOps":Landroid/app/AppOpsManager;
invoke-virtual {p0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;
move-result-object v1
.line 327
.local v1, "appInfo":Landroid/content/pm/ApplicationInfo;
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v3
invoke-virtual {v3}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v3
.line 328
.local v3, "pkg":Ljava/lang/String;
iget v4, v1, Landroid/content/pm/ApplicationInfo;->uid:I
.line 331
.local v4, "uid":I
:try_start_30
const-class v5, Landroid/app/AppOpsManager;
invoke-virtual {v5}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v5
invoke-static {v5}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v5
.line 332
.local v5, "appOpsClass":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
const-string v6, "checkOpNoThrow"
const/4 v7, 0x3
new-array v8, v7, [Ljava/lang/Class;
sget-object v9, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
const/4 v10, 0x0
aput-object v9, v8, v10
sget-object v9, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
aput-object v9, v8, v2
const-class v9, Ljava/lang/String;
const/4 v11, 0x2
aput-object v9, v8, v11
invoke-virtual {v5, v6, v8}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v6
.line 333
.local v6, "checkOpNoThrowMethod":Ljava/lang/reflect/Method;
const-string v8, "OP_POST_NOTIFICATION"
invoke-virtual {v5, v8}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v8
.line 334
.local v8, "opPostNotificationValue":Ljava/lang/reflect/Field;
const-class v9, Ljava/lang/Integer;
invoke-virtual {v8, v9}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v9
check-cast v9, Ljava/lang/Integer;
invoke-virtual {v9}, Ljava/lang/Integer;->intValue()I
move-result v9
.line 335
.local v9, "value":I
new-array v7, v7, [Ljava/lang/Object;
invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v12
aput-object v12, v7, v10
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v12
aput-object v12, v7, v2
aput-object v3, v7, v11
invoke-virtual {v6, v0, v7}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v7
check-cast v7, Ljava/lang/Integer;
invoke-virtual {v7}, Ljava/lang/Integer;->intValue()I
move-result v7
:try_end_7d
.catch Ljava/lang/ClassNotFoundException; {:try_start_30 .. :try_end_7d} :catch_8c
.catch Ljava/lang/NoSuchMethodException; {:try_start_30 .. :try_end_7d} :catch_8a
.catch Ljava/lang/NoSuchFieldException; {:try_start_30 .. :try_end_7d} :catch_88
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_30 .. :try_end_7d} :catch_86
.catch Ljava/lang/IllegalAccessException; {:try_start_30 .. :try_end_7d} :catch_84
.catch Ljava/lang/RuntimeException; {:try_start_30 .. :try_end_7d} :catch_82
if-nez v7, :cond_80
goto :goto_81
:cond_80
const/4 v2, 0x0
:goto_81
return v2
.line 336
.end local v5 # "appOpsClass":Ljava/lang/Class;, "Ljava/lang/Class<*>;"
.end local v6 # "checkOpNoThrowMethod":Ljava/lang/reflect/Method;
.end local v8 # "opPostNotificationValue":Ljava/lang/reflect/Field;
.end local v9 # "value":I
:catch_82
move-exception v5
goto :goto_8d
:catch_84
move-exception v5
goto :goto_8d
:catch_86
move-exception v5
goto :goto_8d
:catch_88
move-exception v5
goto :goto_8d
:catch_8a
move-exception v5
goto :goto_8d
:catch_8c
move-exception v5
.line 338
.local v5, "ignored":Ljava/lang/Exception;
:goto_8d
return v2
.line 341
.end local v0 # "appOps":Landroid/app/AppOpsManager;
.end local v1 # "appInfo":Landroid/content/pm/ApplicationInfo;
.end local v3 # "pkg":Ljava/lang/String;
.end local v4 # "uid":I
.end local v5 # "ignored":Ljava/lang/Exception;
:cond_8e
return v2
.end method
.method public static setGravity(III)V
.registers 5
.param p0, "gravity" # I
.param p1, "xOffset" # I
.param p2, "yOffset" # I
.line 151
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 154
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x11
if-lt v0, v1, :cond_1f
.line 155
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v0}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v0
invoke-virtual {v0}, Landroid/view/View;->getResources()Landroid/content/res/Resources;
move-result-object v0
invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
move-result-object v0
invoke-virtual {v0}, Landroid/content/res/Configuration;->getLayoutDirection()I
move-result v0
invoke-static {p0, v0}, Landroid/view/Gravity;->getAbsoluteGravity(II)I
move-result p0
.line 158
:cond_1f
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v0, p0, p1, p2}, Landroid/widget/Toast;->setGravity(III)V
.line 159
return-void
.end method
.method public static setToast(Landroid/widget/Toast;)V
.registers 2
.param p0, "toast" # Landroid/widget/Toast;
.line 222
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkNullPointer(Ljava/lang/Object;)V
.line 223
sput-object p0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
.line 224
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
if-eqz v0, :cond_c
.line 225
invoke-virtual {v0, p0}, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;->bind(Landroid/widget/Toast;)V
.line 227
:cond_c
return-void
.end method
.method public static setToastHandler(Lim/tpelyyftgw/ui/components/toast/ToastStrategy;)V
.registers 2
.param p0, "handler" # Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
.line 233
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkNullPointer(Ljava/lang/Object;)V
.line 234
sput-object p0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
.line 235
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
if-eqz v0, :cond_c
.line 236
invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;->bind(Landroid/widget/Toast;)V
.line 238
:cond_c
return-void
.end method
.method public static setView(I)V
.registers 3
.param p0, "layoutId" # I
.line 165
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 167
sget-object v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v0}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v0
invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0, p0, v1}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->setView(Landroid/view/View;)V
.line 168
return-void
.end method
.method public static setView(Landroid/view/View;)V
.registers 4
.param p0, "view" # Landroid/view/View;
.line 171
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 174
invoke-static {p0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkNullPointer(Ljava/lang/Object;)V
.line 177
invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
.line 178
.local v0, "context":Landroid/content/Context;
instance-of v1, v0, Landroid/app/Application;
if-eqz v1, :cond_1b
.line 183
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
if-eqz v1, :cond_1a
.line 185
invoke-virtual {v1}, Landroid/widget/Toast;->cancel()V
.line 186
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sToast:Landroid/widget/Toast;
invoke-virtual {v1, p0}, Landroid/widget/Toast;->setView(Landroid/view/View;)V
.line 188
:cond_1a
return-void
.line 179
:cond_1b
new-instance v1, Ljava/lang/IllegalArgumentException;
const-string v2, "The view must be initialized using the context of the application"
invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v1
.end method
.method public static show(I)V
.registers 3
.param p0, "id" # I
.line 98
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 101
:try_start_3
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v1, ""
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0, p0}, Lim/tpelyyftgw/messenger/LocaleController;->getString(Ljava/lang/String;I)Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->show(Ljava/lang/CharSequence;)V
:try_end_1b
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_3 .. :try_end_1b} :catch_1c
.line 105
goto :goto_24
.line 102
:catch_1c
move-exception v0
.line 104
.local v0, "ignored":Landroid/content/res/Resources$NotFoundException;
invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->show(Ljava/lang/CharSequence;)V
.line 106
.end local v0 # "ignored":Landroid/content/res/Resources$NotFoundException;
:goto_24
return-void
.end method
.method public static declared-synchronized show(Ljava/lang/CharSequence;)V
.registers 3
.param p0, "text" # Ljava/lang/CharSequence;
const-class v0, Lim/tpelyyftgw/ui/components/toast/ToastUtils;
monitor-enter v0
.line 129
:try_start_3
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 131
sget-object v1, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->sStrategy:Lim/tpelyyftgw/ui/components/toast/ToastStrategy;
invoke-virtual {v1, p0}, Lim/tpelyyftgw/ui/components/toast/ToastStrategy;->show(Ljava/lang/CharSequence;)V
:try_end_b
.catchall {:try_start_3 .. :try_end_b} :catchall_d
.line 132
monitor-exit v0
return-void
.line 128
.end local p0 # "text":Ljava/lang/CharSequence;
:catchall_d
move-exception p0
monitor-exit v0
throw p0
.end method
.method public static show(Ljava/lang/Object;)V
.registers 3
.param p0, "object" # Ljava/lang/Object;
.line 86
if-eqz p0, :cond_39
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v1, ""
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v0
if-eqz v0, :cond_39
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "null"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_31
goto :goto_39
.line 89
:cond_31
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->show(Ljava/lang/CharSequence;)V
.line 90
return-void
.line 87
:cond_39
:goto_39
return-void
.end method
.method public static varargs showFormat(I[Ljava/lang/Object;)V
.registers 4
.param p0, "resId" # I
.param p1, "args" # [Ljava/lang/Object;
.line 114
invoke-static {}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->checkToastState()V
.line 117
:try_start_3
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v1, ""
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0, p0, p1}, Lim/tpelyyftgw/messenger/LocaleController;->formatString(Ljava/lang/String;I[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lim/tpelyyftgw/ui/components/toast/ToastUtils;->show(Ljava/lang/CharSequence;)V
:try_end_1b
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_3 .. :try_end_1b} :catch_1c
.line 120
goto :goto_22
.line 118
:catch_1c
move-exception v0
.line 119
.local v0, "ignored":Landroid/content/res/Resources$NotFoundException;
const-string v1, "id not exits"
invoke-static {v1}, Lim/tpelyyftgw/messenger/FileLog;->e(Ljava/lang/String;)V
.line 121
.end local v0 # "ignored":Landroid/content/res/Resources$NotFoundException;
:goto_22
return-void
.end method