From 552a1d046497510bb9803302873cca38b05086f6 Mon Sep 17 00:00:00 2001 From: Somethingweirdhere Date: Mon, 25 Jun 2018 20:53:04 +0200 Subject: [PATCH] Options here again --- .../java/org/schabi/newpipe/MainActivity.java | 11 ++++++++++ app/src/main/res/menu/main_menu.xml | 22 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 app/src/main/res/menu/main_menu.xml diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index e2874709b..d9ea66870 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -493,6 +493,9 @@ public class MainActivity extends AppCompatActivity { if (!(fragment instanceof SearchFragment)) { findViewById(R.id.toolbar).findViewById(R.id.toolbar_search_container).setVisibility(View.GONE); + + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.main_menu, menu); } ActionBar actionBar = getSupportActionBar(); @@ -514,6 +517,14 @@ public class MainActivity extends AppCompatActivity { case android.R.id.home: onHomeButtonPressed(); return true; + case R.id.action_show_downloads: + return NavigationHelper.openDownloads(this); + case R.id.action_history: + NavigationHelper.openStatisticFragment(getSupportFragmentManager()); + return true; + case R.id.action_settings: + NavigationHelper.openSettings(this); + return true; default: return super.onOptionsItemSelected(item); } diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml new file mode 100644 index 000000000..05920099a --- /dev/null +++ b/app/src/main/res/menu/main_menu.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file