summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chet Haase <chet@google.com> 2011-03-03 08:18:17 -0800
committer Chet Haase <chet@google.com> 2011-03-04 09:08:07 -0800
commit7840055f76f2ba1a0052aee09e578cf9314f5364 (patch)
treeff32aa79aee5c0e93836e775293404813f7e2a4d
parent6e38d26c1e66cc957c33d4263013e02623ebd6da (diff)
Fix problem with transparent background on Twitter app
ListViews whose items don't cover their entire content area should not return true for isOpaque() Change-Id: I9165c0315a49bb5774bdcd4c1b89c1be0ebfcebf
-rw-r--r--core/java/android/widget/ListView.java16
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