Merge change 24473 into eclair
* changes: fix [2074427] SurfaceView doesn't disappear on GONE
This commit is contained in:
@@ -124,6 +124,8 @@ public class SurfaceView extends View {
|
|||||||
};
|
};
|
||||||
|
|
||||||
boolean mRequestedVisible = false;
|
boolean mRequestedVisible = false;
|
||||||
|
boolean mWindowVisibility = false;
|
||||||
|
boolean mViewVisibility = false;
|
||||||
int mRequestedWidth = -1;
|
int mRequestedWidth = -1;
|
||||||
int mRequestedHeight = -1;
|
int mRequestedHeight = -1;
|
||||||
int mRequestedFormat = PixelFormat.OPAQUE;
|
int mRequestedFormat = PixelFormat.OPAQUE;
|
||||||
@@ -176,12 +178,22 @@ public class SurfaceView extends View {
|
|||||||
mSession = getWindowSession();
|
mSession = getWindowSession();
|
||||||
mLayout.token = getWindowToken();
|
mLayout.token = getWindowToken();
|
||||||
mLayout.setTitle("SurfaceView");
|
mLayout.setTitle("SurfaceView");
|
||||||
|
mViewVisibility = getVisibility() == VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onWindowVisibilityChanged(int visibility) {
|
protected void onWindowVisibilityChanged(int visibility) {
|
||||||
super.onWindowVisibilityChanged(visibility);
|
super.onWindowVisibilityChanged(visibility);
|
||||||
mRequestedVisible = visibility == VISIBLE;
|
mWindowVisibility = visibility == VISIBLE;
|
||||||
|
mRequestedVisible = mWindowVisibility && mViewVisibility;
|
||||||
|
updateWindow(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisibility(int visibility) {
|
||||||
|
super.setVisibility(visibility);
|
||||||
|
mViewVisibility = visibility == VISIBLE;
|
||||||
|
mRequestedVisible = mWindowVisibility && mViewVisibility;
|
||||||
updateWindow(false);
|
updateWindow(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user