コード例 #1
0
 private void SetRecyclerViewAdapters()
 {
     try
     {
         MAdapter = new SharedFilesAdapter(this, UserId, "Vertical")
         {
             SharedFilesList = new ObservableCollection <Classes.SharedFile>()
         };
         LayoutManager = new GridLayoutManager(this, 3);
         MRecycler.AddItemDecoration(new GridSpacingItemDecoration(1, 1, true));
         MRecycler.SetLayoutManager(LayoutManager);
         MRecycler.HasFixedSize = true;
         MRecycler.SetItemViewCacheSize(10);
         MRecycler.GetLayoutManager().ItemPrefetchEnabled = true;
         var sizeProvider = new FixedPreloadSizeProvider(10, 10);
         var preLoader    = new RecyclerViewPreloader <Classes.SharedFile>(this, MAdapter, sizeProvider, 8);
         MRecycler.AddOnScrollListener(preLoader);
         MRecycler.SetAdapter(MAdapter);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }