am 2fba6d1c: Merge "Post a message to set SurfaceView to be visible when we switch to use the layout size. Otherwise it will first use the old dimension which can exceed the limit, which in turn causes the Browser to crash." into froyo

Merge commit '2fba6d1c1b445b2d26ccd32eb4084e759f513c5d' into froyo-plus-aosp

* commit '2fba6d1c1b445b2d26ccd32eb4084e759f513c5d':
  Post a message to set SurfaceView to be visible when
This commit is contained in:
Grace Kloba
2010-04-22 08:23:35 -07:00
committed by Android Git Automerger

View File

@@ -205,7 +205,14 @@ class ViewManager {
if (sView.getVisibility() == View.VISIBLE) {
sView.setVisibility(View.INVISIBLE);
sView.getHolder().setSizeFromLayout();
sView.setVisibility(View.VISIBLE);
// setLayoutParams() only requests the layout. If we set it
// to VISIBLE now, it will use the old dimension to set the
// size. Post a message to ensure that it shows the new size.
mWebView.mPrivateHandler.post(new Runnable() {
public void run() {
sView.setVisibility(View.VISIBLE);
}
});
} else {
sView.getHolder().setSizeFromLayout();
}