mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-18 08:36:56 -04:00
cleanup: remove unneeded menu entry
It's been a while that everything closes when swiping away the app
This commit is contained in:
@@ -177,7 +177,7 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||
getOnBackPressedDispatcher().addCallback(new OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
MainActivity.dialogForceClose(JavaGUILauncherActivity.this);
|
||||
Tools.dialogForceClose(JavaGUILauncherActivity.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -336,7 +336,7 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||
}
|
||||
|
||||
public void forceClose(View v) {
|
||||
MainActivity.dialogForceClose(this);
|
||||
Tools.dialogForceClose(this);
|
||||
}
|
||||
|
||||
public void openLogOutput(View v) {
|
||||
|
||||
@@ -189,11 +189,10 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
||||
android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.menu_ingame));
|
||||
gameActionClickListener = (parent, view, position, id) -> {
|
||||
switch(position) {
|
||||
case 0: dialogForceClose(MainActivity.this); break;
|
||||
case 1: openLogOutput(); break;
|
||||
case 2: dialogSendCustomKey(); break;
|
||||
case 3: openQuickSettings(); break;
|
||||
case 4: openCustomControls(); break;
|
||||
case 0: openLogOutput(); break;
|
||||
case 1: dialogSendCustomKey(); break;
|
||||
case 2: openQuickSettings(); break;
|
||||
case 3: openCustomControls(); break;
|
||||
}
|
||||
drawerLayout.closeDrawers();
|
||||
};
|
||||
@@ -419,19 +418,6 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static void dialogForceClose(Context ctx) {
|
||||
new AlertDialog.Builder(ctx)
|
||||
.setMessage(R.string.mcn_exit_confirm)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, (p1, p2) -> {
|
||||
try {
|
||||
Tools.fullyExit();
|
||||
} catch (Throwable th) {
|
||||
Log.w(Tools.APP_NAME, "Could not enable System.exit() method!", th);
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if(isInEditor) {
|
||||
|
||||
@@ -1292,4 +1292,17 @@ public final class Tools {
|
||||
return ((SensorManager)context.getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_GYROSCOPE) != null;
|
||||
|
||||
}
|
||||
|
||||
public static void dialogForceClose(Context ctx) {
|
||||
new android.app.AlertDialog.Builder(ctx)
|
||||
.setMessage(R.string.mcn_exit_confirm)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, (p1, p2) -> {
|
||||
try {
|
||||
Tools.fullyExit();
|
||||
} catch (Throwable th) {
|
||||
Log.w(Tools.APP_NAME, "Could not enable System.exit() method!", th);
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="menu_ingame">
|
||||
<item>@string/control_forceclose</item>
|
||||
<item>@string/control_viewout</item>
|
||||
<item>@string/control_customkey</item>
|
||||
<item>@string/quick_setting_title</item>
|
||||
|
||||
Reference in New Issue
Block a user