diff --git a/Android/Activities/ActivityHandler.cs b/Android/Activities/ActivityHandler.cs index 6846953..024fb64 100644 --- a/Android/Activities/ActivityHandler.cs +++ b/Android/Activities/ActivityHandler.cs @@ -120,6 +120,6 @@ public bool OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMe private Dictionary> ContextMenuActivations { get; } = new Dictionary>(); private Dictionary> ActivityResultWaiters { get; } = new Dictionary>(); - private static Dictionary Handlers { get; } = new Dictionary(); + internal static Dictionary Handlers { get; } = new Dictionary(); } } \ No newline at end of file diff --git a/Android/PlatformBindings-Android.csproj b/Android/PlatformBindings-Android.csproj index 4f2c535..2a94b31 100644 --- a/Android/PlatformBindings-Android.csproj +++ b/Android/PlatformBindings-Android.csproj @@ -10,7 +10,6 @@ - diff --git a/Android/Services/AndroidNavigationManager.cs b/Android/Services/AndroidNavigationManager.cs index ec73e8a..a01c881 100644 --- a/Android/Services/AndroidNavigationManager.cs +++ b/Android/Services/AndroidNavigationManager.cs @@ -1,4 +1,6 @@ using Android.App; +using Android.Support.V7.App; +using PlatformBindings.Activities; using PlatformBindings.Common; using System; @@ -8,19 +10,45 @@ public class AndroidNavigationManager : INavigationManager { public bool CanGoBack => throw new NotImplementedException(); - public bool ShowBackButton { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool ShowBackButton + { + get + { + return false; + } + set + { + var activity = CurrentActivity; + if (activity is AppCompatActivity compatAct) + { + compatAct.SupportActionBar?.SetDisplayHomeAsUpEnabled(true); + } + else if (activity.ActionBar != null) + { + activity.ActionBar.SetDisplayHomeAsUpEnabled(true); + } + } + } + public bool MenuOpen { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public event EventHandler BackButtonStateChanged; public void ClearBackStack() { - throw new NotImplementedException(); + foreach (var handle in ActivityHandler.Handlers) + { + if (handle.Key != CurrentActivity) + { + handle.Key.Finish(); + ActivityHandler.Handlers.Remove(handle.Key); + } + } } public void GoBack() { - throw new NotImplementedException(); + CurrentActivity.Finish(); } public virtual void Navigate(object PageRequest, object Parameter) diff --git a/Core/PlatformBindings-Core.csproj b/Core/PlatformBindings-Core.csproj index cd7e5eb..1555597 100644 --- a/Core/PlatformBindings-Core.csproj +++ b/Core/PlatformBindings-Core.csproj @@ -21,7 +21,6 @@ -