Ensure the IME is rendered above the surface when we z-order the surface to be on top.

This commit is contained in:
Derek Sollenberger
2010-03-01 13:44:42 -05:00
parent a406fb9080
commit ecde72fe41

View File

@@ -319,8 +319,14 @@ public class SurfaceView extends View {
* <p>Calling this overrides any previous call to {@link #setZOrderMediaOverlay}.
*/
public void setZOrderOnTop(boolean onTop) {
mWindowType = onTop ? WindowManager.LayoutParams.TYPE_APPLICATION_PANEL
: WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
if (onTop) {
mWindowType = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
// ensures the surface is placed below the IME
mLayout.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
} else {
mWindowType = WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
mLayout.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
}
}
/**