Merge "Fixing a couple StackView bugs:" into honeycomb

This commit is contained in:
Adam Cohen
2011-01-21 18:12:15 -08:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 2 deletions

View File

@@ -695,6 +695,8 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
if (mWhichChild >= getWindowSize()) {
mWhichChild = 0;
showOnly(mWhichChild, true);
} else if (mOldItemCount != getCount()) {
showOnly(mWhichChild, true);
}
refreshChildren();

View File

@@ -454,9 +454,13 @@ public class StackView extends AdapterViewAnimator {
canvas.getClipBounds(stackInvalidateRect);
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
LayoutParams lp = (LayoutParams) getChildAt(i).getLayoutParams();
final View child = getChildAt(i);
LayoutParams lp = (LayoutParams) child.getLayoutParams();
if ((lp.horizontalOffset == 0 && lp.verticalOffset == 0) ||
child.getAlpha() == 0f || child.getVisibility() != VISIBLE) {
lp.resetInvalidateRect();
}
stackInvalidateRect.union(lp.getInvalidateRect());
lp.resetInvalidateRect();
}
canvas.save(Canvas.CLIP_SAVE_FLAG);
canvas.clipRect(stackInvalidateRect, Region.Op.UNION);