public void OnRefresh() { try { NewReleasesSoundAdapter.SoundsList.Clear(); NewReleasesSoundAdapter.NotifyDataSetChanged(); RecentlyPlayedSoundAdapter.SoundsList.Clear(); RecentlyPlayedSoundAdapter.NotifyDataSetChanged(); PopularSoundAdapter.SoundsList.Clear(); PopularSoundAdapter.NotifyDataSetChanged(); GenresAdapter.GenresList.Clear(); GenresAdapter.NotifyDataSetChanged(); ArtistsAdapter.ArtistsList.Clear(); ArtistsAdapter.NotifyDataSetChanged(); RecommendedList.Clear(); ViewPagerView.Adapter = null; EmptyStateLayout.Visibility = ViewStates.Gone; StartApiService(); } catch (Exception e) { Console.WriteLine(e); } }
private async void GetGenres() { try { if (ListUtils.GenresList?.Count == 0) { await ApiRequest.GetGenres_Api(); } var sqlEntity = new SqLiteDatabase(); ListUtils.GenresList = sqlEntity.Get_GenresList(); sqlEntity.Dispose(); if (ListUtils.GenresList?.Count > 0) { GenresAdapter.GenresList = ListUtils.GenresList; GenresAdapter.NotifyDataSetChanged(); } } catch (Exception e) { Console.WriteLine(e); } }