From 4dfba13aea09e491a3830b6b9e5b780cb1d75223 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 18 Aug 2016 19:58:25 -0400 Subject: [PATCH] Remove header, upper header text, set accent color. --- src/Android/Controls/ExtendedTableViewRenderer.cs | 12 +++++++++++- src/Android/MainActivity.cs | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Android/Controls/ExtendedTableViewRenderer.cs b/src/Android/Controls/ExtendedTableViewRenderer.cs index c2999ed91..71875ffbe 100644 --- a/src/Android/Controls/ExtendedTableViewRenderer.cs +++ b/src/Android/Controls/ExtendedTableViewRenderer.cs @@ -60,6 +60,7 @@ namespace Bit.Android.Controls { private readonly ExtendedTableView _view; private readonly AListView _listView; + private bool _removedHeader; public CustomTableViewModelRenderer(Context context, AListView listView, TableView view) : base(context, listView, view) @@ -85,7 +86,16 @@ namespace Bit.Android.Controls var textCell = layout?.GetChildAt(0) as BaseCellView; if(textCell != null) { - textCell.SetMainTextColor(Xamarin.Forms.Color.FromHex("777777")); + if(!_removedHeader && position == 0 && _view.NoHeader) + { + textCell.Visibility = ViewStates.Gone; + _removedHeader = true; + } + else + { + textCell.MainText = textCell.MainText?.ToUpperInvariant(); + textCell.SetMainTextColor(Xamarin.Forms.Color.FromHex("777777")); + } } } else diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs index 4eb7fc7d2..d47f28dc7 100644 --- a/src/Android/MainActivity.cs +++ b/src/Android/MainActivity.cs @@ -14,6 +14,7 @@ using Plugin.Connectivity.Abstractions; using Acr.UserDialogs; using PushNotification.Plugin.Abstractions; using Android.Content; +using System.Reflection; namespace Bit.Android { @@ -33,8 +34,13 @@ namespace Bit.Android HockeyApp.Android.CrashManager.Register(this, HockeyAppId, new HockeyAppCrashManagerListener(appIdService, authService)); + global::Xamarin.Forms.Forms.Init(this, bundle); + typeof(Xamarin.Forms.Color).GetProperty("Accent", BindingFlags.Public | BindingFlags.Static) + .SetValue(null, Xamarin.Forms.Color.FromHex("d2d6de")); + + LoadApplication(new App.App( Resolver.Resolve(), Resolver.Resolve(),