Added close button to settings

This commit is contained in:
M66B 2022-05-27 20:15:34 +02:00
parent 8efde8ae2c
commit 5351484935
2 changed files with 15 additions and 2 deletions

View File

@ -211,8 +211,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
menus.add(new NavMenuItem(R.drawable.twotone_close_24, R.string.title_setup_close, new Runnable() {
@Override
public void run() {
drawerLayout.closeDrawer(drawerContainer, false);
onBackPressed();
onMenuClose();
}
}).setColor(colorWarning).setSeparated());
@ -446,6 +445,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
if (drawerToggle.onOptionsItemSelected(item))
return true;
int itemId = item.getItemId();
if (itemId == R.id.menu_close)
onMenuClose();
return super.onOptionsItemSelected(item);
}
@ -477,6 +480,11 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
}
}
private void onMenuClose() {
drawerLayout.closeDrawer(drawerContainer, false);
onBackPressed();
}
private void onMenuExport() {
if (ActivityBilling.isPro(this))
askPassword(true);

View File

@ -7,4 +7,9 @@
android:title="@string/title_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="collapseActionView|always" />
<item
android:id="@+id/menu_close"
android:icon="@drawable/twotone_close_24"
android:title="@string/title_setup_close"
app:showAsAction="ifRoom" />
</menu>