Always show the footer at the end of a sync if there is a load more uri.
Logic will determine if its hidden because we are already at the end.
Change-Id: I4f8194a1a838b00fb28103d20b88c6f1dc6bfce2
diff --git a/src/com/android/mail/browse/ConversationListFooterView.java b/src/com/android/mail/browse/ConversationListFooterView.java
index 2e3d38c..a9c89d8 100644
--- a/src/com/android/mail/browse/ConversationListFooterView.java
+++ b/src/com/android/mail/browse/ConversationListFooterView.java
@@ -86,7 +86,7 @@
/**
* Update the view to reflect the new folder status.
*/
- public void updateStatus(final Folder folder, int count) {
+ public void updateStatus(final Folder folder) {
mRetry.setTag(folder);
mLoadMore.setTag(folder);
if (folder.isSyncInProgress()) {
@@ -106,7 +106,7 @@
mRetry.setVisibility(
folder.lastSyncResult == UIProvider.LastSyncResult.CONNECTION_ERROR ?
View.VISIBLE : View.GONE);
- } else if (folder.loadMoreUri != null && folder.totalCount > count) {
+ } else if (folder.loadMoreUri != null) {
mLoading.setVisibility(View.GONE);
mNetworkError.setVisibility(View.GONE);
mLoadMore.setVisibility(View.VISIBLE);
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 8d868b4..a3fbf8e 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -549,7 +549,7 @@
public void onFolderUpdated(Folder folder) {
mFolder = folder;
- mFooterView.updateStatus(mFolder, mListAdapter != null ? mListAdapter.getCount() : 0);
+ mFooterView.updateStatus(mFolder);
if (mFolder.isSyncInProgress()) {
mListAdapter.showFooter();
} else if (!mFolder.isSyncInProgress()
@@ -558,9 +558,16 @@
updateSearchResultHeader(mFolder != null ? mFolder.totalCount : 0);
if (mFolder.totalCount == 0) {
mListView.setEmptyView(mEmptyView);
- }
- if (folder.loadMoreUri == null) {
- mListAdapter.hideFooter();
+ } else {
+ if (folder.loadMoreUri == null) {
+ mListAdapter.hideFooter();
+ } else {
+ if (folder.totalCount >= mListAdapter.getCount()) {
+ mListAdapter.hideFooter();
+ } else {
+ mListAdapter.showFooter();
+ }
+ }
}
}
}