1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-25 12:43:39 +00:00

Android listview cell background set via drawable so that we can retain the selected state coloring. Adjustments to style separator for tableview cells.

This commit is contained in:
Kyle Spearrin
2016-08-26 18:42:28 -04:00
parent d729f93b17
commit 3807f185d6
7 changed files with 73 additions and 40 deletions

View File

@@ -22,7 +22,15 @@ namespace Bit.Android.Controls
if(View != null)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
if(extendedCell.BackgroundColor != Color.White)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
}
else
{
View.SetBackgroundResource(Resource.Drawable.list_selector);
}
if(item.IsEnabled)
{
View.SetMainTextColor(Color.Black);

View File

@@ -61,7 +61,6 @@ 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)
@@ -93,8 +92,7 @@ namespace Bit.Android.Controls
if(isHeader)
{
layout.SetBackgroundColor(Color.Transparent.ToAndroid());
var textCell = layout?.GetChildAt(0) as BaseCellView;
var textCell = layout.GetChildAt(0) as BaseCellView;
if(textCell != null)
{
if(position == 0 && _view.NoHeader)
@@ -108,9 +106,11 @@ namespace Bit.Android.Controls
}
}
}
else
var bline = layout.GetChildAt(1);
if(bline != null)
{
layout.SetBackgroundColor(_view.SeparatorColor.ToAndroid());
bline.SetBackgroundColor(_view.SeparatorColor.ToAndroid());
}
return layout;

View File

@@ -23,7 +23,14 @@ namespace Bit.Android.Controls
if(View != null)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
if(extendedCell.BackgroundColor != Color.White)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
}
else
{
View.SetBackgroundResource(Resource.Drawable.list_selector);
}
if(extendedCell.ShowDisclousure)
{

View File

@@ -21,7 +21,14 @@ namespace Bit.Android.Controls
if(View != null)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
if(extendedCell.BackgroundColor != Color.White)
{
View.SetBackgroundColor(extendedCell.BackgroundColor.ToAndroid());
}
else
{
View.SetBackgroundResource(Resource.Drawable.list_selector);
}
}
return View;