Android: Change quick menu exit button to back, add exit

This commit is contained in:
Connor McLaughlin 2021-05-08 12:35:06 +10:00
parent 1751a27604
commit d9151cebf1
3 changed files with 11 additions and 10 deletions

View file

@ -835,7 +835,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
((ImageButton)view.findViewById(R.id.menu)).setOnClickListener(v -> onMenuClicked());
((ImageButton)view.findViewById(R.id.controller_settings)).setOnClickListener(v -> onControllerSettingsClicked());
((ImageButton)view.findViewById(R.id.settings)).setOnClickListener(v -> onSettingsClicked());
((ImageButton)view.findViewById(R.id.quit)).setOnClickListener(v -> onQuitClicked());
((ImageButton)view.findViewById(R.id.close)).setOnClickListener(v -> close(true));
}
@Override
@ -880,12 +880,6 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
setContentFragment(new SettingsCollectionFragment(), true);
settingsChanged = true;
}
private void onQuitClicked() {
close(false);
emulationActivity.mStopRequested = true;
emulationActivity.finish();
}
}
public static class MenuSettingsFragment extends PreferenceFragmentCompat {
@ -924,6 +918,12 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
emulationActivity.showAchievementsPopup();
return true;
});
createPreference(R.string.emulation_menu_exit_game, R.drawable.ic_baseline_exit_to_app_24, true, preference -> {
menuDialogFragment.close(false);
emulationActivity.mStopRequested = true;
emulationActivity.finish();
return true;
});
createPreference(R.string.emulation_menu_patch_codes, R.drawable.ic_baseline_tips_and_updates_24, !cheevosChallengeModeEnabled, preference -> {
menuDialogFragment.close(false);
emulationActivity.showPatchesMenu();

View file

@ -93,14 +93,14 @@
android:src="@drawable/ic_baseline_settings_24" />
<ImageButton
android:id="@+id/quit"
android:id="@+id/close"
android:layout_width="40dp"
android:layout_height="60dp"
android:layout_marginEnd="5dp"
android:background="?android:attr/selectableItemBackground"
android:tint="?android:textColorPrimary"
android:contentDescription="Quit"
android:src="@drawable/ic_baseline_exit_to_app_24" />
android:contentDescription="Close"
android:src="@drawable/ic_baseline_close_24" />
</LinearLayout>

View file

@ -345,4 +345,5 @@
<string name="emulation_menu_touchscreen_controller_settings">Touchscreen Controller Settings</string>
<string name="emulation_menu_toggle_analog_mode">Toggle Controller Analog Mode</string>
<string name="emulation_menu_reset_console">Reset Console</string>
<string name="emulation_menu_exit_game">Exit Game</string>
</resources>