LocationCell.smali
.class public Lim/tpelyyftgw/ui/cells/LocationCell;
.super Landroid/widget/FrameLayout;
.source "LocationCell.java"
# instance fields
.field private addressTextView:Landroid/widget/TextView;
.field private imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
.field private nameTextView:Landroid/widget/TextView;
.field private needDivider:Z
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 19
.param p1, "context" # Landroid/content/Context;
.line 29
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/BackupImageView;
invoke-direct {v2, v1}, Lim/tpelyyftgw/ui/components/BackupImageView;-><init>(Landroid/content/Context;)V
iput-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
.line 32
const v3, 0x7f080303
invoke-virtual {v2, v3}, Lim/tpelyyftgw/ui/components/BackupImageView;->setBackgroundResource(I)V
.line 33
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
const/high16 v3, 0x41f00000 # 30.0f
invoke-static {v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I
move-result v4
invoke-static {v3}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I
move-result v3
invoke-virtual {v2, v4, v3}, Lim/tpelyyftgw/ui/components/BackupImageView;->setSize(II)V
.line 34
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
invoke-virtual {v2}, Lim/tpelyyftgw/ui/components/BackupImageView;->getImageReceiver()Lim/tpelyyftgw/messenger/ImageReceiver;
move-result-object v2
new-instance v3, Landroid/graphics/PorterDuffColorFilter;
const-string/jumbo v4, "windowBackgroundWhiteGrayText3"
invoke-static {v4}, Lim/tpelyyftgw/ui/actionbar/Theme;->getColor(Ljava/lang/String;)I
move-result v5
sget-object v6, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;
invoke-direct {v3, v5, v6}, Landroid/graphics/PorterDuffColorFilter;-><init>(ILandroid/graphics/PorterDuff$Mode;)V
invoke-virtual {v2, v3}, Lim/tpelyyftgw/messenger/ImageReceiver;->setColorFilter(Landroid/graphics/ColorFilter;)V
.line 35
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
const/4 v5, 0x5
const/4 v6, 0x3
if-eqz v3, :cond_44
const/4 v3, 0x5
goto :goto_45
:cond_44
const/4 v3, 0x3
:goto_45
or-int/lit8 v9, v3, 0x30
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
const/4 v7, 0x0
const/high16 v8, 0x41880000 # 17.0f
if-eqz v3, :cond_50
const/4 v10, 0x0
goto :goto_52
:cond_50
const/high16 v10, 0x41880000 # 17.0f
:goto_52
const/high16 v11, 0x41000000 # 8.0f
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v3, :cond_5b
const/high16 v12, 0x41880000 # 17.0f
goto :goto_5c
:cond_5b
const/4 v12, 0x0
:goto_5c
const/4 v13, 0x0
const/high16 v7, 0x42200000 # 40.0f
const/high16 v8, 0x42200000 # 40.0f
invoke-static/range {v7 .. v13}, Lim/tpelyyftgw/ui/components/LayoutHelper;->createFrame(FFIFFFF)Landroid/widget/FrameLayout$LayoutParams;
move-result-object v3
invoke-virtual {v0, v2, v3}, Lim/tpelyyftgw/ui/cells/LocationCell;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
.line 37
new-instance v2, Landroid/widget/TextView;
invoke-direct {v2, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
iput-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
.line 38
const/high16 v3, 0x41600000 # 14.0f
const/4 v7, 0x1
invoke-virtual {v2, v7, v3}, Landroid/widget/TextView;->setTextSize(IF)V
.line 39
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
invoke-virtual {v2, v7}, Landroid/widget/TextView;->setMaxLines(I)V
.line 40
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
sget-object v8, Landroid/text/TextUtils$TruncateAt;->END:Landroid/text/TextUtils$TruncateAt;
invoke-virtual {v2, v8}, Landroid/widget/TextView;->setEllipsize(Landroid/text/TextUtils$TruncateAt;)V
.line 41
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
invoke-virtual {v2, v7}, Landroid/widget/TextView;->setSingleLine(Z)V
.line 42
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
const-string/jumbo v8, "windowBackgroundWhiteBlackText"
invoke-static {v8}, Lim/tpelyyftgw/ui/actionbar/Theme;->getColor(Ljava/lang/String;)I
move-result v8
invoke-virtual {v2, v8}, Landroid/widget/TextView;->setTextColor(I)V
.line 43
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
const-string v8, "fonts/rmedium.ttf"
invoke-static {v8}, Lim/tpelyyftgw/messenger/AndroidUtilities;->getTypeface(Ljava/lang/String;)Landroid/graphics/Typeface;
move-result-object v8
invoke-virtual {v2, v8}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
.line 44
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
sget-boolean v8, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v8, :cond_a5
const/4 v8, 0x5
goto :goto_a6
:cond_a5
const/4 v8, 0x3
:goto_a6
invoke-virtual {v2, v8}, Landroid/widget/TextView;->setGravity(I)V
.line 45
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
const/high16 v8, -0x40000000 # -2.0f
const/high16 v9, -0x40000000 # -2.0f
sget-boolean v10, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v10, :cond_b5
const/4 v10, 0x5
goto :goto_b6
:cond_b5
const/4 v10, 0x3
:goto_b6
or-int/lit8 v10, v10, 0x30
sget-boolean v11, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
const/16 v15, 0x10
const/16 v16, 0x48
if-eqz v11, :cond_c3
const/16 v11, 0x10
goto :goto_c5
:cond_c3
const/16 v11, 0x48
:goto_c5
int-to-float v11, v11
const/high16 v12, 0x40a00000 # 5.0f
sget-boolean v13, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v13, :cond_cf
const/16 v13, 0x48
goto :goto_d1
:cond_cf
const/16 v13, 0x10
:goto_d1
int-to-float v13, v13
const/4 v14, 0x0
invoke-static/range {v8 .. v14}, Lim/tpelyyftgw/ui/components/LayoutHelper;->createFrame(FFIFFFF)Landroid/widget/FrameLayout$LayoutParams;
move-result-object v8
invoke-virtual {v0, v2, v8}, Lim/tpelyyftgw/ui/cells/LocationCell;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
.line 47
new-instance v2, Landroid/widget/TextView;
invoke-direct {v2, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
iput-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
.line 48
invoke-virtual {v2, v7, v3}, Landroid/widget/TextView;->setTextSize(IF)V
.line 49
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
invoke-virtual {v2, v7}, Landroid/widget/TextView;->setMaxLines(I)V
.line 50
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
sget-object v3, Landroid/text/TextUtils$TruncateAt;->END:Landroid/text/TextUtils$TruncateAt;
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setEllipsize(Landroid/text/TextUtils$TruncateAt;)V
.line 51
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
invoke-virtual {v2, v7}, Landroid/widget/TextView;->setSingleLine(Z)V
.line 52
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
invoke-static {v4}, Lim/tpelyyftgw/ui/actionbar/Theme;->getColor(Ljava/lang/String;)I
move-result v3
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
.line 53
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v3, :cond_106
const/4 v3, 0x5
goto :goto_107
:cond_106
const/4 v3, 0x3
:goto_107
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setGravity(I)V
.line 54
iget-object v2, v0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
const/high16 v7, -0x40000000 # -2.0f
const/high16 v8, -0x40000000 # -2.0f
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v3, :cond_115
goto :goto_116
:cond_115
const/4 v5, 0x3
:goto_116
or-int/lit8 v9, v5, 0x30
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v3, :cond_11f
const/16 v3, 0x10
goto :goto_121
:cond_11f
const/16 v3, 0x48
:goto_121
int-to-float v10, v3
const/high16 v11, 0x41f00000 # 30.0f
sget-boolean v3, Lim/tpelyyftgw/messenger/LocaleController;->isRTL:Z
if-eqz v3, :cond_12a
const/16 v15, 0x48
:cond_12a
int-to-float v12, v15
const/4 v13, 0x0
invoke-static/range {v7 .. v13}, Lim/tpelyyftgw/ui/components/LayoutHelper;->createFrame(FFIFFFF)Landroid/widget/FrameLayout$LayoutParams;
move-result-object v3
invoke-virtual {v0, v2, v3}, Lim/tpelyyftgw/ui/cells/LocationCell;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
.line 55
return-void
.end method
# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
.registers 9
.param p1, "canvas" # Landroid/graphics/Canvas;
.line 72
iget-boolean v0, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->needDivider:Z
if-eqz v0, :cond_24
.line 73
const/high16 v0, 0x42900000 # 72.0f
invoke-static {v0}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I
move-result v0
int-to-float v2, v0
invoke-virtual {p0}, Lim/tpelyyftgw/ui/cells/LocationCell;->getHeight()I
move-result v0
add-int/lit8 v0, v0, -0x1
int-to-float v3, v0
invoke-virtual {p0}, Lim/tpelyyftgw/ui/cells/LocationCell;->getWidth()I
move-result v0
int-to-float v4, v0
invoke-virtual {p0}, Lim/tpelyyftgw/ui/cells/LocationCell;->getHeight()I
move-result v0
add-int/lit8 v0, v0, -0x1
int-to-float v5, v0
sget-object v6, Lim/tpelyyftgw/ui/actionbar/Theme;->dividerPaint:Landroid/graphics/Paint;
move-object v1, p1
invoke-virtual/range {v1 .. v6}, Landroid/graphics/Canvas;->drawLine(FFFFLandroid/graphics/Paint;)V
.line 75
:cond_24
return-void
.end method
.method protected onMeasure(II)V
.registers 7
.param p1, "widthMeasureSpec" # I
.param p2, "heightMeasureSpec" # I
.line 59
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, 0x42600000 # 56.0f
invoke-static {v2}, Lim/tpelyyftgw/messenger/AndroidUtilities;->dp(F)I
move-result v2
iget-boolean v3, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->needDivider:Z
add-int/2addr v2, v3
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 60
return-void
.end method
.method public setLocation(Lim/tpelyyftgw/tgnet/TLRPC$TL_messageMediaVenue;Ljava/lang/String;Z)V
.registers 6
.param p1, "location" # Lim/tpelyyftgw/tgnet/TLRPC$TL_messageMediaVenue;
.param p2, "icon" # Ljava/lang/String;
.param p3, "divider" # Z
.line 63
iput-boolean p3, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->needDivider:Z
.line 64
iget-object v0, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->nameTextView:Landroid/widget/TextView;
iget-object v1, p1, Lim/tpelyyftgw/tgnet/TLRPC$TL_messageMediaVenue;->title:Ljava/lang/String;
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 65
iget-object v0, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->addressTextView:Landroid/widget/TextView;
iget-object v1, p1, Lim/tpelyyftgw/tgnet/TLRPC$TL_messageMediaVenue;->address:Ljava/lang/String;
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 66
iget-object v0, p0, Lim/tpelyyftgw/ui/cells/LocationCell;->imageView:Lim/tpelyyftgw/ui/components/BackupImageView;
const/4 v1, 0x0
invoke-virtual {v0, p2, v1, v1}, Lim/tpelyyftgw/ui/components/BackupImageView;->setImage(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V
.line 67
xor-int/lit8 v0, p3, 0x1
invoke-virtual {p0, v0}, Lim/tpelyyftgw/ui/cells/LocationCell;->setWillNotDraw(Z)V
.line 68
return-void
.end method