diff options
| -rw-r--r-- | core/java/android/widget/ListView.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 2802144b5e06..427126b0e68e 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -3015,8 +3015,22 @@ public class ListView extends AbsListView { @Override public boolean isOpaque() { - return (mCachingActive && mIsCacheColorOpaque && mDividerIsOpaque && + boolean retValue = (mCachingActive && mIsCacheColorOpaque && mDividerIsOpaque && hasOpaqueScrollbars()) || super.isOpaque(); + if (retValue) { + // only return true if the list items cover the entire area of the view + final int listTop = mListPadding.top; + View first = getChildAt(0); + if (first == null || first.getTop() > listTop) { + return false; + } + final int listBottom = getHeight() - mListPadding.bottom; + View last = getChildAt(getChildCount() - 1); + if (last == null || last.getBottom() < listBottom) { + return false; + } + } + return retValue; } @Override |