Offset FPS label to make sure it's not hidden by rounded screen corners.

This commit is contained in:
Jean-Philip Desjardins 2021-11-17 13:11:21 -05:00
parent 251ec2a37f
commit 81284985fb

View file

@ -133,6 +133,20 @@ public class EmulatorActivity extends Activity
updateOnScreenWidgets(); updateOnScreenWidgets();
} }
@Override
public void onAttachedToWindow()
{
super.onAttachedToWindow();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
{
DisplayCutout displayCutout = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout();
if(displayCutout != null)
{
_fpsTextView.setX(displayCutout.getSafeInsetLeft());
}
}
}
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) protected void onActivityResult(int requestCode, int resultCode, Intent data)
{ {