211 lines
5.0 KiB
Smali
211 lines
5.0 KiB
Smali
.class public Lcom/moji/mjweather/dailydetail/view/CarNumberView;
|
|
.super Landroid/widget/LinearLayout;
|
|
.source "CarNumberView.java"
|
|
|
|
|
|
# instance fields
|
|
.field private a:Landroid/view/LayoutInflater;
|
|
|
|
.field private b:Landroid/content/Context;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 22
|
|
invoke-direct {p0, p1, v0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;-><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 26
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;-><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 30
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
.line 31
|
|
iput-object p1, p0, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->b:Landroid/content/Context;
|
|
|
|
.line 32
|
|
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->a:Landroid/view/LayoutInflater;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/String;)V
|
|
.locals 3
|
|
|
|
.line 42
|
|
iget-object v0, p0, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->a:Landroid/view/LayoutInflater;
|
|
|
|
const v1, 0x7f0b018b
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
const v1, 0x7f0909ff
|
|
|
|
.line 43
|
|
invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/widget/TextView;
|
|
|
|
.line 44
|
|
invoke-virtual {v1, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 45
|
|
invoke-virtual {p0, v0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->addView(Landroid/view/View;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private b(Ljava/lang/String;)[Ljava/lang/String;
|
|
.locals 1
|
|
|
|
.line 77
|
|
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, ","
|
|
|
|
.line 78
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, ","
|
|
|
|
.line 79
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public setText(Ljava/lang/String;)V
|
|
.locals 3
|
|
|
|
.line 50
|
|
invoke-direct {p0, p1}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->b(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 51
|
|
array-length v1, v0
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 52
|
|
:goto_0
|
|
array-length v1, v0
|
|
|
|
if-ge p1, v1, :cond_1
|
|
|
|
.line 53
|
|
aget-object v1, v0, p1
|
|
|
|
.line 54
|
|
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 55
|
|
invoke-direct {p0, v1}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->a(Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 58
|
|
:cond_1
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->invalidate()V
|
|
|
|
goto :goto_1
|
|
|
|
.line 60
|
|
:cond_2
|
|
new-instance v0, Landroid/widget/TextView;
|
|
|
|
iget-object v1, p0, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->b:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 61
|
|
iget-object v1, p0, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->b:Landroid/content/Context;
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v1
|
|
|
|
const v2, 0x7f06016c
|
|
|
|
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getColor(I)I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V
|
|
|
|
const/high16 v1, 0x41900000 # 18.0f
|
|
|
|
const/4 v2, 0x1
|
|
|
|
.line 62
|
|
invoke-virtual {v0, v2, v1}, Landroid/widget/TextView;->setTextSize(IF)V
|
|
|
|
.line 63
|
|
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 64
|
|
invoke-virtual {p0, v0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->addView(Landroid/view/View;)V
|
|
|
|
.line 65
|
|
invoke-virtual {p0}, Lcom/moji/mjweather/dailydetail/view/CarNumberView;->invalidate()V
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|