protected override void DisconnectHandler(RecyclerView nativeView) { recyclerView.ClearOnScrollListeners(); recyclerView.SetAdapter(null); adapter.Dispose(); adapter = null; layoutManager.Dispose(); layoutManager = null; }
protected override void ConnectHandler(RecyclerView nativeView) { layoutManager = new LinearLayoutManager(Context); //layoutManager.Orientation = LinearLayoutManager.Horizontal; positionalViewSelector = new PositionalViewSelector(VirtualView); adapter = new RvAdapter(Context, this, positionalViewSelector); recyclerView.AddOnScrollListener(new RvScrollListener((rv, dx, dy) => { //var x = Context.FromPixels(dx); //var y = Context.FromPixels(dy); // TODO: Proxy up to event // VirtualView?.RaiseScrolled((x, y)); })); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(adapter); recyclerView.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); }