Add exit button and make dashboard first in menu
This commit is contained in:
parent
91eb00e013
commit
54cb49b55a
1 changed files with 13 additions and 2 deletions
|
@ -681,6 +681,17 @@ public class MapActivityActions implements DialogProvider {
|
|||
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app);
|
||||
currentDrawer = DrawerType.MAIN_MENU;
|
||||
|
||||
optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
|
||||
.listen(new OnContextMenuClick() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getMainMenuActivity());
|
||||
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
mapActivity.startActivity(newIntent);
|
||||
return true;
|
||||
}
|
||||
}).reg();
|
||||
|
||||
// 1. Where am I
|
||||
optionsMenuHelper.item(R.string.where_am_i).
|
||||
icons(R.drawable.ic_action_gloc_dark, R.drawable.ic_action_gloc_light)
|
||||
|
@ -886,7 +897,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
|
||||
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
|
||||
optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
|
||||
optionsMenuHelper.item(R.string.exit_Button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
|
||||
.listen(new OnContextMenuClick() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -894,7 +905,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getMainMenuActivity());
|
||||
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
// not exit
|
||||
// newIntent.putExtra(DashboardActivity.APP_EXIT_KEY, DashboardActivity.APP_EXIT_CODE);
|
||||
newIntent.putExtra(MainMenuActivity.APP_EXIT_KEY, MainMenuActivity.APP_EXIT_CODE);
|
||||
mapActivity.startActivity(newIntent);
|
||||
// In future when map will be main screen this should change
|
||||
// app.closeApplication(mapActivity);
|
||||
|
|
Loading…
Reference in a new issue