summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/main/impl/BottomNavBar.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-01-19 02:32:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-01-19 02:32:58 +0000
commite7194f7204e0b694106fcaa3cb9d3d3171c92858 (patch)
tree2b045b00d3e609a80196b2a10b829305d6dacbeb /java/com/android/dialer/main/impl/BottomNavBar.java
parent8c3420c5f10bcde9475835d8e93aa2b6cb5a9d17 (diff)
parent5d272d8c24b2719cacd4940d418efb3559a1fb09 (diff)
Merge changes I59b5f641,If438f1b7
* changes: Search, Dialpad, BottomBar and Toolbar now persist state through rotation. Descrease bubble bottom text scaling factor.
Diffstat (limited to 'java/com/android/dialer/main/impl/BottomNavBar.java')
-rw-r--r--java/com/android/dialer/main/impl/BottomNavBar.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/main/impl/BottomNavBar.java b/java/com/android/dialer/main/impl/BottomNavBar.java
index 9aaa988e8..66a57becd 100644
--- a/java/com/android/dialer/main/impl/BottomNavBar.java
+++ b/java/com/android/dialer/main/impl/BottomNavBar.java
@@ -48,6 +48,7 @@ final class BottomNavBar extends LinearLayout {
private BottomNavItem contacts;
private BottomNavItem voicemail;
private OnBottomNavTabSelectedListener listener;
+ private @TabIndex int selectedTab;
public BottomNavBar(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -68,21 +69,25 @@ final class BottomNavBar extends LinearLayout {
speedDial.setOnClickListener(
v -> {
+ selectedTab = TabIndex.SPEED_DIAL;
setSelected(speedDial);
listener.onSpeedDialSelected();
});
callLog.setOnClickListener(
v -> {
+ selectedTab = TabIndex.HISTORY;
setSelected(callLog);
listener.onCallLogSelected();
});
contacts.setOnClickListener(
v -> {
+ selectedTab = TabIndex.CONTACTS;
setSelected(contacts);
listener.onContactsSelected();
});
voicemail.setOnClickListener(
v -> {
+ selectedTab = TabIndex.VOICEMAIL;
setSelected(voicemail);
listener.onVoicemailSelected();
});
@@ -118,6 +123,10 @@ final class BottomNavBar extends LinearLayout {
this.listener = listener;
}
+ public int getSelectedTab() {
+ return selectedTab;
+ }
+
/** Listener for bottom nav tab's on click events. */
public interface OnBottomNavTabSelectedListener {