1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 19:23:58 +00:00

Added nofooter and noheader options to extendedtable view.

This commit is contained in:
Kyle Spearrin
2016-07-04 22:31:15 -04:00
parent 02d0e57197
commit 2d5d9fd113
6 changed files with 129 additions and 62 deletions

View File

@@ -37,6 +37,7 @@ namespace Bit.App.Pages
var nameCell = new FormEntryCell(AppResources.Name);
nameCell.Entry.Text = folder.Name.Decrypt();
nameCell.Tapped += NameCell_Tapped;
var deleteCell = new ExtendedTextCell { Text = AppResources.Delete, TextColor = Color.Red };
deleteCell.Tapped += DeleteCell_Tapped;
@@ -45,16 +46,18 @@ namespace Bit.App.Pages
{
Intent = TableIntent.Settings,
EnableScrolling = false,
EnableSelection = false,
EnableSelection = true,
HasUnevenRows = true,
VerticalOptions = LayoutOptions.Start,
BackgroundColor = Color.Gray,
Margin = new Thickness(0, -1),
Root = new TableRoot
{
new TableSection()
new TableSection
{
nameCell
},
new TableSection
{
deleteCell
}
}
};
@@ -65,23 +68,6 @@ namespace Bit.App.Pages
mainTable.EstimatedRowHeight = 70;
}
var deleteTable = new ExtendedTableView
{
Intent = TableIntent.Settings,
EnableScrolling = false,
EnableSelection = true,
VerticalOptions = LayoutOptions.End,
BackgroundColor = Color.Yellow,
Margin = new Thickness(0, -1),
Root = new TableRoot
{
new TableSection()
{
deleteCell
}
}
};
var saveToolBarItem = new ToolbarItem(AppResources.Save, null, async () =>
{
if(!_connectivity.IsConnected)
@@ -108,7 +94,7 @@ namespace Bit.App.Pages
}, ToolbarItemOrder.Default, 0);
Title = "Edit Folder";
Content = new ScrollView { Content = new StackLayout { Children = { mainTable, deleteTable } } };
Content = mainTable;
ToolbarItems.Add(saveToolBarItem);
if(Device.OS == TargetPlatform.iOS)
{
@@ -121,6 +107,15 @@ namespace Bit.App.Pages
}
}
private void NameCell_Tapped(object sender, EventArgs e)
{
var cell = sender as FormEntryCell;
if(cell != null)
{
cell.Entry.Focus();
}
}
private async void DeleteCell_Tapped(object sender, EventArgs e)
{
// TODO: Validate the delete operation. ex. Cannot delete a folder that has sites in it?