예제 #1
0
        public static DetailFragment NewInstance(string content)
        {
            var fragment = new DetailFragment {
                Arguments = new Bundle()
            };

            fragment.Arguments.PutString("content", content);
            return(fragment);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var detail = DetailFragment.NewInstance(Intent.Extras.GetString("content"));
            var fragmentTransaction = FragmentManager.BeginTransaction();

            fragmentTransaction.Add(Android.Resource.Id.Content, detail);
            fragmentTransaction.Commit();
        }
예제 #3
0
 private void ShowDetail(int position)
 {
     if (this.IsTablet)
     {
         this.ListView.SetItemChecked(position, true);
         var detailFragment      = DetailFragment.NewInstance(this.Feed.FeedItems[position].Content);
         var fragmentTransaction = FragmentManager.BeginTransaction();
         fragmentTransaction.Replace(Resource.Id.detailFragment, detailFragment);
         fragmentTransaction.SetTransition(FragmentTransit.FragmentFade);
         fragmentTransaction.Commit();
     }
     else
     {
         var intent = new Intent();
         intent.SetClass(Activity, typeof(DetailActivity));
         intent.PutExtra("content", this.Feed.FeedItems[position].Content);
         this.StartActivity(intent);
     }
 }