Hide android soft keyboard. Android styling of table view.

This commit is contained in:
Kyle Spearrin 2016-08-18 19:09:01 -04:00
parent 8a47e99a2c
commit 1c4efb91b9
3 changed files with 23 additions and 5 deletions

View file

@ -21,6 +21,13 @@ namespace Bit.Android.Controls
{ {
public class ExtendedTableViewRenderer : TableViewRenderer public class ExtendedTableViewRenderer : TableViewRenderer
{ {
protected override void OnElementChanged(ElementChangedEventArgs<TableView> e)
{
base.OnElementChanged(e);
Control.Divider = null;
Control.DividerHeight = 0;
}
protected override TableViewModelRenderer GetModelRenderer(AListView listView, TableView view) protected override TableViewModelRenderer GetModelRenderer(AListView listView, TableView view)
{ {
return new CustomTableViewModelRenderer(Context, listView, view); return new CustomTableViewModelRenderer(Context, listView, view);
@ -51,13 +58,13 @@ namespace Bit.Android.Controls
private class CustomTableViewModelRenderer : TableViewModelRenderer private class CustomTableViewModelRenderer : TableViewModelRenderer
{ {
private readonly TableView _view; private readonly ExtendedTableView _view;
private readonly AListView _listView; private readonly AListView _listView;
public CustomTableViewModelRenderer(Context context, AListView listView, TableView view) public CustomTableViewModelRenderer(Context context, AListView listView, TableView view)
: base(context, listView, view) : base(context, listView, view)
{ {
_view = view; _view = view as ExtendedTableView;
_listView = listView; _listView = listView;
} }
@ -66,15 +73,24 @@ namespace Bit.Android.Controls
public override AView GetView(int position, AView convertView, ViewGroup parent) public override AView GetView(int position, AView convertView, ViewGroup parent)
{ {
var baseView = base.GetView(position, convertView, parent); var baseView = base.GetView(position, convertView, parent);
var layout = baseView as LinearLayout;
bool isHeader, nextIsHeader; bool isHeader, nextIsHeader;
GetCellPosition(position, out isHeader, out nextIsHeader); GetCellPosition(position, out isHeader, out nextIsHeader);
if(isHeader) if(isHeader)
{ {
baseView.SetBackgroundColor(Xamarin.Forms.Color.Transparent.ToAndroid()); baseView.SetBackgroundColor(Xamarin.Forms.Color.Transparent.ToAndroid());
var textCell = layout?.GetChildAt(0) as BaseCellView;
if(textCell != null)
{
textCell.SetMainTextColor(Xamarin.Forms.Color.FromHex("777777"));
}
} }
else else
{ {
baseView.SetBackgroundColor(Xamarin.Forms.Color.Red.ToAndroid()); baseView.SetBackgroundColor(_view.SeparatorColor.ToAndroid());
} }
return baseView; return baseView;

View file

@ -26,6 +26,7 @@ namespace Bit.Android
{ {
base.OnCreate(bundle); base.OnCreate(bundle);
Console.WriteLine("A OnCreate"); Console.WriteLine("A OnCreate");
Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
var appIdService = Resolver.Resolve<IAppIdService>(); var appIdService = Resolver.Resolve<IAppIdService>();
var authService = Resolver.Resolve<IAuthService>(); var authService = Resolver.Resolve<IAuthService>();

View file

@ -78,8 +78,7 @@ namespace Bit.App.Pages
ItemsSource = PresentationFolders, ItemsSource = PresentationFolders,
HasUnevenRows = true, HasUnevenRows = true,
GroupHeaderTemplate = new DataTemplate(() => new VaultListHeaderViewCell(this)), GroupHeaderTemplate = new DataTemplate(() => new VaultListHeaderViewCell(this)),
ItemTemplate = new DataTemplate(() => new VaultListViewCell(this)), ItemTemplate = new DataTemplate(() => new VaultListViewCell(this))
BackgroundColor = Color.White
}; };
if(Device.OS == TargetPlatform.iOS) if(Device.OS == TargetPlatform.iOS)
@ -391,6 +390,8 @@ namespace Bit.App.Pages
Button.Image = "more"; Button.Image = "more";
Button.Command = new Command(() => ShowMore()); Button.Command = new Command(() => ShowMore());
Button.BackgroundColor = Color.Transparent; Button.BackgroundColor = Color.Transparent;
BackgroundColor = Color.White;
} }
public VaultListPageModel.Site SiteParameter public VaultListPageModel.Site SiteParameter