HurriyetBottomNavigationBar.smali
.class public Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;
.super Landroid/widget/LinearLayout;
.source "HurriyetBottomNavigationBar.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
}
.end annotation
# instance fields
.field private currentlySelectedIndex:I
.field private isItemsEnabled:Z
.field private tabItemList:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;",
">;"
}
.end annotation
.end field
.field private tabItemListener:Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.registers 3
.line 41
invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V
const/4 v0, -0x1
.line 27
iput v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
const/4 v0, 0x0
.line 28
iput-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
const/4 v0, 0x0
.line 42
invoke-direct {p0, p1, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 4
.line 36
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const/4 v0, -0x1
.line 27
iput v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
const/4 v0, 0x0
.line 28
iput-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
.line 37
invoke-direct {p0, p1, p2}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.registers 4
.line 31
invoke-direct {p0, p1, p2, p3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
const/4 p3, -0x1
.line 27
iput p3, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
const/4 p3, 0x0
.line 28
iput-boolean p3, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
.line 32
invoke-direct {p0, p1, p2}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->init(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method static synthetic access$000(Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;)Z
.registers 1
.line 24
iget-boolean p0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
return p0
.end method
.method static synthetic access$100(Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;)Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
.registers 1
.line 24
iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemListener:Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
return-object p0
.end method
.method private generateTabItem(IIIIIILjava/lang/String;I)Landroid/view/View;
.registers 24
move-object v0, p0
const v1, 0x7f0701c7
.line 124
invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/HApp;->getDimenWithID(I)I
move-result v1
const v2, 0x7f0701bb
.line 125
invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/HApp;->getDimenWithID(I)I
move-result v2
.line 127
new-instance v13, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;
invoke-static {}, Lhurriyet/mobil/android/hurriyet/HApp;->getAppContext()Landroid/content/Context;
move-result-object v3
invoke-direct {v13, v3}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;-><init>(Landroid/content/Context;)V
.line 128
new-instance v3, Landroid/widget/LinearLayout$LayoutParams;
const/4 v4, 0x0
const/4 v5, -0x1
const/high16 v6, 0x3f800000 # 1.0f
invoke-direct {v3, v4, v5, v6}, Landroid/widget/LinearLayout$LayoutParams;-><init>(IIF)V
.line 129
invoke-virtual {v13, v3}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
move-object/from16 v11, p7
.line 131
invoke-virtual {v13, v11}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V
.line 132
invoke-virtual {v13, v4}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setIncludeFontPadding(Z)V
move/from16 v6, p2
int-to-float v3, v6
.line 133
invoke-virtual {v13, v4, v3}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextSize(IF)V
.line 134
invoke-virtual {v13, v4}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setFontType(I)V
const v3, 0x7f070382
.line 135
invoke-static {v3}, Lhurriyet/mobil/android/hurriyet/HApp;->getDimenWithID(I)I
move-result v3
invoke-virtual {v13, v3}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setCompoundDrawablePadding(I)V
move/from16 v5, p1
.line 136
invoke-virtual {v13, v4, v5, v4, v4}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setCompoundDrawablesWithIntrinsicBounds(IIII)V
move/from16 v7, p3
.line 137
invoke-virtual {v13, v7}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextColor(I)V
const/16 v3, 0x51
.line 138
invoke-virtual {v13, v3}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setGravity(I)V
.line 139
invoke-virtual {v13, v4, v1, v4, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setPadding(IIII)V
.line 140
invoke-virtual {v13}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setSingleLine()V
.line 141
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, 0xb
if-lt v1, v2, :cond_73
.line 144
new-instance v1, Landroid/util/TypedValue;
invoke-direct {v1}, Landroid/util/TypedValue;-><init>()V
.line 145
invoke-virtual {p0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->getContext()Landroid/content/Context;
move-result-object v2
invoke-virtual {v2}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;
move-result-object v2
const v3, 0x101030e
const/4 v4, 0x1
invoke-virtual {v2, v3, v1, v4}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z
.line 146
iget v1, v1, Landroid/util/TypedValue;->resourceId:I
invoke-virtual {v13, v1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setBackgroundResource(I)V
.line 149
:cond_73
new-instance v1, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$1;
move/from16 v2, p8
invoke-direct {v1, p0, v2}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$1;-><init>(Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;I)V
invoke-virtual {v13, v1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 161
iget-object v1, v0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemList:Ljava/util/List;
new-instance v14, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;
move-object v3, v14
move-object v4, v13
move/from16 v5, p1
move/from16 v6, p2
move/from16 v7, p3
move/from16 v8, p4
move/from16 v9, p5
move/from16 v10, p6
move-object/from16 v11, p7
move/from16 v12, p8
invoke-direct/range {v3 .. v12}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;-><init>(Landroid/widget/TextView;IIIIIILjava/lang/String;I)V
invoke-interface {v1, v14}, Ljava/util/List;->add(Ljava/lang/Object;)Z
return-object v13
.end method
.method private init(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 3
.line 46
invoke-virtual {p0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isInEditMode()Z
move-result p1
if-eqz p1, :cond_7
return-void
.line 49
:cond_7
new-instance p1, Ljava/util/ArrayList;
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemList:Ljava/util/List;
const p1, 0x7f060041
.line 51
invoke-static {p1}, Lhurriyet/mobil/android/hurriyet/HApp;->getColorWithID(I)I
move-result p1
invoke-virtual {p0, p1}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->setBackgroundColor(I)V
const/16 p1, 0x8
new-array p1, p1, [I
.line 53
fill-array-data p1, :array_24
.line 59
invoke-virtual {p0, p1}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->regenerateTabItems([I)V
return-void
nop
:array_24
.array-data 4
0x7f080125
0x7f080124
0x7f08016f
0x7f08016e
0x7f08016a
0x7f080169
0x7f08014e
0x7f08014d
.end array-data
.end method
.method private setSelectedItemInner(IZ)Z
.registers 8
const/4 v0, 0x0
const/4 v1, -0x1
if-le p1, v1, :cond_9
.line 191
iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemList:Ljava/util/List;
if-nez v1, :cond_9
return v0
.line 194
:cond_9
iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemList:Ljava/util/List;
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v1
:cond_f
:goto_f
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
const/4 v3, 0x1
if-eqz v2, :cond_3f
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;
.line 195
iget v4, v2, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;->position:I
if-ne v4, p1, :cond_3b
.line 196
iget v4, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
if-eq p1, v4, :cond_27
.line 197
invoke-virtual {v2, v3}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;->setSelected(Z)V
.line 199
:cond_27
iget-object v3, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemListener:Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
if-eqz v3, :cond_f
if-eqz p2, :cond_f
.line 200
iget-object v2, v2, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;->tabItemView:Landroid/widget/TextView;
invoke-interface {v3, v2, p1}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;->onTabItemClicked(Landroid/view/View;I)Z
move-result v2
if-nez v2, :cond_f
.line 202
iget p1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
invoke-direct {p0, p1, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->setSelectedItemInner(IZ)Z
return v0
.line 207
:cond_3b
invoke-virtual {v2, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBarItem;->setSelected(Z)V
goto :goto_f
.line 210
:cond_3f
iput p1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->currentlySelectedIndex:I
return v3
.end method
# virtual methods
.method public getItemsEnabled()Z
.registers 2
.line 219
iget-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
return v0
.end method
.method public onBackPressed()V
.registers 3
.line 185
iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemListener:Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
if-eqz v0, :cond_c
.line 186
invoke-interface {v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;->getSelectedItem()I
move-result v0
const/4 v1, 0x0
invoke-direct {p0, v0, v1}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->setSelectedItemInner(IZ)Z
:cond_c
return-void
.end method
.method public performClickOnItem(I)Z
.registers 3
const/4 v0, 0x1
.line 181
invoke-direct {p0, p1, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->setSelectedItemInner(IZ)Z
move-result p1
return p1
.end method
.method public regenerateTabItems([I)V
.registers 16
const/4 v0, 0x1
.line 63
iput-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
if-eqz p1, :cond_89
.line 64
array-length v1, p1
if-ge v1, v0, :cond_a
goto/16 :goto_89
:cond_a
const v1, 0x7f0701fe
.line 68
invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/HApp;->getDimenWithID(I)I
move-result v1
const v2, 0x7f07021f
.line 69
invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/HApp;->getDimenWithID(I)I
move-result v11
const v2, 0x7f06014e
.line 70
invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/HApp;->getColorWithID(I)I
move-result v12
const v2, 0x7f060147
.line 71
invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/HApp;->getColorWithID(I)I
move-result v13
.line 73
invoke-virtual {p0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->removeAllViews()V
.line 74
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
iput-object v2, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemList:Ljava/util/List;
const/4 v2, 0x0
.line 75
aget v3, p1, v2
aget v6, p1, v0
const v0, 0x7f100299
.line 82
invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/HApp;->getStrWithID(I)Ljava/lang/String;
move-result-object v9
const/4 v10, 0x0
move-object v2, p0
move v4, v1
move v5, v12
move v7, v11
move v8, v13
.line 75
invoke-direct/range {v2 .. v10}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->generateTabItem(IIIIIILjava/lang/String;I)Landroid/view/View;
move-result-object v0
invoke-virtual {p0, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->addView(Landroid/view/View;)V
const/4 v0, 0x2
.line 84
aget v3, p1, v0
const/4 v0, 0x3
aget v6, p1, v0
const v0, 0x7f100298
.line 91
invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/HApp;->getStrWithID(I)Ljava/lang/String;
move-result-object v9
const/4 v10, 0x1
.line 84
invoke-direct/range {v2 .. v10}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->generateTabItem(IIIIIILjava/lang/String;I)Landroid/view/View;
move-result-object v0
invoke-virtual {p0, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->addView(Landroid/view/View;)V
const/4 v0, 0x4
.line 94
aget v3, p1, v0
const/4 v0, 0x5
aget v6, p1, v0
const v0, 0x7f10029c
.line 101
invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/HApp;->getStrWithID(I)Ljava/lang/String;
move-result-object v9
const/4 v10, 0x2
.line 94
invoke-direct/range {v2 .. v10}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->generateTabItem(IIIIIILjava/lang/String;I)Landroid/view/View;
move-result-object v0
invoke-virtual {p0, v0}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->addView(Landroid/view/View;)V
const/4 v0, 0x6
.line 104
aget v3, p1, v0
const/4 v0, 0x7
aget v6, p1, v0
const p1, 0x7f10029b
.line 111
invoke-static {p1}, Lhurriyet/mobil/android/hurriyet/HApp;->getStrWithID(I)Ljava/lang/String;
move-result-object v9
const/4 v10, 0x3
.line 104
invoke-direct/range {v2 .. v10}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->generateTabItem(IIIIIILjava/lang/String;I)Landroid/view/View;
move-result-object p1
invoke-virtual {p0, p1}, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->addView(Landroid/view/View;)V
return-void
:cond_89
:goto_89
const-string p1, "ERROR : Bottom Navigation Bar : tabIconArray was empty"
.line 65
filled-new-array {p1}, [Ljava/lang/String;
move-result-object p1
invoke-static {p1}, Lcom/appcore/utils/L;->wtf([Ljava/lang/String;)V
return-void
.end method
.method public setItemsEnabled(Z)V
.registers 2
.line 215
iput-boolean p1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->isItemsEnabled:Z
return-void
.end method
.method public setTabItemListener(Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;)V
.registers 2
.line 177
iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar;->tabItemListener:Lhurriyet/mobil/android/hurriyet/views/bottomnavigationbar/HurriyetBottomNavigationBar$HurriyetBottomNavigationBarItemClickListener;
return-void
.end method