1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 06:22:55 +01:00

Keep main menu items unselected, fix #2351

This commit is contained in:
vanous 2022-06-04 11:26:45 +02:00
parent 621e731d63
commit c188eccff7

View File

@ -334,30 +334,30 @@ public class ControlCenterv2 extends AppCompatActivity
case R.id.action_settings: case R.id.action_settings:
Intent settingsIntent = new Intent(this, SettingsActivity.class); Intent settingsIntent = new Intent(this, SettingsActivity.class);
startActivityForResult(settingsIntent, MENU_REFRESH_CODE); startActivityForResult(settingsIntent, MENU_REFRESH_CODE);
return true; return false; //we do not want the drawer menu item to get selected
case R.id.action_debug: case R.id.action_debug:
Intent debugIntent = new Intent(this, DebugActivity.class); Intent debugIntent = new Intent(this, DebugActivity.class);
startActivity(debugIntent); startActivity(debugIntent);
return true; return false;
case R.id.action_data_management: case R.id.action_data_management:
Intent dbIntent = new Intent(this, DataManagementActivity.class); Intent dbIntent = new Intent(this, DataManagementActivity.class);
startActivity(dbIntent); startActivity(dbIntent);
return true; return false;
case R.id.action_notification_management: case R.id.action_notification_management:
Intent blIntent = new Intent(this, NotificationManagementActivity.class); Intent blIntent = new Intent(this, NotificationManagementActivity.class);
startActivity(blIntent); startActivity(blIntent);
return true; return false;
case R.id.device_action_discover: case R.id.device_action_discover:
launchDiscoveryActivity(); launchDiscoveryActivity();
return true; return false;
case R.id.action_quit: case R.id.action_quit:
GBApplication.quit(); GBApplication.quit();
return true; return false;
case R.id.donation_link: case R.id.donation_link:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/Gadgetbridge")); //TODO: centralize if ever used somewhere else Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/Gadgetbridge")); //TODO: centralize if ever used somewhere else
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i); startActivity(i);
return true; return false;
case R.id.external_changelog: case R.id.external_changelog:
ChangeLog cl = createChangeLog(); ChangeLog cl = createChangeLog();
try { try {
@ -365,14 +365,14 @@ public class ControlCenterv2 extends AppCompatActivity
} catch (Exception ignored) { } catch (Exception ignored) {
GB.toast(getBaseContext(), "Error showing Changelog", Toast.LENGTH_LONG, GB.ERROR); GB.toast(getBaseContext(), "Error showing Changelog", Toast.LENGTH_LONG, GB.ERROR);
} }
return true; return false;
case R.id.about: case R.id.about:
Intent aboutIntent = new Intent(this, AboutActivity.class); Intent aboutIntent = new Intent(this, AboutActivity.class);
startActivity(aboutIntent); startActivity(aboutIntent);
return true; return false;
} }
return true; return false;
} }
private ChangeLog createChangeLog() { private ChangeLog createChangeLog() {