150 lines
3.5 KiB
Smali
150 lines
3.5 KiB
Smali
.class public Lcom/sina/weibo/sdk/utils/UIUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "UIUtils.java"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 30
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static dip2px(ILandroid/content/Context;)I
|
|
.locals 0
|
|
|
|
.line 33
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p1
|
|
|
|
iget p1, p1, Landroid/util/DisplayMetrics;->density:F
|
|
|
|
int-to-float p0, p0
|
|
|
|
mul-float p0, p0, p1
|
|
|
|
const/high16 p1, 0x3f000000 # 0.5f
|
|
|
|
add-float/2addr p0, p1
|
|
|
|
float-to-int p0, p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static showAlert(Landroid/content/Context;II)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 63
|
|
invoke-virtual {p0, p1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p0, p1, p2}, Lcom/sina/weibo/sdk/utils/UIUtils;->showAlert(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static showAlert(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 46
|
|
new-instance v0, Landroid/app/AlertDialog$Builder;
|
|
|
|
invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 47
|
|
invoke-virtual {v0, p1}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
|
|
|
|
move-result-object p0
|
|
|
|
.line 48
|
|
invoke-virtual {p0, p2}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
|
|
|
|
move-result-object p0
|
|
|
|
.line 49
|
|
invoke-virtual {p0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;
|
|
|
|
move-result-object p0
|
|
|
|
.line 50
|
|
invoke-virtual {p0}, Landroid/app/AlertDialog;->show()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static showToast(Landroid/content/Context;II)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 76
|
|
invoke-static {p0, p1, p2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Landroid/widget/Toast;->show()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static showToast(Landroid/content/Context;Ljava/lang/CharSequence;I)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 89
|
|
invoke-static {p0, p1, p2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Landroid/widget/Toast;->show()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static showToastInCenter(Landroid/content/Context;II)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 102
|
|
invoke-static {p0, p1, p2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
|
|
|
|
move-result-object p0
|
|
|
|
const/16 p1, 0x11
|
|
|
|
const/4 p2, 0x0
|
|
|
|
.line 103
|
|
invoke-virtual {p0, p1, p2, p2}, Landroid/widget/Toast;->setGravity(III)V
|
|
|
|
.line 104
|
|
invoke-virtual {p0}, Landroid/widget/Toast;->show()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|