531 lines
14 KiB
Smali
531 lines
14 KiB
Smali
.class public Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;
|
|
.super Landroid/widget/RelativeLayout;
|
|
.source "CheckedRelativeLayout.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/widget/Checkable;
|
|
|
|
|
|
# static fields
|
|
.field private static final f:[I
|
|
|
|
|
|
# instance fields
|
|
.field private a:Z
|
|
|
|
.field private b:I
|
|
|
|
.field private c:Landroid/graphics/drawable/Drawable;
|
|
|
|
.field private d:I
|
|
|
|
.field private e:Z
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 49
|
|
new-array v0, v0, [I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const v2, 0x10100a0
|
|
|
|
aput v2, v0, v1
|
|
|
|
sput-object v0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->f:[I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 18
|
|
invoke-direct {p0, p1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 19
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const v0, 0x7f080178
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 21
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setCheckMarkDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
.line 35
|
|
invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
.line 36
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f080178
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 38
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setCheckMarkDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 26
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
.line 27
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f080178
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 29
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setCheckMarkDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected dispatchDraw(Landroid/graphics/Canvas;)V
|
|
.locals 6
|
|
.annotation build Landroid/annotation/SuppressLint;
|
|
value = {
|
|
"NewApi"
|
|
}
|
|
.end annotation
|
|
|
|
.line 157
|
|
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->dispatchDraw(Landroid/graphics/Canvas;)V
|
|
|
|
.line 158
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 161
|
|
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
|
|
|
|
move-result v1
|
|
|
|
.line 164
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getHeight()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v2, v1
|
|
|
|
div-int/lit8 v2, v2, 0x2
|
|
|
|
.line 166
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getWidth()I
|
|
|
|
move-result v3
|
|
|
|
add-int/2addr v1, v2
|
|
|
|
const/high16 v4, 0x41200000 # 10.0f
|
|
|
|
.line 172
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object v5
|
|
|
|
iget v5, v5, Landroid/util/DisplayMetrics;->density:F
|
|
|
|
mul-float v5, v5, v4
|
|
|
|
invoke-static {v5}, Ljava/lang/Math;->round(F)I
|
|
|
|
move-result v4
|
|
|
|
sub-int/2addr v3, v4
|
|
|
|
.line 173
|
|
iget v4, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->d:I
|
|
|
|
sub-int v4, v3, v4
|
|
|
|
.line 175
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getScrollX()I
|
|
|
|
move-result v5
|
|
|
|
add-int/2addr v5, v4
|
|
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getScrollX()I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, v3
|
|
|
|
invoke-virtual {v0, v5, v2, v4, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
.line 176
|
|
invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method protected drawableStateChanged()V
|
|
.locals 2
|
|
|
|
.line 191
|
|
invoke-super {p0}, Landroid/widget/RelativeLayout;->drawableStateChanged()V
|
|
|
|
.line 193
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 194
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getDrawableState()[I
|
|
|
|
move-result-object v0
|
|
|
|
.line 197
|
|
iget-object v1, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
|
|
|
|
.line 199
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->invalidate()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public getCheckMarkDrawable()Landroid/graphics/drawable/Drawable;
|
|
.locals 1
|
|
|
|
.line 148
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public isChecked()Z
|
|
.locals 1
|
|
|
|
.line 61
|
|
iget-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method protected onCreateDrawableState(I)[I
|
|
.locals 1
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
.line 182
|
|
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onCreateDrawableState(I)[I
|
|
|
|
move-result-object p1
|
|
|
|
.line 183
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->isChecked()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 184
|
|
sget-object v0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->f:[I
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->mergeDrawableStates([I[I)[I
|
|
|
|
:cond_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
|
|
.locals 1
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
value = 0xe
|
|
.end annotation
|
|
|
|
.line 205
|
|
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
|
|
|
|
.line 206
|
|
const-class v0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityEvent;->setClassName(Ljava/lang/CharSequence;)V
|
|
|
|
.line 207
|
|
iget-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityEvent;->setChecked(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onInitializeAccessibilityNodeInfo(Landroid/view/accessibility/AccessibilityNodeInfo;)V
|
|
.locals 1
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
value = 0xe
|
|
.end annotation
|
|
|
|
.line 212
|
|
invoke-super {p0, p1}, Landroid/widget/RelativeLayout;->onInitializeAccessibilityNodeInfo(Landroid/view/accessibility/AccessibilityNodeInfo;)V
|
|
|
|
.line 213
|
|
const-class v0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setClassName(Ljava/lang/CharSequence;)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 214
|
|
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setCheckable(Z)V
|
|
|
|
.line 215
|
|
iget-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/accessibility/AccessibilityNodeInfo;->setChecked(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCheckMarkDrawable(I)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 93
|
|
iget v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->b:I
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 97
|
|
:cond_0
|
|
iput p1, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->b:I
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 100
|
|
iget v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->b:I
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 101
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
iget v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->b:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
.line 103
|
|
:cond_1
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setCheckMarkDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCheckMarkDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
.locals 3
|
|
|
|
.line 117
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 118
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
|
|
|
|
.line 119
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
invoke-virtual {p0, v0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->unscheduleDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
.line 121
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eq p1, v0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iput-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->e:Z
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 123
|
|
invoke-virtual {p1, p0}, Landroid/graphics/drawable/Drawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V
|
|
|
|
.line 124
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getVisibility()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
invoke-virtual {p1, v1, v2}, Landroid/graphics/drawable/Drawable;->setVisible(ZZ)Z
|
|
|
|
.line 125
|
|
sget-object v0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->f:[I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
|
|
|
|
.line 126
|
|
invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0, v0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setMinimumHeight(I)V
|
|
|
|
.line 128
|
|
invoke-virtual {p1}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->d:I
|
|
|
|
.line 129
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->getDrawableState()[I
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
|
|
|
|
goto :goto_2
|
|
|
|
.line 131
|
|
:cond_3
|
|
iput v2, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->d:I
|
|
|
|
.line 133
|
|
:goto_2
|
|
iput-object p1, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->c:Landroid/graphics/drawable/Drawable;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setChecked(Z)V
|
|
.locals 1
|
|
|
|
.line 70
|
|
iget-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
if-eq v0, p1, :cond_0
|
|
|
|
.line 71
|
|
iput-boolean p1, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
.line 72
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->refreshDrawableState()V
|
|
|
|
.line 73
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, ""
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setContentDescription(Ljava/lang/CharSequence;)V
|
|
|
|
const-string p1, ""
|
|
|
|
.line 74
|
|
invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setContentDescription(Ljava/lang/CharSequence;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public toggle()V
|
|
.locals 1
|
|
|
|
.line 56
|
|
iget-boolean v0, p0, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->a:Z
|
|
|
|
xor-int/lit8 v0, v0, 0x1
|
|
|
|
invoke-virtual {p0, v0}, Lcom/moji/mjweather/setting/view/CheckedRelativeLayout;->setChecked(Z)V
|
|
|
|
return-void
|
|
.end method
|