1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-24 16:38:22 +01:00

move fields above attachments on view

This commit is contained in:
Kyle Spearrin 2018-03-06 13:32:58 -05:00
parent fb6e0c9eb8
commit e6f3ad60ef

View File

@ -308,29 +308,6 @@ namespace Bit.App.Pages
Table.Root.Add(NotesSection); Table.Root.Add(NotesSection);
} }
// Attachments
CleanupAttachmentCells();
if(Table.Root.Contains(AttachmentsSection))
{
Table.Root.Remove(AttachmentsSection);
}
if(Model.ShowAttachments && (_tokenService.TokenPremium || cipher.OrganizationId != null))
{
AttachmentsSection = new TableSection(AppResources.Attachments);
AttachmentCells = new List<AttachmentViewCell>();
foreach(var attachment in Model.Attachments.OrderBy(s => s.Name))
{
var attachmentCell = new AttachmentViewCell(attachment, async () =>
{
await OpenAttachmentAsync(cipher, attachment);
});
AttachmentCells.Add(attachmentCell);
AttachmentsSection.Add(attachmentCell);
attachmentCell.InitEvents();
}
Table.Root.Add(AttachmentsSection);
}
// Fields // Fields
if(Table.Root.Contains(FieldsSection)) if(Table.Root.Contains(FieldsSection))
{ {
@ -361,6 +338,29 @@ namespace Bit.App.Pages
Table.Root.Add(FieldsSection); Table.Root.Add(FieldsSection);
} }
// Attachments
CleanupAttachmentCells();
if(Table.Root.Contains(AttachmentsSection))
{
Table.Root.Remove(AttachmentsSection);
}
if(Model.ShowAttachments && (_tokenService.TokenPremium || cipher.OrganizationId != null))
{
AttachmentsSection = new TableSection(AppResources.Attachments);
AttachmentCells = new List<AttachmentViewCell>();
foreach(var attachment in Model.Attachments.OrderBy(s => s.Name))
{
var attachmentCell = new AttachmentViewCell(attachment, async () =>
{
await OpenAttachmentAsync(cipher, attachment);
});
AttachmentCells.Add(attachmentCell);
AttachmentsSection.Add(attachmentCell);
attachmentCell.InitEvents();
}
Table.Root.Add(AttachmentsSection);
}
// Various types // Various types
switch(cipher.Type) switch(cipher.Type)
{ {