Example #1
0
        public void NotifyBoundingBoxColourDidChange(CGColor previousColour, CGColor changedColour, string category)
        {
            if (previousColour != null)
            {
                RemovePreviousColour(ColoursInUse, previousColour);
            }

            if (ColoursInUse.Contains(changedColour))
            {
                FilteredItems.FirstOrDefault(x => x.Label.Equals(category)).Color = changedColour.ToSKColor();
                ParentResultsViewController.NotifyColourDuplicated(changedColour);
            }
            else
            {
                ColoursInUse.Add(changedColour);
            }
        }
Example #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            if (tableView == null || indexPath == null)
            {
                throw new ArgumentNullException();
            }
            var cell = new UITableViewCell(UITableViewCellStyle.Default, (NSString)Constants.FilterCellIdentifier);

            var categoryString = _indexedTableItems.ElementAt(indexPath.Section).Value.ElementAt(indexPath.Row);
            var classCategory  = FilteredItems.FirstOrDefault(category => category.Label.Equals(categoryString));

            if (classCategory != null)
            {
                ConfigureCell(cell, classCategory);
            }
            else
            {
                TableView.ReloadRows(new[] { indexPath }, UITableViewRowAnimation.Fade);
            }

            return(cell);
        }
        protected override async Task buildViewModelPosts(IEnumerable <IPost> posts)
        {
            clear(UnfilteredItems);
            clear(FilteredItems);

            Debug.WriteLine($"--- HISTORY BUILD POSTS. THREAD {Thread.CurrentThread.ManagedThreadId}");

            var vms      = new List <HistoryPostViewModel>();
            var freshVms = await _postBuilder.BuildAsync(posts);

            vms.AddRange(freshVms.Cast <HistoryPostViewModel>());

            UnfilteredItems.Clear();
            UnfilteredItems.AddRange(vms);
            filterOut(vms);

            var lastPost = FilteredItems.FirstOrDefault() as HistoryPostViewModel;

            if (lastPost != null)
            {
                _settings.Hidden.SetLastSeenFor(_pullersController.SharedWallHolder.ID, lastPost.Post.Date);
            }
        }