private async Task InitializeAsync() { var allGoals = await GetRepository().AllAsync(); adapter.Clear(); RunOnUiThread(() => { adapter.SetGoals(allGoals.Where(g => g.End > DateTime.Now)); }); if (adapter.ItemCount > 0) { emptyCollection.StopAnimation(); goalDetails.View.Visibility = ViewStates.Visible; } else { goalDetails.View.Visibility = ViewStates.Gone; emptyCollection.StartAnimation(); rootLayout.SetBackgroundResource(Resource.Drawable.background); return; } rootLayout.Background = null; }