1
0
mirror of https://github.com/bitwarden/mobile synced 2025-01-01 03:28:12 +01:00

Added site favorite option

This commit is contained in:
Kyle Spearrin 2016-06-14 22:36:37 -04:00
parent cd9d06b0b3
commit 3c14eaf3f8
6 changed files with 27 additions and 0 deletions

View File

@ -10,6 +10,7 @@
Username = site.Username?.EncryptedString;
Password = site.Password?.EncryptedString;
Notes = site.Notes?.EncryptedString;
Favorite = site.Favorite;
}
public string FolderId { get; set; }
@ -18,5 +19,6 @@
public string Username { get; set; }
public string Password { get; set; }
public string Notes { get; set; }
public bool Favorite { get; set; }
}
}

View File

@ -11,6 +11,7 @@ namespace Bit.App.Models.Api
public string Username { get; set; }
public string Password { get; set; }
public string Notes { get; set; }
public bool Favorite { get; set; }
public DateTime RevisionDate { get; set; }
// Expandables

View File

@ -21,6 +21,7 @@ namespace Bit.App.Models.Data
Username = site.Username?.EncryptedString;
Password = site.Password?.EncryptedString;
Notes = site.Notes?.EncryptedString;
Favorite = site.Favorite;
}
public SiteData(SiteResponse site, string userId)
@ -33,6 +34,7 @@ namespace Bit.App.Models.Data
Username = site.Username;
Password = site.Password;
Notes = site.Notes;
Favorite = site.Favorite;
}
[PrimaryKey]
@ -45,6 +47,7 @@ namespace Bit.App.Models.Data
public string Username { get; set; }
public string Password { get; set; }
public string Notes { get; set; }
public bool Favorite { get; set; }
public DateTime RevisionDateTime { get; set; } = DateTime.UtcNow;
public Site ToSite()

View File

@ -17,6 +17,7 @@ namespace Bit.App.Models
Username = data.Username != null ? new CipherString(data.Username) : null;
Password = data.Password != null ? new CipherString(data.Password) : null;
Notes = data.Notes != null ? new CipherString(data.Notes) : null;
Favorite = data.Favorite;
}
public Site(SiteResponse response)
@ -28,6 +29,7 @@ namespace Bit.App.Models
Username = response.Username != null ? new CipherString(response.Username) : null;
Password = response.Password != null ? new CipherString(response.Password) : null;
Notes = response.Notes != null ? new CipherString(response.Notes) : null;
Favorite = response.Favorite;
}
public string FolderId { get; set; }
@ -35,6 +37,7 @@ namespace Bit.App.Models
public CipherString Username { get; set; }
public CipherString Password { get; set; }
public CipherString Notes { get; set; }
public bool Favorite { get; set; }
public SiteRequest ToSiteRequest()
{

View File

@ -50,6 +50,8 @@ namespace Bit.App.Pages
}
var folderCell = new FormPickerCell(AppResources.Folder, folderOptions.ToArray());
var favoriteCell = new ExtendedSwitchCell { Text = "Favorite" };
var table = new ExtendedTableView
{
Intent = TableIntent.Settings,
@ -66,6 +68,10 @@ namespace Bit.App.Pages
passwordCell,
folderCell
},
new TableSection
{
favoriteCell
},
new TableSection(AppResources.Notes)
{
notesCell
@ -106,6 +112,7 @@ namespace Bit.App.Pages
Username = usernameCell.Entry.Text?.Encrypt(),
Password = passwordCell.Entry.Text?.Encrypt(),
Notes = notesCell.Editor.Text?.Encrypt(),
Favorite = favoriteCell.On
};
if(folderCell.Picker.SelectedIndex > 0)

View File

@ -72,6 +72,12 @@ namespace Bit.App.Pages
var folderCell = new FormPickerCell(AppResources.Folder, folderOptions.ToArray());
folderCell.Picker.SelectedIndex = selectedIndex;
var favoriteCell = new ExtendedSwitchCell
{
Text = "Favorite",
On = site.Favorite
};
var table = new ExtendedTableView
{
Intent = TableIntent.Settings,
@ -88,6 +94,10 @@ namespace Bit.App.Pages
passwordCell,
folderCell
},
new TableSection
{
favoriteCell
},
new TableSection(AppResources.Notes)
{
notesCell
@ -126,6 +136,7 @@ namespace Bit.App.Pages
site.Username = usernameCell.Entry.Text?.Encrypt();
site.Password = passwordCell.Entry.Text?.Encrypt();
site.Notes = notesCell.Editor.Text?.Encrypt();
site.Favorite = favoriteCell.On;
if(folderCell.Picker.SelectedIndex > 0)
{