protected override void UpdateView() { var projectColor = Color.ParseColor(Suggestion.ProjectColor); projectLabel.Text = Suggestion.ProjectName; projectLabel.SetTextColor(projectColor); clientNameLabel.Text = Suggestion.ClientName ?? ""; clientNameLabel.Visibility = string.IsNullOrEmpty(Suggestion.ClientName) ? ViewStates.Gone : ViewStates.Visible; taskCountLabel.Text = Suggestion.FormattedNumberOfTasks(); var caretAngle = Suggestion.TasksVisible ? 180.0f : 0.0f; caret.Visibility = Suggestion.HasTasks.ToVisibility(); caret.Animate().SetDuration(1).Rotation(caretAngle); toggleTasksButton.Visibility = Suggestion.HasTasks.ToVisibility(); if (selectedProjectToken == null) { return; } selectedProjectToken.Visibility = Suggestion.Selected.ToVisibility(useGone: false); if (Suggestion.Selected && selectedProjectToken.Background is GradientDrawable drawable) { var opacity = (int)Math.Round(2.55 * 12); var argb = ColorUtils.SetAlphaComponent(projectColor.ToArgb(), opacity); drawable.SetColor(argb); drawable.InvalidateSelf(); } }