InviteUserCell.smali

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


# instance fields
.field private avatarDrawable:Lim/tpelyyftgw/ui/components/AvatarDrawable;

.field private avatarImageView:Lim/tpelyyftgw/ui/components/BackupImageView;

.field private checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

.field private currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

.field private currentName:Ljava/lang/CharSequence;

.field private nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

.field private statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;


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

    return-void
.end method

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

    .line 30
    move-object/from16 v0, p0

    move-object/from16 v1, p1

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

    .line 31
    new-instance v2, Lim/tpelyyftgw/ui/components/AvatarDrawable;

    invoke-direct {v2}, Lim/tpelyyftgw/ui/components/AvatarDrawable;-><init>()V

    iput-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarDrawable:Lim/tpelyyftgw/ui/components/AvatarDrawable;

    .line 33
    new-instance v2, Lim/tpelyyftgw/ui/components/BackupImageView;

    invoke-direct {v2, v1}, Lim/tpelyyftgw/ui/components/BackupImageView;-><init>(Landroid/content/Context;)V

    iput-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarImageView:Lim/tpelyyftgw/ui/components/BackupImageView;

    .line 34
    const/high16 v3, 0x41c00000    # 24.0f

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

    move-result v3

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/components/BackupImageView;->setRoundRadius(I)V

    .line 35
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarImageView:Lim/tpelyyftgw/ui/components/BackupImageView;

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

    const/4 v4, 0x5

    const/4 v5, 0x3

    if-eqz v3, :cond_28

    const/4 v3, 0x5

    goto :goto_29

    :cond_28
    const/4 v3, 0x3

    :goto_29
    or-int/lit8 v8, v3, 0x30

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

    const/high16 v6, 0x41300000    # 11.0f

    const/4 v13, 0x0

    if-eqz v3, :cond_34

    const/4 v9, 0x0

    goto :goto_36

    :cond_34
    const/high16 v9, 0x41300000    # 11.0f

    :goto_36
    const/high16 v10, 0x41300000    # 11.0f

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

    if-eqz v3, :cond_3f

    const/high16 v11, 0x41300000    # 11.0f

    goto :goto_40

    :cond_3f
    const/4 v11, 0x0

    :goto_40
    const/4 v12, 0x0

    const/high16 v6, 0x42480000    # 50.0f

    const/high16 v7, 0x42480000    # 50.0f

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

    move-result-object v3

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

    .line 37
    new-instance v2, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    invoke-direct {v2, v1}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;-><init>(Landroid/content/Context;)V

    iput-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    .line 38
    const-string/jumbo v3, "windowBackgroundWhiteBlackText"

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

    move-result v3

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setTextColor(I)V

    .line 40
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    const/16 v3, 0x11

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setTextSize(I)V

    .line 41
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

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

    if-eqz v3, :cond_6c

    const/4 v3, 0x5

    goto :goto_6d

    :cond_6c
    const/4 v3, 0x3

    :goto_6d
    or-int/lit8 v3, v3, 0x30

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setGravity(I)V

    .line 42
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

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

    const/high16 v7, 0x41a00000    # 20.0f

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

    if-eqz v3, :cond_7e

    const/4 v3, 0x5

    goto :goto_7f

    :cond_7e
    const/4 v3, 0x3

    :goto_7f
    or-int/lit8 v8, v3, 0x30

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

    const/high16 v14, 0x41e00000    # 28.0f

    const/high16 v15, 0x42900000    # 72.0f

    if-eqz v3, :cond_8c

    const/high16 v9, 0x41e00000    # 28.0f

    goto :goto_8e

    :cond_8c
    const/high16 v9, 0x42900000    # 72.0f

    :goto_8e
    const/high16 v10, 0x41600000    # 14.0f

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

    if-eqz v3, :cond_97

    const/high16 v11, 0x42900000    # 72.0f

    goto :goto_99

    :cond_97
    const/high16 v11, 0x41e00000    # 28.0f

    :goto_99
    const/4 v12, 0x0

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

    move-result-object v3

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

    .line 44
    new-instance v2, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    invoke-direct {v2, v1}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;-><init>(Landroid/content/Context;)V

    iput-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    .line 45
    const/16 v3, 0x10

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setTextSize(I)V

    .line 46
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

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

    if-eqz v3, :cond_b5

    const/4 v3, 0x5

    goto :goto_b6

    :cond_b5
    const/4 v3, 0x3

    :goto_b6
    or-int/lit8 v3, v3, 0x30

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setGravity(I)V

    .line 47
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

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

    const/high16 v7, 0x41a00000    # 20.0f

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

    if-eqz v3, :cond_c7

    const/4 v3, 0x5

    goto :goto_c8

    :cond_c7
    const/4 v3, 0x3

    :goto_c8
    or-int/lit8 v8, v3, 0x30

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

    if-eqz v3, :cond_d1

    const/high16 v9, 0x41e00000    # 28.0f

    goto :goto_d3

    :cond_d1
    const/high16 v9, 0x42900000    # 72.0f

    :goto_d3
    const/high16 v10, 0x421c0000    # 39.0f

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

    if-eqz v3, :cond_dc

    const/high16 v11, 0x42900000    # 72.0f

    goto :goto_de

    :cond_dc
    const/high16 v11, 0x41e00000    # 28.0f

    :goto_de
    const/4 v12, 0x0

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

    move-result-object v3

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

    .line 49
    if-eqz p2, :cond_131

    .line 50
    new-instance v2, Lim/tpelyyftgw/ui/components/CheckBox2;

    const/16 v3, 0x15

    invoke-direct {v2, v1, v3}, Lim/tpelyyftgw/ui/components/CheckBox2;-><init>(Landroid/content/Context;I)V

    iput-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

    .line 51
    const/4 v3, 0x0

    const-string/jumbo v6, "windowBackgroundWhite"

    const-string v7, "checkboxCheck"

    invoke-virtual {v2, v3, v6, v7}, Lim/tpelyyftgw/ui/components/CheckBox2;->setColor(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 52
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/components/CheckBox2;->setDrawUnchecked(Z)V

    .line 53
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

    invoke-virtual {v2, v5}, Lim/tpelyyftgw/ui/components/CheckBox2;->setDrawBackgroundAsArc(I)V

    .line 54
    iget-object v2, v0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

    const/high16 v6, 0x41c00000    # 24.0f

    const/high16 v7, 0x41c00000    # 24.0f

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

    if-eqz v3, :cond_110

    goto :goto_111

    :cond_110
    const/4 v4, 0x3

    :goto_111
    or-int/lit8 v8, v4, 0x30

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

    if-eqz v3, :cond_119

    const/4 v9, 0x0

    goto :goto_11d

    :cond_119
    const/high16 v3, 0x42200000    # 40.0f

    const/high16 v9, 0x42200000    # 40.0f

    :goto_11d
    const/high16 v10, 0x42200000    # 40.0f

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

    if-eqz v3, :cond_128

    const/high16 v13, 0x421c0000    # 39.0f

    const/high16 v11, 0x421c0000    # 39.0f

    goto :goto_129

    :cond_128
    const/4 v11, 0x0

    :goto_129
    const/4 v12, 0x0

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

    move-result-object v3

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

    .line 56
    :cond_131
    return-void
.end method


# virtual methods
.method public getContact()Lim/tpelyyftgw/messenger/ContactsController$Contact;
    .registers 2

    .line 69
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    return-object v0
.end method

.method public hasOverlappingRendering()Z
    .registers 2

    .line 108
    const/4 v0, 0x0

    return v0
.end method

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

    .line 74
    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, 0x42900000    # 72.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 75
    return-void
.end method

.method public recycle()V
    .registers 2

    .line 78
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarImageView:Lim/tpelyyftgw/ui/components/BackupImageView;

    invoke-virtual {v0}, Lim/tpelyyftgw/ui/components/BackupImageView;->getImageReceiver()Lim/tpelyyftgw/messenger/ImageReceiver;

    move-result-object v0

    invoke-virtual {v0}, Lim/tpelyyftgw/messenger/ImageReceiver;->cancelLoadImage()V

    .line 79
    return-void
.end method

.method public setChecked(ZZ)V
    .registers 4
    .param p1, "checked"    # Z
    .param p2, "animated"    # Z

    .line 65
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->checkBox:Lim/tpelyyftgw/ui/components/CheckBox2;

    invoke-virtual {v0, p1, p2}, Lim/tpelyyftgw/ui/components/CheckBox2;->setChecked(ZZ)V

    .line 66
    return-void
.end method

.method public setUser(Lim/tpelyyftgw/messenger/ContactsController$Contact;Ljava/lang/CharSequence;)V
    .registers 4
    .param p1, "contact"    # Lim/tpelyyftgw/messenger/ContactsController$Contact;
    .param p2, "name"    # Ljava/lang/CharSequence;

    .line 59
    iput-object p1, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    .line 60
    iput-object p2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentName:Ljava/lang/CharSequence;

    .line 61
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/cells/InviteUserCell;->update(I)V

    .line 62
    return-void
.end method

.method public update(I)V
    .registers 7
    .param p1, "mask"    # I

    .line 82
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    if-nez v0, :cond_5

    .line 83
    return-void

    .line 85
    :cond_5
    const/4 v1, 0x0

    .line 87
    .local v1, "newName":Ljava/lang/String;
    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarDrawable:Lim/tpelyyftgw/ui/components/AvatarDrawable;

    iget v0, v0, Lim/tpelyyftgw/messenger/ContactsController$Contact;->contact_id:I

    iget-object v3, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget-object v3, v3, Lim/tpelyyftgw/messenger/ContactsController$Contact;->first_name:Ljava/lang/String;

    iget-object v4, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget-object v4, v4, Lim/tpelyyftgw/messenger/ContactsController$Contact;->last_name:Ljava/lang/String;

    invoke-virtual {v2, v0, v3, v4}, Lim/tpelyyftgw/ui/components/AvatarDrawable;->setInfo(ILjava/lang/String;Ljava/lang/String;)V

    .line 89
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentName:Ljava/lang/CharSequence;

    if-eqz v0, :cond_20

    .line 90
    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    const/4 v3, 0x1

    invoke-virtual {v2, v0, v3}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setText(Ljava/lang/CharSequence;Z)Z

    goto :goto_31

    .line 92
    :cond_20
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->nameTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget-object v2, v2, Lim/tpelyyftgw/messenger/ContactsController$Contact;->first_name:Ljava/lang/String;

    iget-object v3, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget-object v3, v3, Lim/tpelyyftgw/messenger/ContactsController$Contact;->last_name:Ljava/lang/String;

    invoke-static {v2, v3}, Lim/tpelyyftgw/messenger/ContactsController;->formatName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setText(Ljava/lang/CharSequence;)Z

    .line 95
    :goto_31
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    const-string/jumbo v2, "windowBackgroundWhiteGrayText"

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setTag(Ljava/lang/Object;)V

    .line 96
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

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

    move-result v2

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setTextColor(I)V

    .line 97
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget v0, v0, Lim/tpelyyftgw/messenger/ContactsController$Contact;->imported:I

    if-lez v0, :cond_58

    .line 98
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget v2, v2, Lim/tpelyyftgw/messenger/ContactsController$Contact;->imported:I

    const-string v3, "AppContacts"

    invoke-static {v3, v2}, Lim/tpelyyftgw/messenger/LocaleController;->formatPluralString(Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setText(Ljava/lang/CharSequence;)Z

    goto :goto_68

    .line 100
    :cond_58
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->statusTextView:Lim/tpelyyftgw/ui/actionbar/SimpleTextView;

    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->currentContact:Lim/tpelyyftgw/messenger/ContactsController$Contact;

    iget-object v2, v2, Lim/tpelyyftgw/messenger/ContactsController$Contact;->phones:Ljava/util/ArrayList;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/CharSequence;

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/actionbar/SimpleTextView;->setText(Ljava/lang/CharSequence;)Z

    .line 103
    :goto_68
    iget-object v0, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarImageView:Lim/tpelyyftgw/ui/components/BackupImageView;

    iget-object v2, p0, Lim/tpelyyftgw/ui/cells/InviteUserCell;->avatarDrawable:Lim/tpelyyftgw/ui/components/AvatarDrawable;

    invoke-virtual {v0, v2}, Lim/tpelyyftgw/ui/components/BackupImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 104
    return-void
.end method