440 lines
12 KiB
Smali
440 lines
12 KiB
Smali
.class public Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;
|
|
.super Lcom/moji/mjweather/settingpreference/pref/MJPreference;
|
|
.source "MJPreferenceWithLeftIcon.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final a:Ljava/lang/String; = "MJPreferenceWithLeftIcon"
|
|
|
|
|
|
# instance fields
|
|
.field private b:I
|
|
|
|
.field private c:Z
|
|
|
|
.field private d:Landroid/view/View;
|
|
|
|
.field private e:Z
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 34
|
|
invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 38
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 42
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/moji/mjweather/settingpreference/pref/MJPreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
const/4 p1, -0x1
|
|
|
|
.line 28
|
|
iput p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->b:I
|
|
|
|
.line 43
|
|
invoke-direct {p0, p2}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a(Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/util/AttributeSet;)V
|
|
.locals 5
|
|
|
|
.line 47
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/moji/widget/R$styleable;->MJPreferenceWithLeftIcon:[I
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object p1
|
|
|
|
.line 49
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->getIndexCount()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
:goto_0
|
|
if-ltz v0, :cond_2
|
|
|
|
.line 50
|
|
invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getIndex(I)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ne v2, v1, :cond_0
|
|
|
|
.line 52
|
|
invoke-virtual {p1, v2, v3}, Landroid/content/res/TypedArray;->getResourceId(II)I
|
|
|
|
move-result v4
|
|
|
|
iput v4, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->b:I
|
|
|
|
:cond_0
|
|
if-nez v2, :cond_1
|
|
|
|
.line 55
|
|
invoke-virtual {p1, v2, v3}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
|
|
|
|
move-result v2
|
|
|
|
iput-boolean v2, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->c:Z
|
|
|
|
:cond_1
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 58
|
|
:cond_2
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/widget/TextView;I)V
|
|
.locals 5
|
|
.param p2 # I
|
|
.annotation build Landroid/support/annotation/DrawableRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 124
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, p2}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p2
|
|
|
|
.line 125
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const v1, 0x7f07022f
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v0
|
|
|
|
float-to-int v0, v0
|
|
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a()Landroid/content/res/Resources;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, v1}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v1
|
|
|
|
float-to-int v1, v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p2, v2, v2, v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
.line 126
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const v1, 0x7f08069d
|
|
|
|
invoke-static {v0, v1}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v0
|
|
|
|
.line 127
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a()Landroid/content/res/Resources;
|
|
|
|
move-result-object v1
|
|
|
|
const v3, 0x7f070232
|
|
|
|
invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v1
|
|
|
|
float-to-int v1, v1
|
|
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a()Landroid/content/res/Resources;
|
|
|
|
move-result-object v3
|
|
|
|
const v4, 0x7f070231
|
|
|
|
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v3
|
|
|
|
float-to-int v3, v3
|
|
|
|
invoke-virtual {v0, v2, v2, v1, v3}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 128
|
|
invoke-virtual {p1, p2, v1, v0, v1}, Landroid/widget/TextView;->setCompoundDrawables(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Z)V
|
|
.locals 0
|
|
|
|
.line 112
|
|
iput-boolean p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->e:Z
|
|
|
|
.line 113
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->notifyChanged()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onBindView(Landroid/view/View;)V
|
|
.locals 5
|
|
|
|
.line 70
|
|
invoke-super {p0, p1}, Lcom/moji/mjweather/settingpreference/pref/MJPreference;->onBindView(Landroid/view/View;)V
|
|
|
|
const v0, 0x7f090bba
|
|
|
|
.line 71
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
const/16 v1, 0x8
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 73
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getTitle()Ljava/lang/CharSequence;
|
|
|
|
move-result-object v3
|
|
|
|
.line 74
|
|
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
.line 75
|
|
invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 76
|
|
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 78
|
|
:cond_0
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
.line 80
|
|
:goto_0
|
|
iget v3, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->b:I
|
|
|
|
if-lez v3, :cond_1
|
|
|
|
.line 81
|
|
iget v3, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->b:I
|
|
|
|
invoke-direct {p0, v0, v3}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->a(Landroid/widget/TextView;I)V
|
|
|
|
:cond_1
|
|
const v0, 0x7f090bea
|
|
|
|
.line 85
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 87
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getSummary()Ljava/lang/CharSequence;
|
|
|
|
move-result-object v3
|
|
|
|
.line 88
|
|
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_2
|
|
|
|
.line 89
|
|
invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 90
|
|
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 92
|
|
:cond_2
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
:cond_3
|
|
:goto_1
|
|
const v0, 0x7f090c85
|
|
|
|
.line 95
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
.line 96
|
|
iget-boolean v3, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->c:Z
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
.line 97
|
|
invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/widget/LinearLayout$LayoutParams;
|
|
|
|
.line 98
|
|
invoke-virtual {v3, v2, v2, v2, v2}, Landroid/widget/LinearLayout$LayoutParams;->setMargins(IIII)V
|
|
|
|
.line 99
|
|
invoke-virtual {v0, v3}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
:cond_4
|
|
const v0, 0x7f0900ab
|
|
|
|
.line 101
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->d:Landroid/view/View;
|
|
|
|
.line 102
|
|
iget-boolean p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->e:Z
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
.line 103
|
|
iget-object p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->d:Landroid/view/View;
|
|
|
|
invoke-virtual {p1, v2}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
.line 104
|
|
new-instance p1, Lcom/moji/badge/BadgeView;
|
|
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Lcom/moji/badge/BadgeView;-><init>(Landroid/content/Context;)V
|
|
|
|
const/4 v0, 0x5
|
|
|
|
invoke-virtual {p1, v0}, Lcom/moji/badge/BadgeView;->a(I)Lcom/moji/badge/BadgeView;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->d:Landroid/view/View;
|
|
|
|
invoke-virtual {p1, v0}, Lcom/moji/badge/BadgeView;->a(Landroid/view/View;)Lcom/moji/badge/BadgeView;
|
|
|
|
move-result-object p1
|
|
|
|
.line 105
|
|
sget-object v0, Lcom/moji/badge/BadgeEvent$TYPE;->MESSAGE_FEED_BACK:Lcom/moji/badge/BadgeEvent$TYPE;
|
|
|
|
invoke-virtual {p1, v0}, Lcom/moji/badge/BadgeView;->a(Lcom/moji/badge/BadgeEvent$TYPE;)Z
|
|
|
|
goto :goto_2
|
|
|
|
.line 107
|
|
:cond_5
|
|
iget-object p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->d:Landroid/view/View;
|
|
|
|
invoke-virtual {p1, v1}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
:goto_2
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onCreateView(Landroid/view/ViewGroup;)Landroid/view/View;
|
|
.locals 3
|
|
|
|
.line 63
|
|
invoke-super {p0, p1}, Lcom/moji/mjweather/settingpreference/pref/MJPreference;->onCreateView(Landroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
.line 64
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithLeftIcon;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "layout_inflater"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/LayoutInflater;
|
|
|
|
const v1, 0x7f0b02d1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 65
|
|
invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|