mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
implement search delegate
This commit is contained in:
parent
b3e0b148a6
commit
bc79f22e22
1 changed files with 17 additions and 1 deletions
|
@ -34,6 +34,7 @@ namespace Bit.iOS.Autofill
|
||||||
TableView.RowHeight = UITableView.AutomaticDimension;
|
TableView.RowHeight = UITableView.AutomaticDimension;
|
||||||
TableView.EstimatedRowHeight = 44;
|
TableView.EstimatedRowHeight = 44;
|
||||||
TableView.Source = new TableSource(this);
|
TableView.Source = new TableSource(this);
|
||||||
|
SearchBar.Delegate = new SearchDelegate(this);
|
||||||
await ((TableSource)TableView.Source).LoadItemsAsync(false, SearchBar.Text);
|
await ((TableSource)TableView.Source).LoadItemsAsync(false, SearchBar.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ namespace Bit.iOS.Autofill
|
||||||
private LoginSearchViewController _controller;
|
private LoginSearchViewController _controller;
|
||||||
|
|
||||||
public TableSource(LoginSearchViewController controller)
|
public TableSource(LoginSearchViewController controller)
|
||||||
:base(controller.Context, controller)
|
: base(controller.Context, controller)
|
||||||
{
|
{
|
||||||
_context = controller.Context;
|
_context = controller.Context;
|
||||||
_controller = controller;
|
_controller = controller;
|
||||||
|
@ -158,4 +159,19 @@ namespace Bit.iOS.Autofill
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SearchDelegate : UISearchBarDelegate
|
||||||
|
{
|
||||||
|
private readonly LoginSearchViewController _controller;
|
||||||
|
|
||||||
|
public SearchDelegate(LoginSearchViewController controller)
|
||||||
|
{
|
||||||
|
_controller = controller;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEditingStopped(UISearchBar searchBar)
|
||||||
|
{
|
||||||
|
base.OnEditingStopped(searchBar);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue