public override void OnViewRecycled(Java.Lang.Object holderObj) { base.OnViewRecycled(holderObj); FormsRecyclerViewCell holder = holderObj as FormsRecyclerViewCell; if (holder?.ViewCellContainer.Element != null && holder?.AdapterPosition >= 0) { FormsRecyclerCell fastCell = holder.ViewCellContainer.Element as FormsRecyclerCell; fastCell?.OnCellRecycled(); } }
public override void OnViewAttachedToWindow(Java.Lang.Object holderObj) { base.OnViewAttachedToWindow(holderObj); FormsRecyclerViewCell holder = holderObj as FormsRecyclerViewCell; if (holder?.ViewCellContainer.Element != null && holder.AdapterPosition >= 0) { FormsRecyclerCell fastCell = holder.ViewCellContainer.Element as FormsRecyclerCell; fastCell?.OnCellAppearing(); } }
public object GetBindingContextForReusedCell(FormsRecyclerCell cell) { if (this.OriginalBindingContextsForReusedItems.ContainsKey(cell)) { return(this.OriginalBindingContextsForReusedItems[cell]); } else { return(null); } }
public void RecycleCell(Android.Views.View view, FormsRecyclerCell newCell) { if (this.CellItemsByCoreCells.ContainsKey(view)) { var reusedItem = this.CellItemsByCoreCells[view]; if (this.OriginalBindingContextsForReusedItems.ContainsKey(newCell)) { reusedItem.BindingContext = this.OriginalBindingContextsForReusedItems[newCell]; } else { reusedItem.BindingContext = newCell.BindingContext; } } }
public FormsRecyclerViewCellContainer(Context context, FormsRecyclerCell fastCell, View parent, double width, FormsRecyclerView formsRecyclerView) : base(context) { this.fastCell = fastCell; this.parent = parent; this.initialWidth = width; using (var handler = new Handler(Looper.MainLooper)) { handler.Post(() => { this.fastCell.PrepareCell(); this.view = Platform.CreateRenderer(fastCell.View); Platform.SetRenderer(fastCell.View, view); this.AddView(this.view.ViewGroup); }); } }
public void CacheCell(FormsRecyclerCell cell, Android.Views.View view) { this.CellItemsByCoreCells[view] = cell; this.OriginalBindingContextsForReusedItems[cell] = cell.BindingContext; }