Exemplo n.º 1
0
        void ShowPlayQuote(int songId)
        {
            if (showingTwoFragments)
            {
                ListView.SetItemChecked(songId, true);
                SongsFragment songsFragment;

                try
                {
                    songsFragment = FragmentManager.FindFragment(Activity.FindViewById(Resource.Id.songs_container)) as SongsFragment;
                }
                catch (Exception e)
                {
                    songsFragment = null;
                    Log.Debug("Songs Fragment: ", e.Message);
                }

                if (songsFragment == null || songsFragment.songsId != songId)
                {
                    var quoteFrag = SongsFragment.NewInstance(songId);

                    FragmentTransaction ft = Activity.SupportFragmentManager.BeginTransaction();

                    ft.Replace(Resource.Id.songs_container, quoteFrag);
                    ft.AddToBackStack(null);
                    ft.SetTransition((int)Android.App.FragmentTransit.FragmentFade);
                    ft.Commit();
                }
            }
            else
            {
                var intent = new Intent(Activity, typeof(SongsActivity));
                intent.PutExtra("current_song_id", songId);

                StartActivity(intent);
            }
        }