// if shrinkToBottom() is called on initialization, it has to be deferred
// until after the first call to onLayout so that it has the correct width
if (mWaitingToShrink) {
- shrink(mWaitingToShrinkState, false);
- mWaitingToShrink = false;
+ // shrink can trigger a synchronous onLayout call, so we
+ // post this to avoid a stack overflow / tangled onLayout calls
+ post(new Runnable() {
+ public void run() {
+ shrink(mWaitingToShrinkState, false);
+ mWaitingToShrink = false;
+ }
+ });
}
if (LauncherApplication.isInPlaceRotationEnabled()) {
mCustomizeTrayBackground.draw(canvas);
}
}
-
super.onDraw(canvas);
}