public override void OnResume()
 {
     base.OnResume();
     TournamentsAdapter = new TournamentAdapter(ViewModel.Tournaments);
     TournamentsAdapter.ItemViewClick   += OnItemViewClick;
     TournamentsAdapter.ItemDeleteClick += OnItemDeleteClick;
     TournamentsRecyclerView.SetAdapter(TournamentsAdapter);
 }
Ejemplo n.º 2
0
        public override void OnCreateView(LayoutInflater inflater, ViewGroup container)
        {
            base.OnCreateView(inflater, container);

            #region Desinger Stuff

            SetContentView(Resource.Layout.FragmentTournaments, inflater, container);

            //this.HasOptionsMenu = false;

            #endregion

            //this.Title = "Campionati";

            this.ActionBar.Hide();

            _tournamentAdapter = new TournamentAdapter(this, new Tournament[0]);
            this.TournamentList.SetAdapter(_tournamentAdapter);
            this.TournamentList.ItemSelected += TournamentList_ItemSelected;
            //this.TournamentList.ItemLongPress += TaskList_ItemLongPress;
            //this.TournamentList.ItemCommand += TaskList_ItemCommand;


            //RecyclerView.ItemDecoration itemDecoration = new SpacesItemDecoration(10);
            //this.TournamentList.AddItemDecoration(itemDecoration);

            _yearAdapter = new YearAdapter(this, new Year[0]);
            this.YearList.SetAdapter(_yearAdapter);
            this.YearList.ItemSelected += YearList_ItemSelected;

            LinearLayoutManager layoutManager = new LinearLayoutManager(this.Context, LinearLayoutManager.Horizontal, false);
            //// Optionally customize the position you want to default scroll to
            layoutManager.ScrollToPosition(0);
            // Attach layout manager to the RecyclerView

            this.YearList.SetLayoutManager(layoutManager);
            //this.YearList.ItemLongPress += TaskList_ItemLongPress;
            //this.YearList.ItemCommand += TaskList_ItemCommand;

            RefreshYears();
        }