mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-19 13:00:12 -07:00
Handle configuration changes to resize the surface;
Deal with surface creation/destruction;
This commit is contained in:
parent
88f31df1f1
commit
8c7bba530e
5 changed files with 54 additions and 17 deletions
|
|
@ -11,11 +11,13 @@ import static org.lwjgl.glfw.CallbackBridge.windowWidth;
|
|||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.*;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.drawerlayout.widget.*;
|
||||
import com.google.android.material.navigation.*;
|
||||
import com.kdt.LoggerView;
|
||||
|
|
@ -44,6 +46,7 @@ public class BaseMainActivity extends BaseActivity {
|
|||
|
||||
private boolean mIsResuming = false;
|
||||
|
||||
ControlLayout mControlLayout;
|
||||
private MinecraftGLSurfaceView minecraftGLView;
|
||||
private static Touchpad touchpad;
|
||||
private LoggerView loggerView;
|
||||
|
|
@ -69,6 +72,7 @@ public class BaseMainActivity extends BaseActivity {
|
|||
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
touchCharInput = findViewById(R.id.mainTouchCharInput);
|
||||
loggerView = findViewById(R.id.mainLoggerView);
|
||||
mControlLayout = findViewById(R.id.main_control_layout);
|
||||
|
||||
mProfile = PojavProfile.getCurrentProfileContent(this);
|
||||
minecraftProfile = LauncherProfiles.mainProfileJson.profiles.get(mProfile.selectedProfile);
|
||||
|
|
@ -187,6 +191,13 @@ public class BaseMainActivity extends BaseActivity {
|
|||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
Tools.getDisplayMetrics(this);
|
||||
minecraftGLView.refreshSize();
|
||||
}
|
||||
|
||||
public static void fullyExit() {
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue