コード例 #1
0
 void SetupTextAttributes()
 {
     NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes {
         Font            = UIFont.PreferredHeadline,
         ForegroundColor = AppColors.ColorFrom(ListColor.Gray)
     };
 }
コード例 #2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            SetupTextAttributes();

            NavigationController.NavigationBar.TintColor = AppColors.ColorFrom(ListColor.Gray);
            NavigationController.Toolbar.TintColor       = AppColors.ColorFrom(ListColor.Gray);
            TableView.TintColor = AppColors.ColorFrom(ListColor.Gray);
        }
コード例 #3
0
        public void OnListColorCellDidChangeSelectedColor(ListColor color)
        {
            List.Color = color;

            TextAttributes = new UIStringAttributes {
                Font            = UIFont.PreferredHeadline,
                ForegroundColor = AppColors.ColorFrom(List.Color)
            };

            NSIndexPath[] indexPaths = TableView.IndexPathsForVisibleRows;
            TableView.ReloadRows(indexPaths, UITableViewRowAnimation.None);
        }
コード例 #4
0
        async void Configure(ListCell cell, ListInfo listInfo)
        {
            // Show an empty string as the text since it may need to load.
            cell.Label.Text = string.Empty;
            cell.Label.Font = UIFont.PreferredBody;
            cell.ListColorView.BackgroundColor = UIColor.Clear;
            cell.BackgroundColor = UIColor.Cyan;

            await listInfo.FetchInfoAsync();

            cell.Label.Text = listInfo.Name;
            cell.ListColorView.BackgroundColor = AppColors.ColorFrom(listInfo.Color.Value);
        }
コード例 #5
0
        void ConfigureListItemCell(CheckBoxCell itemCell, ListColor color, ListItem item)
        {
            itemCell.CheckBox.TintColor = AppColors.ColorFrom(color);
            itemCell.CheckBox.Checked   = item.IsComplete;
            itemCell.Label.Text         = item.Text;

            itemCell.Label.TextColor = UIColor.White;

            // Configure a completed list item cell.
            if (item.IsComplete)
            {
                itemCell.Label.TextColor = UIColor.LightGray;
            }
        }
コード例 #6
0
        public void UpdateDocumentColor(NSUrl documentUrl, ListColor newColor)
        {
            ListInfo listInfo = new ListInfo(documentUrl);

            int index = listInfos.IndexOf(listInfo);

            if (index != -1)
            {
                listInfo       = listInfos[index];
                listInfo.Color = newColor;

                NSIndexPath indexPath = NSIndexPath.FromRowSection(index, 0);
                ListCell    cell      = (ListCell)TableView.CellAt(indexPath);
                cell.ListColorView.BackgroundColor = AppColors.ColorFrom(newColor);
            }
        }
コード例 #7
0
        public void PickColor(UIButton sender)
        {
            // Use the button's tag to determine the color.
            selectedColor = (ListColor)(int)sender.Tag;

            // Clear out the previously selected button's border.
            if (selectedButton != null)
            {
                selectedButton.Layer.BorderWidth = 0;
            }

            sender.Layer.BorderWidth = 5f;
            sender.Layer.BorderColor = UIColor.LightGray.CGColor;
            selectedButton           = sender;

            TitleLabel.TextColor = AppColors.ColorFrom(selectedColor);
            Toolbar.TintColor    = AppColors.ColorFrom(selectedColor);
        }
コード例 #8
0
        public async void ConfigureWith(ListInfo listInfo)
        {
            await listInfo.FetchInfoAsync();

            if (document != null)
            {
                document.DocumentDeleted -= OnListDocumentWasDeleted;
                document.Close(null);
            }

            document = new ListDocument(listInfo.Url);
            document.DocumentDeleted += OnListDocumentWasDeleted;

            NavigationItem.Title = listInfo.Name;

            TextAttributes = new UIStringAttributes {
                Font            = UIFont.PreferredHeadline,
                ForegroundColor = AppColors.ColorFrom(listInfo.Color.Value)
            };
        }