updated Launcher2 based on recent changes to view properties

- fixes bugs on both N1 and stingray where workspace
  was seemingly disappearing

Change-Id: Ica3c5aad7bbce58c35417a0022bfe0d1328c2322
This commit is contained in:
Michael Jurka
2010-08-04 16:43:30 -07:00
parent f6710fa8af
commit 8335a24a6b
+6 -10
View File
@@ -634,22 +634,18 @@ public class Workspace extends ViewGroup
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
final int screenCount = getChildCount();
if (mFirstLayout) {
final int width = getWidth();
for (int i = 0; i < screenCount; i++) {
getChildAt(i).setX(i*width);
}
mFirstLayout = false;
}
int childLeft = 0;
final int screenCount = getChildCount();
for (int i = 0; i < screenCount; i++) {
final View child = getChildAt(i);
if (child.getVisibility() != View.GONE) {
final int childX = (int)child.getX();
final int childY = (int)child.getY();
child.layout(childX, childY,
childX + child.getMeasuredWidth(), childY + child.getMeasuredHeight());
final int childWidth = child.getMeasuredWidth();
child.layout(childLeft, 0,
childLeft + childWidth, child.getMeasuredHeight());
childLeft += childWidth;
}
}