private void SetRecyclerViewAdapters() { try { MAdapter = new ShowApplyJobsAdapter(this) { JobList = new ObservableCollection <JobDataObject>() }; LayoutManager = new LinearLayoutManager(this); MRecycler.SetLayoutManager(LayoutManager); MRecycler.HasFixedSize = true; MRecycler.SetItemViewCacheSize(10); MRecycler.GetLayoutManager().ItemPrefetchEnabled = true; var sizeProvider = new FixedPreloadSizeProvider(10, 10); var preLoader = new RecyclerViewPreloader <JobDataObject>(this, MAdapter, sizeProvider, 10); MRecycler.AddOnScrollListener(preLoader); MRecycler.SetAdapter(MAdapter); RecyclerViewOnScrollListener xamarinRecyclerViewOnScrollListener = new RecyclerViewOnScrollListener(LayoutManager); MainScrollEvent = xamarinRecyclerViewOnScrollListener; MainScrollEvent.LoadMoreEvent += MainScrollEventOnLoadMoreEvent; MRecycler.AddOnScrollListener(xamarinRecyclerViewOnScrollListener); MainScrollEvent.IsLoading = false; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { MAdView?.Destroy(); MAdapter = null !; SwipeRefreshLayout = null !; MRecycler = null !; EmptyStateLayout = null !; Inflated = null !; MainScrollEvent = null !; DataInfoObject = null !; MAdView = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void DestroyBasic() { try { MAdView?.Destroy(); MAdapter = null; SwipeRefreshLayout = null; MRecycler = null; EmptyStateLayout = null; Inflated = null; MainScrollEvent = null; DataInfoObject = null; MAdView = null; } catch (Exception e) { Console.WriteLine(e); } }