1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-08 03:23:23 +00:00

[BEEEP] add context to search titles (#1878)

* add more descriptive titles to search pages

* add App Resources
This commit is contained in:
Jake Fink
2022-04-10 13:00:52 -04:00
committed by GitHub
parent b6ad3527db
commit 14d4b2ee29
6 changed files with 37 additions and 31 deletions

View File

@@ -160,7 +160,7 @@ namespace Bit.App.Pages
{
if (DoOnce())
{
var page = new SendsPage(_vm.Filter, _vm.Type != null);
var page = new SendsPage(_vm.Filter, _vm.Type);
await Navigation.PushModalAsync(new NavigationPage(page));
}
}

View File

@@ -2,6 +2,7 @@
using System.Linq;
using Bit.App.Controls;
using Bit.App.Resources;
using Bit.Core.Enums;
using Bit.Core.Models.View;
using Xamarin.Forms;
@@ -12,15 +13,22 @@ namespace Bit.App.Pages
private SendsPageViewModel _vm;
private bool _hasFocused;
public SendsPage(Func<SendView, bool> filter, bool type = false)
public SendsPage(Func<SendView, bool> filter, SendType? type = null)
{
InitializeComponent();
_vm = BindingContext as SendsPageViewModel;
_vm.Page = this;
_vm.Filter = filter;
if (type)
if (type != null)
{
_vm.PageTitle = AppResources.SearchType;
if (type == SendType.File)
{
_vm.PageTitle = AppResources.SearchFileSends;
}
else if (type == SendType.Text)
{
_vm.PageTitle = AppResources.SearchTextSends;
}
}
else
{
@@ -33,6 +41,7 @@ namespace Bit.App.Pages
_searchBar.Placeholder = AppResources.Search;
_mainLayout.Children.Insert(0, _searchBar);
_mainLayout.Children.Insert(1, _separator);
ShowModalAnimationDelay = 0;
}
else
{

View File

@@ -17,8 +17,7 @@ namespace Bit.App.Pages
private CiphersPageViewModel _vm;
private bool _hasFocused;
public CiphersPage(Func<CipherView, bool> filter, bool folder = false, bool collection = false,
bool type = false, string autofillUrl = null, bool deleted = false)
public CiphersPage(Func<CipherView, bool> filter, string pageTitle = null, string autofillUrl = null, bool deleted = false)
{
InitializeComponent();
_vm = BindingContext as CiphersPageViewModel;
@@ -26,21 +25,9 @@ namespace Bit.App.Pages
_vm.Filter = filter;
_vm.AutofillUrl = _autofillUrl = autofillUrl;
_vm.Deleted = deleted;
if (deleted)
if (pageTitle != null)
{
_vm.PageTitle = AppResources.SearchTrash;
}
else if (folder)
{
_vm.PageTitle = AppResources.SearchFolder;
}
else if (collection)
{
_vm.PageTitle = AppResources.SearchCollection;
}
else if (type)
{
_vm.PageTitle = AppResources.SearchType;
_vm.PageTitle = string.Format(AppResources.SearchGroup, pageTitle);
}
else
{
@@ -53,6 +40,7 @@ namespace Bit.App.Pages
_searchBar.Placeholder = AppResources.Search;
_mainLayout.Children.Insert(0, _searchBar);
_mainLayout.Children.Insert(1, _separator);
ShowModalAnimationDelay = 0;
}
else
{

View File

@@ -225,8 +225,7 @@ namespace Bit.App.Pages
await _accountListOverlay.HideAsync();
if (DoOnce())
{
var page = new CiphersPage(_vm.Filter, _vm.FolderId != null, _vm.CollectionId != null,
_vm.Type != null, deleted: _vm.Deleted);
var page = new CiphersPage(_vm.Filter, _vm.MainPage ? null : _vm.PageTitle, deleted: _vm.Deleted);
await Navigation.PushModalAsync(new NavigationPage(page));
}
}