Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 //open sound from Popular
 private void PopularSoundAdapterOnOnItemClick(object sender, HSoundAdapterClickEventArgs e)
 {
     try
     {
         if (e.Position > -1)
         {
             var item = PopularSoundAdapter.GetItem(e.Position);
             if (item == null)
             {
                 return;
             }
             Constant.PlayPos = e.Position;
             GlobalContext?.SoundController?.StartPlaySound(item, PopularSoundAdapter.SoundsList);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }