261 lines
6.7 KiB
Smali
261 lines
6.7 KiB
Smali
.class public Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;
|
|
.super Lcom/moji/mjweather/settingpreference/pref/MJPreference;
|
|
.source "MJPreferenceWithHeadIconDesc.java"
|
|
|
|
|
|
# instance fields
|
|
.field private a:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 27
|
|
invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;-><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 31
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;-><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 35
|
|
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 24
|
|
iput p1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->a:I
|
|
|
|
.line 36
|
|
invoke-direct {p0, p2}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->a(Landroid/util/AttributeSet;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/util/AttributeSet;)V
|
|
.locals 3
|
|
|
|
.line 40
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/moji/widget/R$styleable;->MJPreferenceWithHeadIconDesc:[I
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;
|
|
|
|
move-result-object p1
|
|
|
|
.line 42
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->getIndexCount()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
:goto_0
|
|
if-ltz v0, :cond_1
|
|
|
|
.line 43
|
|
invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getIndex(I)I
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 45
|
|
invoke-virtual {p1, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->a:I
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 48
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected onBindView(Landroid/view/View;)V
|
|
.locals 5
|
|
|
|
.line 61
|
|
invoke-super {p0, p1}, Lcom/moji/mjweather/settingpreference/pref/MJPreference;->onBindView(Landroid/view/View;)V
|
|
|
|
const v0, 0x7f09037d
|
|
|
|
.line 62
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/ImageView;
|
|
|
|
const/16 v1, 0x8
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 64
|
|
iget v3, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->a:I
|
|
|
|
if-lez v3, :cond_0
|
|
|
|
.line 65
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
iget v4, p0, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->a:I
|
|
|
|
invoke-static {v3, v4}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Landroid/widget/ImageView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
.line 66
|
|
invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setVisibility(I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 68
|
|
:cond_0
|
|
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const v0, 0x7f090a90
|
|
|
|
.line 72
|
|
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 74
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->getTitle()Ljava/lang/CharSequence;
|
|
|
|
move-result-object v3
|
|
|
|
.line 75
|
|
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_2
|
|
|
|
.line 76
|
|
invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 77
|
|
invoke-virtual {v0, v2}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 79
|
|
:cond_2
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
:cond_3
|
|
:goto_1
|
|
const v0, 0x7f090a91
|
|
|
|
.line 83
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
.line 85
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->getSummary()Ljava/lang/CharSequence;
|
|
|
|
move-result-object v0
|
|
|
|
.line 86
|
|
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_4
|
|
|
|
.line 87
|
|
invoke-virtual {p1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 88
|
|
invoke-virtual {p1, v2}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
goto :goto_2
|
|
|
|
.line 90
|
|
:cond_4
|
|
invoke-virtual {p1, v1}, Landroid/widget/TextView;->setVisibility(I)V
|
|
|
|
:cond_5
|
|
:goto_2
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onCreateView(Landroid/view/ViewGroup;)Landroid/view/View;
|
|
.locals 3
|
|
|
|
.line 53
|
|
invoke-super {p0, p1}, Lcom/moji/mjweather/settingpreference/pref/MJPreference;->onCreateView(Landroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
.line 54
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/settingpreference/pref/MJPreferenceWithHeadIconDesc;->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, 0x7f0b02d0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 55
|
|
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
|