diff options
author | Jin Cao <jinyan@google.com> | 2014-11-02 20:51:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-02 20:51:30 +0000 |
commit | 474d01bf5417461dd626eeca368af5451e81bc94 (patch) | |
tree | b3846ec8f81f2460275dee8e82d1281cf3072d2c /src/com | |
parent | d15615dd903a85feb9b80a1f84de687d3438477c (diff) | |
parent | 92c94536a0122e4b1fff6ef33de48b3a621d3fe4 (diff) | |
download | android_packages_apps_UnifiedEmail-474d01bf5417461dd626eeca368af5451e81bc94.tar.gz android_packages_apps_UnifiedEmail-474d01bf5417461dd626eeca368af5451e81bc94.tar.bz2 android_packages_apps_UnifiedEmail-474d01bf5417461dd626eeca368af5451e81bc94.zip |
am 92c94536: am d8c91177: am 462ca678: am bf0e30d4: am 7a2a78fa: Merge "Don\'t include the default footer when there is no content" into ub-gmail-ur14-dev
* commit '92c94536a0122e4b1fff6ef33de48b3a621d3fe4':
Don't include the default footer when there is no content
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/mail/ui/AnimatedAdapter.java | 12 |
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; } /** |