Beispiel #1
0
 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);
 }
Beispiel #3
0
 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);
 }
Beispiel #6
0
        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);
            }
        }
Beispiel #10
0
 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);
         }
     });
 }
Beispiel #11
0
        private void dispatchUpdates(IReadOnlyList <FlatItemInfo> newImmutableItems, DiffUtil.DiffResult diffResult)
        {
            currentItems = newImmutableItems;
            diffResult.DispatchUpdatesTo(this);

            lock (collectionUpdateLock)
            {
                if (hasPendingUpdate)
                {
                    hasPendingUpdate = false;
                    startCurrentCollectionUpdate();
                }
                else
                {
                    isUpdateRunning = false;
                }
            }
        }
Beispiel #12
0
        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);
            }
        }
Beispiel #14
0
        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;
                }
            }
        }