Fix visual glitch when no contacts/groups
Some text and buttons are briefly visible at the edges of the screen
as they animate under a foreground view. The fix is to hide them while
the foreground ("no contacts"/"no groups") view is visible.
Bug: 5388255
Change-Id: I0a47af8acfbe48b92bc801ce3c9b7499f7e31c96
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 800dc49..103dd2b 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -968,7 +968,12 @@
View mainView = findViewById(R.id.main_view);
if (mProviderStatus == ProviderStatus.STATUS_NORMAL) {
+ // Ensure that the mTabPager is visible; we may have made it invisible below.
contactsUnavailableView.setVisibility(View.GONE);
+ if (mTabPager != null) {
+ mTabPager.setVisibility(View.VISIBLE);
+ }
+
if (mainView != null) {
mainView.setVisibility(View.VISIBLE);
}
@@ -1001,7 +1006,14 @@
} else {
mContactsUnavailableFragment.update();
}
+
+ // Show the contactsUnavailableView, and hide the mTabPager so that we don't
+ // see it sliding in underneath the contactsUnavailableView at the edges.
contactsUnavailableView.setVisibility(View.VISIBLE);
+ if (mTabPager != null) {
+ mTabPager.setVisibility(View.GONE);
+ }
+
if (mainView != null) {
mainView.setVisibility(View.INVISIBLE);
}