1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-25 16:47:55 +01:00

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

View File

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

View File

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