private void ShowDetails(int speakerId)
        {
            _currentSpeakerId = speakerId;
            if (_isDualPane)
            {
                // We can display everything in-place with fragments.
                // Have the list highlight this item and show the data.
                ListView.SetItemChecked(speakerId, true);

                // Check what fragment is shown, replace if needed.
                var details = FragmentManager.FindFragmentById(Resource.Id.details) as SpeakerDetailsFragment;
                if (details == null || details.ShownSpeakerIndex != speakerId)
                {
                    // Make new fragment to show this selection.
                    details = SpeakerDetailsFragment.NewInstance(speakerId);

                    // Execute a transaction, replacing any existing
                    // fragment with this one inside the frame.
                    var ft = FragmentManager.BeginTransaction();
                    ft.Replace(Resource.Id.details, details);
                    ft.SetTransition(FragmentTransit.FragmentFade);
                    ft.Commit();
                }
            }
            else
            {
                // Otherwise we need to launch a new activity to display
                // the dialog fragment with selected text.
                var intent = new Intent();

                intent.SetClass(Activity, typeof(SpeakerDetailsActivity));
                intent.PutExtra("current_speaker_id", speakerId);
                StartActivity(intent);
            }
        }
Example #2
0
        public static SpeakerDetailsFragment NewInstance(int playId)
        {
            var detailsFrag = new SpeakerDetailsFragment {
                Arguments = new Bundle()
            };

            detailsFrag.Arguments.PutInt("current_speaker_id", playId);
            return(detailsFrag);
        }
Example #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var index = Intent.Extras.GetInt("current_speaker_id", 0);

            var details             = SpeakerDetailsFragment.NewInstance(index); // Details
            var fragmentTransaction = FragmentManager.BeginTransaction();

            fragmentTransaction.Add(Android.Resource.Id.Content, details);
            fragmentTransaction.Commit();
        }
		public static SpeakerDetailsFragment NewInstance (int playId)
		{
			var detailsFrag = new SpeakerDetailsFragment { Arguments = new Bundle () };
			detailsFrag.Arguments.PutInt ("current_speaker_id", playId);
			return detailsFrag;
		}