From 12c72d30bb8b47b58a6a18fe0c1856589fe6e89b Mon Sep 17 00:00:00 2001 From: Me on Windows Date: Fri, 4 Jun 2021 18:05:50 +0000 Subject: [PATCH] Add a trivial Menu --- QuickPlay/MainActivity.cs | 15 ++++++++++++++- QuickPlay/Resources/Resource.designer.cs | 8 ++++---- QuickPlay/Resources/menu/menu_main.xml | 4 +++- QuickPlay/Resources/values/strings.xml | 3 ++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/QuickPlay/MainActivity.cs b/QuickPlay/MainActivity.cs index 4d13104..e76b487 100644 --- a/QuickPlay/MainActivity.cs +++ b/QuickPlay/MainActivity.cs @@ -2,7 +2,8 @@ using Android.App; using Android.OS; //using Android.Runtime; -//using Android.Views; +using Android.Views; +using Android.Widget; //using AndroidX.AppCompat.Widget; //using AndroidX.AppCompat.App; //using Google.Android.Material.FloatingActionButton; @@ -44,6 +45,18 @@ namespace QuickPlay SupportActionBar.Title = "My Toolbar"; } + public override bool OnCreateOptionsMenu(IMenu menu) + { + MenuInflater.Inflate(Resource.Menu.menu_main, menu); + return base.OnCreateOptionsMenu(menu); + } + + public override bool OnOptionsItemSelected(IMenuItem item) + { + Toast.MakeText(this, "Here would be settings, when someone creates it", Android.Widget.ToastLength.Short).Show(); + return base.OnOptionsItemSelected(item); + } + List acquirePlayerConfigs() { // FIXME: Bad! We have IPlayerConfigurationProviders diff --git a/QuickPlay/Resources/Resource.designer.cs b/QuickPlay/Resources/Resource.designer.cs index 3140037..e3b9df3 100644 --- a/QuickPlay/Resources/Resource.designer.cs +++ b/QuickPlay/Resources/Resource.designer.cs @@ -4039,8 +4039,8 @@ namespace QuickPlay // aapt resource value: 0x7f0c001a public const int abc_toolbar_collapse_description = 2131492890; - // aapt resource value: 0x7f0c0037 - public const int action_settings = 2131492919; + // aapt resource value: 0x7f0c0038 + public const int action_settings = 2131492920; // aapt resource value: 0x7f0c0036 public const int app_name = 2131492918; @@ -4084,8 +4084,8 @@ namespace QuickPlay // aapt resource value: 0x7f0c0034 public const int path_password_strike_through = 2131492916; - // aapt resource value: 0x7f0c0038 - public const int player_name = 2131492920; + // aapt resource value: 0x7f0c0037 + public const int player_name = 2131492919; // aapt resource value: 0x7f0c001b public const int search_menu_title = 2131492891; diff --git a/QuickPlay/Resources/menu/menu_main.xml b/QuickPlay/Resources/menu/menu_main.xml index ace8c65..5ccc574 100644 --- a/QuickPlay/Resources/menu/menu_main.xml +++ b/QuickPlay/Resources/menu/menu_main.xml @@ -5,5 +5,7 @@ android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/action_settings" - app:showAsAction="never" /> + android:icon="@mipmap/ic_launcher_round" + app:showAsAction="ifRoom" /> + diff --git a/QuickPlay/Resources/values/strings.xml b/QuickPlay/Resources/values/strings.xml index e369ca1..0084894 100644 --- a/QuickPlay/Resources/values/strings.xml +++ b/QuickPlay/Resources/values/strings.xml @@ -1,5 +1,6 @@ QuickPlay - Settings Not Connected! + + Settings