mirror of
https://github.com/bitwarden/android.git
synced 2024-12-20 08:12:26 +03:00
sync check on disappear
This commit is contained in:
parent
dac3fed303
commit
c3d7cf125f
1 changed files with 13 additions and 2 deletions
|
@ -7,14 +7,16 @@ namespace Bit.App.Controls
|
||||||
public class ExtendedContentPage : ContentPage
|
public class ExtendedContentPage : ContentPage
|
||||||
{
|
{
|
||||||
private ISyncService _syncService;
|
private ISyncService _syncService;
|
||||||
|
private bool _syncIndicator;
|
||||||
|
|
||||||
public ExtendedContentPage(bool syncIndicator = true)
|
public ExtendedContentPage(bool syncIndicator = true)
|
||||||
{
|
{
|
||||||
|
_syncIndicator = syncIndicator;
|
||||||
_syncService = Resolver.Resolve<ISyncService>();
|
_syncService = Resolver.Resolve<ISyncService>();
|
||||||
|
|
||||||
BackgroundColor = Color.FromHex("efeff4");
|
BackgroundColor = Color.FromHex("efeff4");
|
||||||
|
|
||||||
if(syncIndicator)
|
if(_syncIndicator)
|
||||||
{
|
{
|
||||||
IsBusy = _syncService.SyncInProgress;
|
IsBusy = _syncService.SyncInProgress;
|
||||||
|
|
||||||
|
@ -32,6 +34,11 @@ namespace Bit.App.Controls
|
||||||
|
|
||||||
protected override void OnAppearing()
|
protected override void OnAppearing()
|
||||||
{
|
{
|
||||||
|
if(_syncIndicator)
|
||||||
|
{
|
||||||
|
IsBusy = _syncService.SyncInProgress;
|
||||||
|
}
|
||||||
|
|
||||||
var googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
|
var googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
|
||||||
googleAnalyticsService.TrackPage(GetType().Name);
|
googleAnalyticsService.TrackPage(GetType().Name);
|
||||||
base.OnAppearing();
|
base.OnAppearing();
|
||||||
|
@ -39,7 +46,11 @@ namespace Bit.App.Controls
|
||||||
|
|
||||||
protected override void OnDisappearing()
|
protected override void OnDisappearing()
|
||||||
{
|
{
|
||||||
IsBusy = false;
|
if(_syncIndicator)
|
||||||
|
{
|
||||||
|
IsBusy = _syncService.SyncInProgress;
|
||||||
|
}
|
||||||
|
|
||||||
base.OnDisappearing();
|
base.OnDisappearing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue