mirror of
https://github.com/bitwarden/android.git
synced 2024-12-19 07:41:52 +03:00
tableview no header/footer updates
This commit is contained in:
parent
63373501b1
commit
9e314233d5
3 changed files with 16 additions and 74 deletions
|
@ -126,6 +126,12 @@ namespace Bit.App.Pages
|
|||
EnableSelection = true;
|
||||
VerticalOptions = LayoutOptions.Start;
|
||||
NoFooter = true;
|
||||
|
||||
if(Device.OS == TargetPlatform.iOS)
|
||||
{
|
||||
RowHeight = -1;
|
||||
EstimatedRowHeight = 44;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ namespace Bit.App.Pages
|
|||
private ExtendedSwitchCell PinCell { get; set; }
|
||||
private ExtendedSwitchCell FingerprintCell { get; set; }
|
||||
private ExtendedTextCell LockOptionsCell { get; set; }
|
||||
private ExtendedTableView Table { get; set; }
|
||||
|
||||
private void Init()
|
||||
{
|
||||
|
@ -129,7 +130,7 @@ namespace Bit.App.Pages
|
|||
};
|
||||
rateCell.Tapped += RateCell_Tapped;
|
||||
|
||||
var table = new CustomTable
|
||||
Table = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
|
@ -139,50 +140,22 @@ namespace Bit.App.Pages
|
|||
FingerprintCell,
|
||||
PinCell,
|
||||
twoStepCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table2 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
},
|
||||
new TableSection("Account")
|
||||
{
|
||||
changeMasterPasswordCell,
|
||||
changeEmailCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table3 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
},
|
||||
new TableSection("Manage")
|
||||
{
|
||||
foldersCell,
|
||||
syncCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table4 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
},
|
||||
new TableSection("Current Session")
|
||||
{
|
||||
lockCell,
|
||||
logOutCell
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var table5 = new CustomTable
|
||||
{
|
||||
Root = new TableRoot
|
||||
{
|
||||
},
|
||||
new TableSection("Other")
|
||||
{
|
||||
aboutCell,
|
||||
|
@ -197,7 +170,7 @@ namespace Bit.App.Pages
|
|||
LineBreakMode = LineBreakMode.WordWrap,
|
||||
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
|
||||
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)
|
||||
|
@ -211,7 +184,7 @@ namespace Bit.App.Pages
|
|||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Children = { table, table2, table3, table4, table5, rateLabel },
|
||||
Children = { Table, rateLabel },
|
||||
Spacing = 0
|
||||
};
|
||||
|
||||
|
@ -433,10 +406,9 @@ namespace Bit.App.Pages
|
|||
{
|
||||
public CustomTable()
|
||||
{
|
||||
NoFooter = true;
|
||||
VerticalOptions = LayoutOptions.Start;
|
||||
EnableScrolling = false;
|
||||
Intent = TableIntent.Menu;
|
||||
Intent = TableIntent.Settings;
|
||||
HasUnevenRows = true;
|
||||
|
||||
if(Device.OS == TargetPlatform.iOS)
|
||||
|
|
|
@ -32,16 +32,6 @@ namespace Bit.iOS.Controls
|
|||
UpdateRowHeight(view);
|
||||
UpdateEstimatedRowHeight(view);
|
||||
UpdateSeparatorColor(view);
|
||||
|
||||
if(view.NoFooter)
|
||||
{
|
||||
Control.SectionFooterHeight = 0.00001f;
|
||||
}
|
||||
if(view.NoHeader)
|
||||
{
|
||||
Control.SectionHeaderHeight = 0.00001f;
|
||||
}
|
||||
|
||||
SetSource();
|
||||
}
|
||||
}
|
||||
|
@ -153,19 +143,6 @@ namespace Bit.iOS.Controls
|
|||
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)
|
||||
{
|
||||
if(_view.NoFooter && (section + 1) == NumberOfSections(tableView))
|
||||
|
@ -173,20 +150,7 @@ namespace Bit.iOS.Controls
|
|||
return 0.00001f;
|
||||
}
|
||||
|
||||
return UITableView.AutomaticDimension;
|
||||
}
|
||||
|
||||
public override UIView GetViewForFooter(UITableView tableView, nint section)
|
||||
{
|
||||
if(_view.NoFooter && (section + 1) == NumberOfSections(tableView))
|
||||
{
|
||||
return new UIView(CGRect.Empty)
|
||||
{
|
||||
Hidden = true
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
return 10f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue