Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
-Removed unused refs.
Browse files Browse the repository at this point in the history
-Further implemented AndroidNavigationManager.
  • Loading branch information
WilliamABradley committed Nov 21, 2017
1 parent aeb19ef commit 6484015
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Android/Activities/ActivityHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public bool OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMe
private Dictionary<View, Tuple<Controls.MenuLayout.Menu, AndroidContextMenuBinding>> ContextMenuActivations { get; } = new Dictionary<View, Tuple<Controls.MenuLayout.Menu, AndroidContextMenuBinding>>();
private Dictionary<int, TaskCompletionSource<ActivityResult>> ActivityResultWaiters { get; } = new Dictionary<int, TaskCompletionSource<ActivityResult>>();

private static Dictionary<Activity, ActivityHandler> Handlers { get; } = new Dictionary<Activity, ActivityHandler>();
internal static Dictionary<Activity, ActivityHandler> Handlers { get; } = new Dictionary<Activity, ActivityHandler>();
}
}
1 change: 0 additions & 1 deletion Android/PlatformBindings-Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xam.Plugin.Connectivity" Version="3.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="26.1.0.1" />
</ItemGroup>

Expand Down
34 changes: 31 additions & 3 deletions Android/Services/AndroidNavigationManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Android.App;
using Android.Support.V7.App;
using PlatformBindings.Activities;
using PlatformBindings.Common;
using System;

Expand All @@ -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<bool> 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)
Expand Down
1 change: 0 additions & 1 deletion Core/PlatformBindings-Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Net.NetworkInformation" Version="4.3.0" />
<PackageReference Include="Xam.Plugin.Connectivity" Version="3.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 6484015

Please sign in to comment.