summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-10-16 19:16:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-16 19:16:50 +0000
commit7a2a78faea3a0e7d92f4da94f95d9c59fc654af6 (patch)
tree66097a179822acfcc8c3c86386518025026384f5 /src
parentf91f88efa3854159f4814af1042a30d4ffbe7027 (diff)
parent8c0fdff583d0471bd830bb7e0c33df8beaa25e93 (diff)
downloadandroid_packages_apps_UnifiedEmail-7a2a78faea3a0e7d92f4da94f95d9c59fc654af6.tar.gz
android_packages_apps_UnifiedEmail-7a2a78faea3a0e7d92f4da94f95d9c59fc654af6.tar.bz2
android_packages_apps_UnifiedEmail-7a2a78faea3a0e7d92f4da94f95d9c59fc654af6.zip
Merge "Don't include the default footer when there is no content" into ub-gmail-ur14-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/mail/ui/AnimatedAdapter.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/mail/ui/AnimatedAdapter.java b/src/com/android/mail/ui/AnimatedAdapter.java
index 83dd9f317..2b38d27f8 100644
--- a/src/com/android/mail/ui/AnimatedAdapter.java
+++ b/src/com/android/mail/ui/AnimatedAdapter.java
@@ -316,9 +316,15 @@ public class AnimatedAdapter extends SimpleCursorAdapter {
// by the underlying cursor.
//
// !! This count still includes the teasers since they are separate from headers. !!
- final int contentCount = super.getCount() + specialViewCount + 1 /* footer */;
- // Only add header count if the content count is not 0.
- return (contentCount == 0) ? contentCount : contentCount + mHeaders.size();
+ int contentCount = super.getCount() + specialViewCount;
+ // If we have no content, the only possible thing to show is custom footer (e.g. loading)
+ if (contentCount == 0) {
+ contentCount += mShowCustomFooter ? 1 : 0;
+ } else {
+ // Only add header & footer is always visible when there are content
+ contentCount += 1 /* footer */ + mHeaders.size();
+ }
+ return contentCount;
}
/**