public async Task LoadData() { refresher.Refreshing = true; List <Project> response = await RestClient.GetProjects(ErrorDelegate); if (response != null && response.Count > 0) { Queries.AddProjects(response); _projects = response; adapter.UpdateProjects(_projects); } refresher.Refreshing = false; HasRefreshedProjects = true; }
public async Task LoadData(bool withLoadingBar = false) { var progressBar = Activity.FindViewById <RelativeLayout>(Resource.Id.progressBarLayout); if (withLoadingBar) { progressBar.Visibility = ViewStates.Visible; } var response = await new RestClient().GetProjects(ShowErrorMessage); if (withLoadingBar) { progressBar.Visibility = ViewStates.Gone; } if (response.Count > 0) { Queries.AddProjects(response); _projects = response; adapter.UpdateProjects(_projects); } }