diff options
author | uabdullah <uabdullah@google.com> | 2018-02-28 16:21:47 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-28 17:12:28 -0800 |
commit | 192b1ffbd1ae2b2d0e4de503d9019864db74d98a (patch) | |
tree | 2fb70ae961918cfaf73caf05db0eb130bf806c09 /java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java | |
parent | 210452f13a70de30a46c4ee2aa41668f840dfefd (diff) |
Parity of OldMainActivityPeer with ListsFragment for VM
This CL helps to ensure that when the VVM settings toggle is turned on or off, or a sim is swapped, inserted or removed the VM tab disappears and appears, just like it currently does. When a VM tab disappears we also move to the speed dial index.
Bug: 73123614,73998717
Test: N/A
PiperOrigin-RevId: 187400703
Change-Id: I76a0b43da86713caa67956413a39299c7ecbc8d1
Diffstat (limited to 'java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java')
-rw-r--r-- | java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java b/java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java index d9a446f84..5ee33fc71 100644 --- a/java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java +++ b/java/com/android/dialer/main/impl/bottomnav/BottomNavBar.java @@ -23,6 +23,7 @@ import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; import com.android.dialer.common.Assert; +import com.android.dialer.common.LogUtil; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; @@ -123,8 +124,25 @@ public final class BottomNavBar extends LinearLayout { } } + /** + * Displays or hides the voicemail tab. + * + * <p>In the event that the voicemail tab was earlier visible but is now no longer visible, we + * move to the speed dial tab. + * + * @param showTab whether to hide or show the voicemail + */ public void showVoicemail(boolean showTab) { + LogUtil.i("OldMainActivityPeer.showVoicemail", "showing Tab:%b", showTab); + int voicemailpreviousVisibility = voicemail.getVisibility(); voicemail.setVisibility(showTab ? View.VISIBLE : View.GONE); + int voicemailcurrentVisibility = voicemail.getVisibility(); + + if (voicemailpreviousVisibility != voicemailcurrentVisibility + && voicemailpreviousVisibility == View.VISIBLE) { + LogUtil.i("OldMainActivityPeer.showVoicemail", "hid VM tab and moved to speed dial tab"); + selectTab(TabIndex.SPEED_DIAL); + } } public void setNotificationCount(@TabIndex int tab, int count) { |