public ArticlesCommentAdapter(Activity context, RecyclerView mainRecyclerView, string themeColor, string articlesId, string type) { try { HasStableIds = true; ActivityContext = context; var mainRecyclerView1 = mainRecyclerView; ThemeColor = themeColor; ApiIdParameter = articlesId; Type = type; var mainLinearLayoutManager = new LinearLayoutManager(context); mainRecyclerView1.SetLayoutManager(mainLinearLayoutManager); var sizeProvider = new FixedPreloadSizeProvider(10, 10); var preLoader = new RecyclerViewPreloader <CommentsArticlesObject>(context, this, sizeProvider, 8); mainRecyclerView1.AddOnScrollListener(preLoader); mainRecyclerView1.SetAdapter(this); mainRecyclerView1.HasFixedSize = true; mainRecyclerView1.SetItemViewCacheSize(10); mainRecyclerView1.ClearAnimation(); mainRecyclerView1.GetLayoutManager().ItemPrefetchEnabled = true; mainRecyclerView1.SetItemViewCacheSize(10); MainScrollEvent = new RecyclerScrollListener(); mainRecyclerView1.AddOnScrollListener(MainScrollEvent); MainScrollEvent.LoadMoreEvent += MainScrollEvent_LoadMoreEvent; MainScrollEvent.IsLoading = false; } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public ReplyCommentAdapter(ReplyCommentActivity context, RecyclerView mainRecyclerView, string commentId) { try { HasStableIds = true; ActivityContext = context; var mainRecyclerView1 = mainRecyclerView; ApiIdParameter = commentId; var mainLinearLayoutManager = new LinearLayoutManager(context); mainRecyclerView1.SetLayoutManager(mainLinearLayoutManager); var sizeProvider = new FixedPreloadSizeProvider(10, 10); var preLoader = new RecyclerViewPreloader <CommentObjectExtra>(context, this, sizeProvider, 8); mainRecyclerView1.AddOnScrollListener(preLoader); mainRecyclerView1.SetAdapter(this); mainRecyclerView1.HasFixedSize = true; mainRecyclerView1.SetItemViewCacheSize(10); mainRecyclerView1.ClearAnimation(); mainRecyclerView1.GetLayoutManager().ItemPrefetchEnabled = true; mainRecyclerView1.SetItemViewCacheSize(10); MainScrollEvent = new RecyclerScrollListener(); mainRecyclerView1.AddOnScrollListener(MainScrollEvent); MainScrollEvent.LoadMoreEvent += MainScrollEvent_LoadMoreEvent; MainScrollEvent.IsLoading = false; } catch (Exception e) { Console.WriteLine(e); } }
private void init(Context context) { scrollListener = new RecyclerScrollListener(this); Orientation = Orientation.Horizontal; SetClipChildren(false); LayoutInflater inflater = LayoutInflater.FromContext(context); inflater.Inflate(Resource.Layout.FastScroller, this, true); bubble = FindViewById <TextView>(Resource.Id.fastscroller_bubble); handle = FindViewById <View>(Resource.Id.fastscroller_handle); bubble.Visibility = ViewStates.Invisible; handle.Visibility = ViewStates.Invisible; }
private void Init(Context context) { try { MainContext = context.ApplicationContext; Instance = this; HasFixedSize = true; SetItemViewCacheSize(20); ClearAnimation(); var display = Context.GetSystemService(Context.WindowService).JavaCast <IWindowManager>().DefaultDisplay; var point = new Point(); display.GetSize(point); VideoSurfaceDefaultHeight = point.X; ScreenDefaultHeight = point.Y; VideoSurfaceView = new PlayerView(MainContext) { ResizeMode = AspectRatioFrameLayout.ResizeModeFixedWidth }; //===================== Exo Player ======================== SetPlayer(); //============================================= MainScrollEvent = new RecyclerScrollListener(MainContext, this); AddOnScrollListener(MainScrollEvent); AddOnChildAttachStateChangeListener(new ChildAttachStateChangeListener(this)); MainScrollEvent.LoadMoreEvent += MainScrollEvent_LoadMoreEvent; MainScrollEvent.IsLoading = false; } catch (Exception e) { Console.WriteLine(e); } }