Proper resize when hoping back into the app

This commit is contained in:
Boulay Mathias 2022-04-24 17:47:24 +02:00
parent 5eec6989fb
commit 6afc22e474

View File

@ -200,14 +200,17 @@ public class BaseMainActivity extends BaseActivity {
Tools.updateWindowSize(this); Tools.updateWindowSize(this);
minecraftGLView.refreshSize(); minecraftGLView.refreshSize();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { runOnUiThread(() -> mControlLayout.refreshControlButtonPositions());
@Override
public void run() {
mControlLayout.refreshControlButtonPositions();
}
}, 1000);
} }
@Override
protected void onPostResume() {
super.onPostResume();
if(minecraftGLView != null) // Useful when backing out of the app
new Handler(Looper.getMainLooper()).postDelayed(() -> minecraftGLView.refreshSize(), 500);
}
public static void fullyExit() { public static void fullyExit() {
android.os.Process.killProcess(android.os.Process.myPid()); android.os.Process.killProcess(android.os.Process.myPid());
} }