Example #1
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MAdapter = new FriendRequestsAdapter(this)
         {
             UserList = new ObservableCollection <UserDataObject>(ListUtils.FriendRequestsList)
         };
         LayoutManager = new LinearLayoutManager(this);
         MRecycler.SetLayoutManager(LayoutManager);
         MRecycler.SetAdapter(MAdapter);
         MRecycler.HasFixedSize = true;
         MRecycler.SetItemViewCacheSize(50);
         MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
         MRecycler.GetRecycledViewPool().Clear();
         var sizeProvider = new FixedPreloadSizeProvider(10, 10);
         var preLoader    = new RecyclerViewPreloader <UserDataObject>(this, MAdapter, sizeProvider, 10);
         MRecycler.AddOnScrollListener(preLoader);
         MRecycler.SetAdapter(MAdapter);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
 /// <summary>
 /// Populate staggered grid with notes
 /// </summary>
 private void PopulateGrid()
 {
     _notesGrid.HasFixedSize = true;
     _notesGrid.SetLayoutManager(new StaggeredGridLayoutManager(Settings.ColumnsCount, StaggeredGridLayoutManager.Vertical));
     _notesGrid.SetAdapter(new NotesListAdapter(_rootActivity, this, NoteStorage.Notes));
     _notesGrid.GetRecycledViewPool().SetMaxRecycledViews(0, 0);
     if (NoteStorage.Notes.Count == 0)
     {
         _nullStateTile.Visibility = ViewStates.Visible;
     }
     else
     {
         _nullStateTile.Visibility = ViewStates.Gone;
     }
 }