public override Fragment GetItem(int position)
        {
            switch (position)
            {
            case 0:
                return(_generalFragment ?? (_generalFragment = AnimeDetailsPageGeneralTabFragment.Instance));

            case 1:
                return(_detailsFragment ?? (_detailsFragment = AnimeDetailsPageDetailsTabFragment.Instance));

            case 2:
                return(_reviewsFragment ?? (_reviewsFragment = AnimeDetailsPageReviewsTabFragment.Instance));

            case 3:
                return(_recomsFragment ?? (_recomsFragment = AnimeDetailsPageRecomsTabFragment.Instance));

            case 4:
                return(_relatedFragment ?? (_relatedFragment = AnimeDetailsPageRelatedTabFragment.Instance));

            case 5:
                return(_charactersFragment ?? (_charactersFragment = new AnimeDetailsPageCharactersTabFragment()));

            case 6:
                return(_staffFragment ?? (_staffFragment = new AnimeDetailsPageStaffTabFragment()));
            }
            throw new Exception("Emm we've run out of fragments?");
        }
Ejemplo n.º 2
0
 public override Fragment GetItem(int position)
 {
     switch (position)
     {
         case 0:
             return _generalFragment ?? (_generalFragment = AnimeDetailsPageGeneralTabFragment.Instance);
         case 1:
             return _detailsFragment ?? (_detailsFragment = AnimeDetailsPageDetailsTabFragment.Instance);
         case 2:
             return _reviewsFragment ?? (_reviewsFragment = AnimeDetailsPageReviewsTabFragment.Instance);
         case 3:
             return _recomsFragment ?? (_recomsFragment = AnimeDetailsPageRecomsTabFragment.Instance);
         case 4:
             return _relatedFragment ?? (_relatedFragment = AnimeDetailsPageRelatedTabFragment.Instance);
     }
     throw new Exception("Emm we've run out of fragments?");
 }