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();
            }
        }
示例#3
0
 public object GetBindingContextForReusedCell(FormsRecyclerCell cell)
 {
     if (this.OriginalBindingContextsForReusedItems.ContainsKey(cell))
     {
         return(this.OriginalBindingContextsForReusedItems[cell]);
     }
     else
     {
         return(null);
     }
 }
示例#4
0
 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;
         }
     }
 }
示例#5
0
        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);
                });
            }
        }
示例#6
0
 public void CacheCell(FormsRecyclerCell cell, Android.Views.View view)
 {
     this.CellItemsByCoreCells[view] = cell;
     this.OriginalBindingContextsForReusedItems[cell] = cell.BindingContext;
 }