예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActionBar.Hide();
            mNoteAlbum = new NoteAlbum();
            SetNoteData();

            FrameLayout frame = FindViewById <FrameLayout>(Resource.Id.Common_FrameLayout);
            View        note  = LayoutInflater.Inflate(Resource.Layout.NotesPage, null); // Replace the inside of this method call with your desired layout

            frame.AddView(note.FindViewById <LinearLayout>(Resource.Id.Note_Layout));
            SetUpNavBar();

            //Note testNote = new Note();
            ////owner title content guid
            //testNote.Owner = this.userController.CurrentUser.UserName;
            //testNote.GUID = "1";
            //testNote.Title = "Note One";
            //testNote.Content = "Hey Priya!";


            //NoteController noteController = new NoteController();
            //noteController.CreateNote(testNote, this.userController.CurrentUser.UserName);


            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            //Plug in the linear layout manager:
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);


            // Plug in my adapter:
            mAdapter = new NoteAdapter(mNoteAlbum, this, this.userController.CurrentUser);
            mRecyclerView.SetAdapter(mAdapter);

            Button addNoteButton = FindViewById <Button>(Resource.Id.NotePage_AddNoteButton);

            addNoteButton.Click += AddNoteClick;
        }
예제 #2
0
        private void SetNoteData()
        {
            List <Note> notes = this.userController.GetUser(userController.CurrentUser.UserName).ListOfNotes;//CurrentUser.ListOfNotes;

            mNoteAlbum = new NoteAlbum(notes.Select(f => (NoteMini)f).ToList());
        }