private void SetRecyclerViewAdapters() { try { MAdapter = new ReplyCommentAdapter(this) { ReplyCommentList = new ObservableCollection <CommentObjectExtra>() }; 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 <CommentObjectExtra>(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 SetRecyclerViewAdapters() { try { MAdapter = new ReplyCommentAdapter(this, MainRecyclerView, CommentId); if (CommentObject != null) { CommentLayout.LayoutResource = string.IsNullOrEmpty(CommentObject.CFile) ? Resource.Layout.Style_Comment : Resource.Layout.Style_Comment_Image; } CommentLayoutView = CommentLayout.Inflate(); var holder = new CommentAdapterViewHolder(CommentLayoutView, "Light") { ReplyTextView = { Visibility = ViewStates.Gone } }; //Load data same as comment adapter CommentActivity.GetInstance()?.CommentsAdapter?.LoadCommentData(CommentObject, holder); } catch (Exception e) { Console.WriteLine(e); } }
private void DestroyBasic() { try { Instance = null; MAdapter = null; MainRecyclerView = null; CommentLayout = null; CommentLayoutView = null; ReplyCountTextView = null; ImgBack = null; ImgSent = null; ImgGallery = null; CommentObject = null; CommentId = null; PathImage = null; } catch (Exception e) { Console.WriteLine(e); } }
private void DestroyBasic() { try { Instance = null !; MAdapter = null !; MRecycler = null !; CommentLayout = null !; CommentLayoutView = null !; ReplyCountTextView = null !; ImgBack = null !; ImgSent = null !; ImgGallery = null !; CommentObject = null !; CommentId = null !; PathImage = null !; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }