Added advanced options action bar menu

This commit is contained in:
M66B 2019-01-27 17:40:49 +00:00
parent 8c5d26643e
commit 7758cdf2c6
2 changed files with 15 additions and 0 deletions

View File

@ -360,6 +360,9 @@ public class FragmentSetup extends FragmentBase {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_advanced:
onMenuAdvanced();
return true;
case R.id.menu_help:
onMenuHelp();
return true;
@ -368,6 +371,12 @@ public class FragmentSetup extends FragmentBase {
}
}
private void onMenuAdvanced() {
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentOptions()).addToBackStack("options");
fragmentTransaction.commit();
}
private void onMenuHelp() {
startActivity(getIntentHelp());
}

View File

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_advanced"
android:icon="@drawable/baseline_settings_applications_24"
android:title="@string/title_setup_advanced"
app:showAsAction="always" />
<item
android:id="@+id/menu_help"
android:icon="@drawable/baseline_help_24"