GraySectionCell.smali

.class public Lim/tpelyyftgw/ui/cells/GraySectionCell;
.super Landroid/widget/FrameLayout;
.source "GraySectionCell.java"


# instance fields
.field private righTextView:Landroid/widget/TextView;

.field private textView:Landroid/widget/TextView;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .registers 16
    .param p1, "context"    # Landroid/content/Context;

    .line 21
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

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

    invoke-virtual {p0}, Lim/tpelyyftgw/ui/cells/GraySectionCell;->getContext()Landroid/content/Context;

    move-result-object v1

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

    iput-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

    .line 24
    const/high16 v1, 0x41600000    # 14.0f

    const/4 v2, 0x1

    invoke-virtual {v0, v2, v1}, Landroid/widget/TextView;->setTextSize(IF)V

    .line 25
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

    const-string v3, "fonts/rmedium.ttf"

    invoke-static {v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTypeface(Ljava/lang/String;)Landroid/graphics/Typeface;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

    .line 26
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

    const-string v3, "key_graySectionText"

    invoke-static {v3}, Lim/tpelyyftgw/ui/actionbar/Theme;->getColor(Ljava/lang/String;)I

    move-result v4

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

    .line 27
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

    sget-boolean v4, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z

    const/4 v5, 0x5

    const/4 v6, 0x3

    if-eqz v4, :cond_34

    const/4 v4, 0x5

    goto :goto_35

    :cond_34
    const/4 v4, 0x3

    :goto_35
    or-int/lit8 v4, v4, 0x10

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

    .line 28
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

    const/high16 v7, -0x40800000    # -1.0f

    const/high16 v8, -0x40800000    # -1.0f

    sget-boolean v4, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z

    if-eqz v4, :cond_46

    const/4 v4, 0x5

    goto :goto_47

    :cond_46
    const/4 v4, 0x3

    :goto_47
    or-int/lit8 v9, v4, 0x30

    const/high16 v10, 0x41800000    # 16.0f

    const/4 v11, 0x0

    const/high16 v12, 0x41800000    # 16.0f

    const/4 v13, 0x0

    invoke-static/range {v7 .. v13}, Lim/tpelyyftgw/ui/components/LayoutHelper;->createFrame(FFIFFFF)Landroid/widget/FrameLayout$LayoutParams;

    move-result-object v4

    invoke-virtual {p0, v0, v4}, Lim/tpelyyftgw/ui/cells/GraySectionCell;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

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

    invoke-virtual {p0}, Lim/tpelyyftgw/ui/cells/GraySectionCell;->getContext()Landroid/content/Context;

    move-result-object v4

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

    iput-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    .line 31
    invoke-virtual {v0, v2, v1}, Landroid/widget/TextView;->setTextSize(IF)V

    .line 32
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    invoke-static {v3}, Lim/tpelyyftgw/ui/actionbar/Theme;->getColor(Ljava/lang/String;)I

    move-result v1

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

    .line 33
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    sget-boolean v1, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z

    if-eqz v1, :cond_75

    const/4 v1, 0x3

    goto :goto_76

    :cond_75
    const/4 v1, 0x5

    :goto_76
    or-int/lit8 v1, v1, 0x10

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

    .line 34
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    const/high16 v7, -0x40000000    # -2.0f

    const/high16 v8, -0x40800000    # -1.0f

    sget-boolean v1, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z

    if-eqz v1, :cond_86

    const/4 v5, 0x3

    :cond_86
    or-int/lit8 v9, v5, 0x30

    const/high16 v10, 0x41800000    # 16.0f

    const/4 v11, 0x0

    const/high16 v12, 0x41800000    # 16.0f

    const/4 v13, 0x0

    invoke-static/range {v7 .. v13}, Lim/tpelyyftgw/ui/components/LayoutHelper;->createFrame(FFIFFFF)Landroid/widget/FrameLayout$LayoutParams;

    move-result-object v1

    invoke-virtual {p0, v0, v1}, Lim/tpelyyftgw/ui/cells/GraySectionCell;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 35
    return-void
.end method


# virtual methods
.method protected onMeasure(II)V
    .registers 6
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .line 39
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v0

    const/high16 v1, 0x40000000    # 2.0f

    invoke-static {v0, v1}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v0

    const/high16 v2, 0x42000000    # 32.0f

    invoke-static {v2}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I

    move-result v2

    invoke-static {v2, v1}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v1

    invoke-super {p0, v0, v1}, Landroid/widget/FrameLayout;->onMeasure(II)V

    .line 40
    return-void
.end method

.method public setText(Ljava/lang/String;)V
    .registers 4
    .param p1, "text"    # Ljava/lang/String;

    .line 43
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

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

    .line 44
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    const/16 v1, 0x8

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

    .line 45
    return-void
.end method

.method public setText(Ljava/lang/String;Ljava/lang/String;Landroid/view/View$OnClickListener;)V
    .registers 6
    .param p1, "left"    # Ljava/lang/String;
    .param p2, "right"    # Ljava/lang/String;
    .param p3, "onClickListener"    # Landroid/view/View$OnClickListener;

    .line 48
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->textView:Landroid/widget/TextView;

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

    .line 49
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

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

    .line 50
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    invoke-virtual {v0, p3}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 51
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/GraySectionCell;->righTextView:Landroid/widget/TextView;

    const/4 v1, 0x0

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

    .line 52
    return-void
.end method