コード例 #1
1
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudyCardLayout, container, false);
            mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.recyclerView);
            //mListView = view.FindViewById<ListView> (Resource.Id.lvToDoList);
            mFab = view.FindViewById<FloatingActionButton> (Resource.Id.fab);
            mFab.Click += (sender, e) => {
                createFragment(null,true);
            };
            mStudyGroup = new List<StudyGroup> ();
            StudyRequest asyncStudyRquest = new StudyRequest ();
            Task<StudyResponse> data = asyncStudyRquest.StudyRequestAsync (LoginInfo.username, LoginInfo.KEY);

            StudyResponse results = data.Result;
            List<StudyGroup> resultsList = new List<StudyGroup> (results.studyGroups);

            for (int i = 0; i <resultsList.Count; i++) {

                mStudyGroup.Add (resultsList[i]);
            }

            mLayoutManager = new LinearLayoutManager (view.Context);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            mAdapter = new RecyclerAdapter (mStudyGroup,mRecyclerView,this);
            mRecyclerView.SetAdapter (mAdapter);

            return view;
        }
コード例 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudyCardLayout, container, false);

            mRecyclerView = view.FindViewById <RecyclerView> (Resource.Id.recyclerView);
            //mListView = view.FindViewById<ListView> (Resource.Id.lvToDoList);
            mFab        = view.FindViewById <FloatingActionButton> (Resource.Id.fab);
            mFab.Click += (sender, e) => {
                createFragment(null, true);
            };
            mStudyGroup = new List <StudyGroup> ();
            StudyRequest         asyncStudyRquest = new StudyRequest();
            Task <StudyResponse> data             = asyncStudyRquest.StudyRequestAsync(LoginInfo.username, LoginInfo.KEY);

            StudyResponse     results     = data.Result;
            List <StudyGroup> resultsList = new List <StudyGroup> (results.studyGroups);

            for (int i = 0; i < resultsList.Count; i++)
            {
                mStudyGroup.Add(resultsList[i]);
            }

            mLayoutManager = new LinearLayoutManager(view.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new RecyclerAdapter(mStudyGroup, mRecyclerView, this);
            mRecyclerView.SetAdapter(mAdapter);

            return(view);
        }