1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-20 02:03:49 +00:00

Remove android icon from nav bar. Persist selection for lock options.

This commit is contained in:
Kyle Spearrin
2016-05-24 22:32:39 -04:00
parent 3e14f4a19c
commit 83e872f4b6
3 changed files with 88 additions and 7 deletions

View File

@@ -205,6 +205,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\ExtendedEditorRenderer.cs" />
<Compile Include="Controls\ExtendedNavigationPage.cs" />
<Compile Include="Controls\ExtendedSwitchCellRenderer.cs" />
<Compile Include="Controls\ExtendedViewCellRenderer.cs" />
<Compile Include="Controls\ExtendedTextCellRenderer.cs" />

View File

@@ -0,0 +1,27 @@
using Android.App;
using Android.Graphics.Drawables;
using Bit.Android.Controls;
using Bit.App.Controls;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(ExtendedNavigationPage), typeof(ExtendedNavigationRenderer))]
namespace Bit.Android.Controls
{
public class ExtendedNavigationRenderer : NavigationRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<NavigationPage> e)
{
base.OnElementChanged(e);
RemoveAppIconFromActionBar();
}
private void RemoveAppIconFromActionBar()
{
// ref: http://stackoverflow.com/questions/14606294/remove-icon-logo-from-action-bar-on-android
var actionBar = ((Activity)Context).ActionBar;
actionBar.SetIcon(new ColorDrawable(Color.Transparent.ToAndroid()));
}
}
}