Fix PiP overlay hiding with OSC disabled

This commit is contained in:
Cameron Gutman 2019-07-28 11:35:31 -07:00
parent b7ef8f54b7
commit dbc9d78002

View File

@ -496,13 +496,16 @@ public class Game extends Activity implements SurfaceHolder.Callback,
if (virtualController != null) {
// Refresh layout of OSC for possible new screen size
virtualController.refreshLayout();
}
// Hide on-screen overlays in PiP mode
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (isInPictureInPictureMode()) {
isHidingOverlays = true;
if (virtualController != null) {
virtualController.hide();
}
performanceOverlayView.setVisibility(View.GONE);
notificationOverlayView.setVisibility(View.GONE);
@ -510,10 +513,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
else {
isHidingOverlays = false;
virtualController.show();
// Restore overlays to previous state when leaving PiP
if (virtualController != null) {
virtualController.show();
}
if (prefConfig.enablePerfOverlay) {
performanceOverlayView.setVisibility(View.VISIBLE);
}
@ -522,7 +527,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
}
}
}
}
@Override
public void onUserLeaveHint() {