Merge "Fix problem with transparent background on Twitter app" into honeycomb-mr1

This commit is contained in:
Chet Haase
2011-03-04 10:35:40 -08:00
committed by Android (Google) Code Review

View File

@ -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