.class public Lcom/moji/appupdate/view/AppUpdateContent;
.super Landroid/widget/LinearLayout;
.source "AppUpdateContent.java"


# instance fields
.field private a:I

.field private b:F

.field private c:F

.field private d:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    const/4 v0, 0x0

    .line 25
    invoke-direct {p0, p1, v0}, Lcom/moji/appupdate/view/AppUpdateContent;-><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 29
    invoke-direct {p0, p1, p2, v0}, Lcom/moji/appupdate/view/AppUpdateContent;-><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 2

    .line 33
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 34
    iput-object p1, p0, Lcom/moji/appupdate/view/AppUpdateContent;->d:Landroid/content/Context;

    .line 35
    invoke-virtual {p1}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;

    move-result-object p1

    sget-object v0, Lcom/moji/appupdate/R$styleable;->AppUpdateContent:[I

    const/4 v1, 0x0

    invoke-virtual {p1, p2, v0, p3, v1}, Landroid/content/res/Resources$Theme;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object p1

    .line 36
    invoke-virtual {p1}, Landroid/content/res/TypedArray;->getIndexCount()I

    move-result p2

    :goto_0
    if-ge v1, p2, :cond_3

    .line 38
    invoke-virtual {p1, v1}, Landroid/content/res/TypedArray;->getIndex(I)I

    move-result p3

    .line 39
    sget v0, Lcom/moji/appupdate/R$styleable;->AppUpdateContent_update_text_color:I

    if-ne p3, v0, :cond_0

    const-string v0, "#666666"

    .line 40
    invoke-static {v0}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result p3

    iput p3, p0, Lcom/moji/appupdate/view/AppUpdateContent;->a:I

    goto :goto_1

    .line 42
    :cond_0
    sget v0, Lcom/moji/appupdate/R$styleable;->AppUpdateContent_update_text_margin:I

    if-ne p3, v0, :cond_1

    const/high16 v0, 0x41200000    # 10.0f

    .line 43
    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result p3

    .line 45
    invoke-static {p3}, Lcom/moji/tool/DeviceTool;->c(F)F

    move-result p3

    iput p3, p0, Lcom/moji/appupdate/view/AppUpdateContent;->c:F

    goto :goto_1

    .line 47
    :cond_1
    sget v0, Lcom/moji/appupdate/R$styleable;->AppUpdateContent_update_text_size:I

    if-ne p3, v0, :cond_2

    const/high16 v0, 0x41300000    # 11.0f

    .line 48
    invoke-virtual {p1, p3, v0}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result p3

    .line 49
    invoke-static {p3}, Lcom/moji/tool/DeviceTool;->c(F)F

    move-result p3

    iput p3, p0, Lcom/moji/appupdate/view/AppUpdateContent;->b:F

    :cond_2
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 53
    :cond_3
    invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V

    return-void
.end method

.method private a(ILjava/lang/String;)Landroid/widget/TextView;
    .locals 3

    .line 64
    new-instance v0, Landroid/widget/TextView;

    iget-object v1, p0, Lcom/moji/appupdate/view/AppUpdateContent;->d:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    if-eqz p1, :cond_0

    .line 66
    new-instance p1, Landroid/widget/LinearLayout$LayoutParams;

    const/4 v1, -0x2

    invoke-direct {p1, v1, v1}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    .line 68
    iget v1, p0, Lcom/moji/appupdate/view/AppUpdateContent;->c:F

    float-to-int v1, v1

    const/4 v2, 0x0

    invoke-virtual {p1, v2, v1, v2, v2}, Landroid/widget/LinearLayout$LayoutParams;->setMargins(IIII)V

    .line 69
    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 71
    :cond_0
    iget p1, p0, Lcom/moji/appupdate/view/AppUpdateContent;->a:I

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setTextColor(I)V

    .line 72
    iget p1, p0, Lcom/moji/appupdate/view/AppUpdateContent;->b:F

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setTextSize(F)V

    .line 73
    invoke-virtual {v0, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    return-object v0
.end method

.method private a(Ljava/lang/String;)[Ljava/lang/String;
    .locals 2

    .line 96
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_1

    const-string v0, "\n"

    .line 97
    invoke-virtual {p1, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "\n"

    .line 98
    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 v0, 0x1

    .line 100
    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    aput-object p1, v0, v1

    return-object v0

    :cond_1
    const/4 p1, 0x0

    return-object p1
.end method


# virtual methods
.method public setText(Ljava/lang/String;)V
    .locals 2

    const/4 v0, 0x1

    .line 78
    invoke-virtual {p0, v0}, Lcom/moji/appupdate/view/AppUpdateContent;->setOrientation(I)V

    .line 79
    invoke-direct {p0, p1}, Lcom/moji/appupdate/view/AppUpdateContent;->a(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p1

    if-eqz p1, :cond_1

    .line 80
    array-length v0, p1

    if-lez v0, :cond_1

    const/4 v0, 0x0

    .line 81
    :goto_0
    array-length v1, p1

    if-ge v0, v1, :cond_0

    .line 82
    aget-object v1, p1, v0

    invoke-direct {p0, v0, v1}, Lcom/moji/appupdate/view/AppUpdateContent;->a(ILjava/lang/String;)Landroid/widget/TextView;

    move-result-object v1

    .line 83
    invoke-virtual {p0, v1}, Lcom/moji/appupdate/view/AppUpdateContent;->addView(Landroid/view/View;)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 85
    :cond_0
    invoke-virtual {p0}, Lcom/moji/appupdate/view/AppUpdateContent;->invalidate()V

    :cond_1
    return-void
.end method
