Beispiel #1
0
            public void UpdatesAccordingly()
            {
                List <int> list       = new List <int>();
                var        collection = new ObservableGroupedOrderedCollection <int>(i => i, i => i, i => i.ToString().Length);

                collection.ReplaceWith(list);

                var scheduler = new TestScheduler();
                var observer  = scheduler.CreateObserver <bool>();

                collection.Empty.Subscribe(observer);

                collection.InsertItem(20);
                collection.InsertItem(2);
                collection.RemoveItemAt(0, 0);
                collection.RemoveItemAt(0, 0);

                observer.Messages.AssertEqual(
                    OnNext(0, true),
                    OnNext(0, false),
                    OnNext(0, true)
                    );
            }
Beispiel #2
0
            public void SendsEventWhenReplaced()
            {
                List <int> list = new List <int> {
                    40, 70, 8, 3, 1, 2
                };
                var collection = new ObservableGroupedOrderedCollection <int>(i => i, i => i, i => i.ToString().Length);

                collection.ReplaceWith(list);

                var scheduler = new TestScheduler();
                var observer  = scheduler.CreateObserver <ICollectionChange>();

                collection.CollectionChange.Subscribe(observer);

                int[] newItems = { 0, 10, 100, 1000 };
                collection.ReplaceWith(newItems);

                ICollectionChange change = new ReloadCollectionChange();

                observer.Messages.AssertEqual(
                    OnNext(0, change)
                    );
            }
Beispiel #3
0
        public TimeEntriesLogViewSource(
            ObservableGroupedOrderedCollection <TimeEntryViewModel> collection,
            string cellIdentifier,
            ITimeService timeService,
            ISchedulerProvider schedulerProvider)
            : base(collection, cellIdentifier)
        {
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider));

            this.timeService       = timeService;
            this.schedulerProvider = schedulerProvider;

            if (!UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                deleteTableViewRowAction = UITableViewRowAction.Create(
                    UITableViewRowActionStyle.Destructive,
                    Resources.Delete,
                    handleDeleteTableViewRowAction);
                deleteTableViewRowAction.BackgroundColor = Foundation.MvvmCross.Helper.Color.TimeEntriesLog.DeleteSwipeActionBackground.ToNativeColor();
            }

            FirstCell = firstCellSubject.AsDriver(schedulerProvider);
        }
 public ReactiveSectionedRecyclerAdapter(ObservableGroupedOrderedCollection <TModel> items)
 {
     this.items = items;
     updateSectionIndexes();
 }
        public ReactiveSectionedListTableViewSource(ObservableGroupedOrderedCollection <TModel> collection, string cellIdentifier) : base(collection, cellIdentifier)
        {
            CollectionChange = collection.CollectionChange;

            OnItemTapped = ItemTapped;
        }
Beispiel #6
0
 public ReactiveSectionedRecyclerAdapter(ObservableGroupedOrderedCollection <TModel> items)
 {
     this.items   = items;
     currentItems = flattenItems(this.items);
 }
Beispiel #7
0
 public MainRecyclerAdapter(ObservableGroupedOrderedCollection <TimeEntryViewModel> items) : base(items)
 {
 }