185 lines
4.6 KiB
Smali
185 lines
4.6 KiB
Smali
.class public Lcom/moji/mjweather/library/AndroidBug5497Workaround;
|
|
.super Ljava/lang/Object;
|
|
.source "AndroidBug5497Workaround.java"
|
|
|
|
|
|
# instance fields
|
|
.field private final a:Landroid/view/View;
|
|
|
|
.field private b:I
|
|
|
|
.field private final c:Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
.field private d:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/app/Activity;)V
|
|
.locals 1
|
|
|
|
.line 26
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const v0, 0x1020002
|
|
|
|
.line 27
|
|
invoke-virtual {p1, v0}, Landroid/app/Activity;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/FrameLayout;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 28
|
|
invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
.line 29
|
|
iget-object p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/moji/mjweather/library/AndroidBug5497Workaround$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/moji/mjweather/library/AndroidBug5497Workaround$1;-><init>(Lcom/moji/mjweather/library/AndroidBug5497Workaround;)V
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
.line 34
|
|
iget-object p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->c:Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a()V
|
|
.locals 4
|
|
|
|
.line 38
|
|
invoke-direct {p0}, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->b()I
|
|
|
|
move-result v0
|
|
|
|
.line 39
|
|
iget v1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->b:I
|
|
|
|
if-eq v0, v1, :cond_1
|
|
|
|
.line 40
|
|
iget-object v1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getRootView()Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getHeight()I
|
|
|
|
move-result v1
|
|
|
|
sub-int v2, v1, v0
|
|
|
|
const/16 v3, 0x46
|
|
|
|
if-le v2, v3, :cond_0
|
|
|
|
.line 44
|
|
iget-object v1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->c:Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
iget v2, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->d:I
|
|
|
|
sub-int v2, v0, v2
|
|
|
|
iput v2, v1, Landroid/widget/FrameLayout$LayoutParams;->height:I
|
|
|
|
goto :goto_0
|
|
|
|
.line 47
|
|
:cond_0
|
|
iget-object v2, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->c:Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
iget v3, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->d:I
|
|
|
|
sub-int/2addr v1, v3
|
|
|
|
iput v1, v2, Landroid/widget/FrameLayout$LayoutParams;->height:I
|
|
|
|
.line 49
|
|
:goto_0
|
|
iget-object v1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->requestLayout()V
|
|
|
|
.line 50
|
|
iput v0, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->b:I
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/mjweather/library/AndroidBug5497Workaround;)V
|
|
.locals 0
|
|
|
|
.line 16
|
|
invoke-direct {p0}, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private b()I
|
|
.locals 2
|
|
|
|
.line 55
|
|
new-instance v0, Landroid/graphics/Rect;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
.line 56
|
|
iget-object v1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->a:Landroid/view/View;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/view/View;->getWindowVisibleDisplayFrame(Landroid/graphics/Rect;)V
|
|
|
|
.line 57
|
|
iget v0, v0, Landroid/graphics/Rect;->bottom:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Z)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 62
|
|
iput p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->d:I
|
|
|
|
goto :goto_0
|
|
|
|
.line 64
|
|
:cond_0
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->d()I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/moji/mjweather/library/AndroidBug5497Workaround;->d:I
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|