1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-24 04:04:34 +00:00

attach and detach event handlers onappearing and ondisappearing to free up views for GC

This commit is contained in:
Kyle Spearrin
2017-02-15 00:28:05 -05:00
parent 56c33ee82b
commit f5e7f9249c
18 changed files with 332 additions and 106 deletions

View File

@@ -38,7 +38,6 @@ namespace Bit.App.Pages
useLabelAsPlaceholder: true, imageSource: "envelope", containerPadding: padding);
EmailCell.Entry.ReturnType = Enums.ReturnType.Go;
EmailCell.Entry.Completed += Entry_Completed;
var table = new ExtendedTableView
{
@@ -93,9 +92,18 @@ namespace Bit.App.Pages
protected override void OnAppearing()
{
base.OnAppearing();
EmailCell.InitEvents();
EmailCell.Entry.Completed += Entry_Completed;
EmailCell.Entry.FocusWithDelay();
}
protected override void OnDisappearing()
{
base.OnDisappearing();
EmailCell.Dispose();
EmailCell.Entry.Completed -= Entry_Completed;
}
private async void Entry_Completed(object sender, EventArgs e)
{
await SubmitAsync();