public override Fragment GetItem(int position)
        {
            int index = position - 1;

            RaffleDetailFragment fragment=null;

            //0 and n item are extra two elements for loop
            //set the first item is the last element in list

            if (nn_goalcards.Count > 0) {
                if (position == 0) {
                    index = nn_goalcards.Count - 1;
                }
                //set the last element is the first element in list
                else if (position == nn_goalcards.Count + 1) {
                    index = 0;
                }
                if (fragmentdic.ContainsKey (position)) {
                    fragment = fragmentdic [position];
                } else {
                    fragment = new RaffleDetailFragment ();

                    if (position == 0) {
                        fragment.eventcard = nn_goalcards [nn_goalcards.Count - 1];
                    } else if (position == nn_goalcards.Count + 1) {
                        fragment.eventcard = nn_goalcards [0];
                    } else {
                        fragment.eventcard = nn_goalcards [position-1];
                    }

                    fragmentdic.Add (position, fragment);
                }
            }
            return fragment;
        }
Ejemplo n.º 2
0
 public LoginTracker(RaffleDetailFragment detailfragment)
 {
     nn_detailfragment= detailfragment;
 }
Ejemplo n.º 3
0
 public FaceBookShareResult(RaffleDetailFragment fragment)
 {
     this.fragment=fragment;
 }
Ejemplo n.º 4
0
 public FaceBookLoginResult(RaffleDetailFragment fragment)
 {
     this.fragment=fragment;
 }
Ejemplo n.º 5
0
 //canceled carosel
 //type represent confirmed or not
 //        public void ShowRaffleDetailFragment(List<EventCard> cards, int initialposition,int type){
 //            if(!IsFinishing){
 //                var fragment =new RaffleDetailRootFragment ();
 //                fragment.eventcards = cards;
 //                fragment.initialpage = initialposition;
 //                fragment.type = type;
 //                var ft = SupportFragmentManager.BeginTransaction ();
 //                ft.Replace (Resource.Id.home_content_framelayout, fragment);
 //                ft.AddToBackStack (null);
 //                ft.CommitAllowingStateLoss ();
 //                currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
 //            }
 //        }
 public void ShowRaffleDetailFragment(EventCard card)
 {
     if(!IsFinishing){
         var fragment =new RaffleDetailFragment ();
         fragment.eventcard = card;
         var ft = SupportFragmentManager.BeginTransaction ();
         ft.Replace (Resource.Id.home_content_framelayout, fragment);
         ft.AddToBackStack (null);
         ft.CommitAllowingStateLoss ();
         currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
     }
 }