public void UpdateData(IList <SymbologySettingsItem> symbologyDescriptions) { DiffUtil.DiffResult result = DiffUtil.CalculateDiff( new TypedDiffUtilCallback <SymbologySettingsItem>(this.symbologyDescriptions.ToArray(), symbologyDescriptions.ToArray())); this.symbologyDescriptions = symbologyDescriptions; result.DispatchUpdatesTo(this); }
public void UpdateData(IList <CompositeTypeItem> types) { DiffUtil.DiffResult result = DiffUtil.CalculateDiff( new TypedDiffUtilCallback <CompositeTypeItem>(this.types.ToArray(), types.ToArray())); this.types = types.ToList(); result.DispatchUpdatesTo(this); }
public void UpdateData(IList <LocationType> locationTypes) { DiffUtil.DiffResult result = DiffUtil.CalculateDiff( new TypedDiffUtilCallback <LocationType>(this.locationTypes.ToArray(), locationTypes.ToArray())); this.locationTypes = locationTypes; result.DispatchUpdatesTo(this); }
public void UpdateData(IList <CameraSettingsPositionItem> cameraPositions) { var diff = new TypedDiffUtilCallback <CameraSettingsPositionItem>(this.cameraPositions.ToArray(), cameraPositions.ToArray()); DiffUtil.DiffResult result = DiffUtil.CalculateDiff(diff); this.cameraPositions = cameraPositions; result.DispatchUpdatesTo(this); }
public void UpdateData(IList <ViewfinderType> types) { DiffUtil.DiffResult result = DiffUtil.CalculateDiff( new TypedDiffUtilCallback <ViewfinderType>(this.types.ToArray(), types.ToArray()) ); this.types = types; result.DispatchUpdatesTo(this); }
public virtual void UpdateList(List <TAdapterModel> newDataset) { DiffCallback <TAdapterModel> diffCallback = new DiffCallback <TAdapterModel>(DataSet, newDataset); DiffUtil.DiffResult diffResult = DiffUtil.CalculateDiff(diffCallback); diffResult.DispatchUpdatesTo(this); DataSet.Clear(); DataSet.AddRange(newDataset); }
public void UpdateData(MeasureUnitItem[] measureUnits) { if (measureUnits == null) { return; } DiffUtil.DiffResult result = DiffUtil.CalculateDiff(new TypedDiffUtilCallback <MeasureUnitItem>(this.measureUnits, measureUnits)); this.measureUnits = measureUnits; result.DispatchUpdatesTo(this); }
public void UpdateData(IList <SymbologyItem> items) { if (items == null) { return; } DiffUtil.DiffResult result = DiffUtil.CalculateDiff( new TypedDiffUtilCallback <SymbologyItem>(this.symbologyItems.ToArray(), items.ToArray())); this.symbologyItems = items; result.DispatchUpdatesTo(this); }
public virtual void SwapItems(IList <IList <ICell> > newItems, int column) { IList <IList <ICell> > oldItems = mCellRecyclerViewAdapter.GetItems(); // Set new items without calling notifyCellDataSetChanged method of CellRecyclerViewAdapter mCellRecyclerViewAdapter.SetItems((IList <IList <Adapter.ICell> >)newItems, !mEnableAnimation); if (mEnableAnimation) { // Find the differences between old cell items and new items. ColumnSortCallback diffCallback = new ColumnSortCallback(oldItems, newItems, column); DiffUtil.DiffResult diffResult = DiffUtil.CalculateDiff(diffCallback); diffResult.DispatchUpdatesTo(mCellRecyclerViewAdapter); diffResult.DispatchUpdatesTo(mRowHeaderRecyclerViewAdapter); } }
private void UpdateRecyclerView() { MainThread.BeginInvokeOnMainThread(() => { if (OldList != null) { DiffUtil.DiffResult diffResult = DiffUtil.CalculateDiff(new DiffCallBack(_app, OldList, _app.ListMs), true); diffResult.DispatchUpdatesTo(_readerReadAdapter); } OldList.Clear(); for (int i = 0; i < _app.ListMs.Count; i++) { Dictionary <string, string> m = (Dictionary <string, string>)((Dictionary <string, string>)_app.ListMs[i]); OldList.Add(m); } }); }
private void dispatchUpdates(IReadOnlyList <FlatItemInfo> newImmutableItems, DiffUtil.DiffResult diffResult) { currentItems = newImmutableItems; diffResult.DispatchUpdatesTo(this); lock (collectionUpdateLock) { if (hasPendingUpdate) { hasPendingUpdate = false; startCurrentCollectionUpdate(); } else { isUpdateRunning = false; } } }
public void UpdateList(List <Machine> newList) { if (!_machines.Any()) { _machines.AddRange(newList); NotifyDataSetChanged(); } else { DiffUtil.DiffResult result = DiffUtil.CalculateDiff(new MachineDiffCallback(_machines, newList), true); _machines.Clear(); _machines = null; _machines = newList; result.DispatchUpdatesTo(this); } }
private void SwapItems(IList <IList <ICell> > oldItems, IList <IList <ICell> > newItems, int column, IList <IRowHeader> newRowHeader, SortState sortState) { // Set new items without calling notifyCellDataSetChanged method of CellRecyclerViewAdapter mCellRecyclerViewAdapter.SetItems(newItems, !mEnableAnimation); mRowHeaderRecyclerViewAdapter.SetItems(newRowHeader, !mEnableAnimation); if (mEnableAnimation) { // Find the differences between old cell items and new items. ColumnSortCallback diffCallback = new ColumnSortCallback(oldItems, newItems, column); DiffUtil.DiffResult diffResult = DiffUtil.CalculateDiff(diffCallback); diffResult.DispatchUpdatesTo(mCellRecyclerViewAdapter); diffResult.DispatchUpdatesTo(mRowHeaderRecyclerViewAdapter); } foreach (ColumnSortStateChangedListener listener in columnSortStateChangedListeners) { listener.OnColumnSortStatusChanged(column, sortState); } }
private void dispatchUpdates(IList <CalendarItem> newItems, List <Anchor> newAnchors, DiffUtil.DiffResult diffResult) { var calendarItemInEditModeBeforeUpdate = calendarItemInEditMode; updateCalendarItemInEditMode(null); items = newItems; anchors = newAnchors; diffResult.DispatchUpdatesTo(this); if (calendarItemInEditModeBeforeUpdate.HasValue) { fixCurrentCalendarItemInEditMode(calendarItemInEditModeBeforeUpdate.Value); } lock (updateLock) { if (nextUpdate != null) { var updateTarget = nextUpdate; nextUpdate = null; processUpdate(updateTarget, nextUpdateHasTwoColumns); } else { isUpdateRunning = false; } } }