tableview no header/footer updates

This commit is contained in:
Kyle Spearrin 2016-07-29 00:13:35 -04:00
parent 63373501b1
commit 9e314233d5
3 changed files with 16 additions and 74 deletions

View file

@ -126,6 +126,12 @@ namespace Bit.App.Pages
EnableSelection = true; EnableSelection = true;
VerticalOptions = LayoutOptions.Start; VerticalOptions = LayoutOptions.Start;
NoFooter = true; NoFooter = true;
if(Device.OS == TargetPlatform.iOS)
{
RowHeight = -1;
EstimatedRowHeight = 44;
}
} }
} }

View file

@ -35,6 +35,7 @@ namespace Bit.App.Pages
private ExtendedSwitchCell PinCell { get; set; } private ExtendedSwitchCell PinCell { get; set; }
private ExtendedSwitchCell FingerprintCell { get; set; } private ExtendedSwitchCell FingerprintCell { get; set; }
private ExtendedTextCell LockOptionsCell { get; set; } private ExtendedTextCell LockOptionsCell { get; set; }
private ExtendedTableView Table { get; set; }
private void Init() private void Init()
{ {
@ -129,7 +130,7 @@ namespace Bit.App.Pages
}; };
rateCell.Tapped += RateCell_Tapped; rateCell.Tapped += RateCell_Tapped;
var table = new CustomTable Table = new CustomTable
{ {
Root = new TableRoot Root = new TableRoot
{ {
@ -139,50 +140,22 @@ namespace Bit.App.Pages
FingerprintCell, FingerprintCell,
PinCell, PinCell,
twoStepCell twoStepCell
} },
}
};
var table2 = new CustomTable
{
Root = new TableRoot
{
new TableSection("Account") new TableSection("Account")
{ {
changeMasterPasswordCell, changeMasterPasswordCell,
changeEmailCell changeEmailCell
} },
}
};
var table3 = new CustomTable
{
Root = new TableRoot
{
new TableSection("Manage") new TableSection("Manage")
{ {
foldersCell, foldersCell,
syncCell syncCell
} },
}
};
var table4 = new CustomTable
{
Root = new TableRoot
{
new TableSection("Current Session") new TableSection("Current Session")
{ {
lockCell, lockCell,
logOutCell logOutCell
} },
}
};
var table5 = new CustomTable
{
Root = new TableRoot
{
new TableSection("Other") new TableSection("Other")
{ {
aboutCell, aboutCell,
@ -197,7 +170,7 @@ namespace Bit.App.Pages
LineBreakMode = LineBreakMode.WordWrap, LineBreakMode = LineBreakMode.WordWrap,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
Style = (Style)Application.Current.Resources["text-muted"], Style = (Style)Application.Current.Resources["text-muted"],
Margin = new Thickness(15, (this.IsLandscape() ? 5 : 0), 15, 25) Margin = new Thickness(15, 0, 15, 25)
}; };
if(Device.OS == TargetPlatform.iOS) if(Device.OS == TargetPlatform.iOS)
@ -211,7 +184,7 @@ namespace Bit.App.Pages
var stackLayout = new StackLayout var stackLayout = new StackLayout
{ {
Children = { table, table2, table3, table4, table5, rateLabel }, Children = { Table, rateLabel },
Spacing = 0 Spacing = 0
}; };
@ -433,10 +406,9 @@ namespace Bit.App.Pages
{ {
public CustomTable() public CustomTable()
{ {
NoFooter = true;
VerticalOptions = LayoutOptions.Start; VerticalOptions = LayoutOptions.Start;
EnableScrolling = false; EnableScrolling = false;
Intent = TableIntent.Menu; Intent = TableIntent.Settings;
HasUnevenRows = true; HasUnevenRows = true;
if(Device.OS == TargetPlatform.iOS) if(Device.OS == TargetPlatform.iOS)

View file

@ -32,16 +32,6 @@ namespace Bit.iOS.Controls
UpdateRowHeight(view); UpdateRowHeight(view);
UpdateEstimatedRowHeight(view); UpdateEstimatedRowHeight(view);
UpdateSeparatorColor(view); UpdateSeparatorColor(view);
if(view.NoFooter)
{
Control.SectionFooterHeight = 0.00001f;
}
if(view.NoHeader)
{
Control.SectionHeaderHeight = 0.00001f;
}
SetSource(); SetSource();
} }
} }
@ -153,19 +143,6 @@ namespace Bit.iOS.Controls
return base.GetHeightForHeader(tableView, section); return base.GetHeightForHeader(tableView, section);
} }
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
if(_view.NoHeader && section == 0)
{
return new UIView(CGRect.Empty)
{
Hidden = true
};
}
return base.GetViewForHeader(tableView, section);
}
public override nfloat GetHeightForFooter(UITableView tableView, nint section) public override nfloat GetHeightForFooter(UITableView tableView, nint section)
{ {
if(_view.NoFooter && (section + 1) == NumberOfSections(tableView)) if(_view.NoFooter && (section + 1) == NumberOfSections(tableView))
@ -173,20 +150,7 @@ namespace Bit.iOS.Controls
return 0.00001f; return 0.00001f;
} }
return UITableView.AutomaticDimension; return 10f;
}
public override UIView GetViewForFooter(UITableView tableView, nint section)
{
if(_view.NoFooter && (section + 1) == NumberOfSections(tableView))
{
return new UIView(CGRect.Empty)
{
Hidden = true
};
}
return null;
} }
} }
} }