public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, UITableViewCell cellView, Message item) { var cell = cellView as ChatViewCell; cell.SelectionStyle = UITableViewCellSelectionStyle.None; bool isYours = String.IsNullOrWhiteSpace(item.Sender); bool isSending = item.SendDate == DateTime.MinValue; bool isSent = item.SendDate != DateTime.MinValue && item.SendDate != DateTime.MaxValue; bool isLost = item.SendDate == DateTime.MaxValue; if (!isYours && !_colors.ContainsKey(item.Sender)) { _colors.Add(item.Sender, _palette[_rnd.Next(_palette.Count)]); } var margins = cell.ContentView.LayoutMarginsGuide; cell.CalloutLayout.LeadingAnchor.ConstraintEqualTo(margins.LeadingAnchor, 4).Active = !isYours; cell.CalloutLayout.TrailingAnchor.ConstraintEqualTo(margins.TrailingAnchor, 4).Active = isYours; cell.SenderLabel.Text = String.Concat(isYours ? "YOU" : item.Sender.Split('@')[0], " "); cell.CalloutLayout.BackgroundColor = ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.PictonBlue : _colors[item.Sender]); cell.CalloutLayout.Alpha = isSent ? 1 : .35f; cell.MessageLabel.Text = String.Concat(item.Content, " "); cell.DateLabel.Text = isSent ? String.Format(" sent @ {0:G}", item.SendDate) : String.Empty; return(cell); }
public override void GetView(int postion, TournamentViewHolder holder, View view, Tournament item) { Color taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.AshGray); holder.TitleLabel.Text = item.Name; holder.TitleLabel.SetTextColor(taskColor); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff ResizeToShowKeyboard(); #endregion ((AppDelegate)UIApplication.SharedApplication.Delegate).PushNotificationReceived += Application_PushNotificationReceived; this.Title = "Chatty"; this.NavigationController.SetNavigationBarHidden(false, true); this.SendButton.TouchUpInside += SendButton_TouchUpInside; this.MessageText.Constraints.Single(x => x.GetIdentifier() == "Height").Constant = 30f; this.MessageText.Changed += MessageText_Changed; this.MessageList.RowHeight = UITableView.AutomaticDimension; this.MessageList.EstimatedRowHeight = 74; this.MessageList.SeparatorStyle = UITableViewCellSeparatorStyle.None; this.MessageList.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.Snow); this.MessageList.TableFooterView = new UIView(CoreGraphics.CGRect.Empty); this.MessageList.Source = _source; InitSound(); RefreshMessages(); WaitConnection(); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff this.HasBarButtonItems = true; #endregion this.Title = "Agenda"; this.NavigationController.SetNavigationBarHidden(false, true); _source = new AgendaViewSource(this, new TodoItem[0]) : this.TaskList.Source = _source; this.TaskList.RowHeight = UITableView.AutomaticDimension; this.TaskList.EstimatedRowHeight = 46; this.TaskList.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.White); this.TaskList.TableFooterView = new UIView(CoreGraphics.CGRect.Empty); this.TaskList.ItemSelected += TaskList_ItemSelected; this.TaskList.ItemLongPress += TaskList_ItemLongPress; this.TaskList.ItemCommand += TaskList_ItemCommand; RefreshTodoItems(); }
public override void ViewDidLoad() { base.ViewDidLoad(); #region Designer Stuff SetContentView(this.ContentLayout); UINavigationBar.Appearance.BarTintColor = ViewBuilder.ColorFromARGB(AppController.Colors.AndroidGreen); UINavigationBar.Appearance.TintColor = ViewBuilder.ColorFromARGB(AppController.Colors.White); UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = ViewBuilder.ColorFromARGB(AppController.Colors.White) }); #endregion this.LoadLayout.UserInteractionEnabled = true; this.LoadLayout.Hidden = true; bool isResuming = this.ContentController.ViewControllers.Length > 0; if (!isResuming) { this.ContentController.PushViewController(new LoginViewController(), false); _userRestored = this.Arguments.GetBoolean("UserRestored"); if (_userRestored) { var c = new GimmicksViewController(); this.ContentController.PushViewController(c, false); } } }
public override void GetView(int postion, ChatViewHolder holder, View view, Message item) { bool isYours = String.IsNullOrWhiteSpace(item.Sender); bool isSending = item.SendDate == DateTime.MinValue; bool isSent = item.SendDate != DateTime.MinValue && item.SendDate != DateTime.MaxValue; bool isLost = item.SendDate == DateTime.MaxValue; if (!isYours && !_colors.ContainsKey(item.Sender)) { _colors.Add(item.Sender, _palette[_rnd.Next(_palette.Count)]); } ((RelativeLayout)view).SetGravity(isYours ? GravityFlags.Right : GravityFlags.Left); holder.SenderLabel.Text = String.Concat(isYours ? "YOU" : item.Sender.Split('@')[0], " "); holder.CalloutLayout.Background.SetColorFilter( ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.PictonBlue : _colors[item.Sender]), PorterDuff.Mode.SrcIn); holder.CalloutLayout.Alpha = isSent ? 1 : .35f; holder.MessageLabel.Text = String.Concat(item.Content, " "); holder.DateLabel.Text = isSent ? String.Format(" sent @ {0:G}", item.SendDate) : String.Empty; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, UITableViewCell cellView, TodoItem item) { var cell = cellView as TaskViewCell; string checkImage = "image_check_selected"; UIColor taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.AshGray); if (!item.IsComplete) { checkImage = "image_check_empty_green"; DateTime dueDate = item.CreationDate.GetValueOrDefault().Date.AddDays(item.WillDoIn); int dueDays = (dueDate - DateTime.Now.Date).Days; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Green); if (dueDays < 2) { checkImage = "image_check_empty_red"; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Red); } else if (dueDays < 4) { checkImage = "image_check_empty_orange"; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Orange); } } cell.CheckButton.SetImage(UIImage.FromBundle(checkImage), UIControlState.Normal); cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TitleLabel.Text = item.Title; cell.TitleLabel.TextColor = taskColor; return(cell); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff this.HasBarButtonItems = true; #endregion this.Title = "All Gimmicks"; this.NavigationController.SetNavigationBarHidden(false, true); _source = new GimmickViewSource(this, new Gimmick[0]); this.GimmickList.Source = _source; this.GimmickList.RowHeight = UITableView.AutomaticDimension; this.GimmickList.EstimatedRowHeight = 88; this.GimmickList.SeparatorStyle = UITableViewCellSeparatorStyle.None; this.GimmickList.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); this.GimmickList.TableFooterView = new UIView(CoreGraphics.CGRect.Empty); this.GimmickList.ItemSelected += GimmickList_ItemSelected; RefreshGimmicks(); }
public override void GetView(int postion, ChatViewHolder holder, View view, Model.Message item) { bool isYours = _currentUser == item.Sender; bool isSending = item.PostDate == null; bool isSent = item.PostDate.GetValueOrDefault() != DateTime.MinValue; if (!isYours && !_colors.ContainsKey(item.Sender)) { _colors.Add(item.Sender, _palette[_rnd.Next(_palette.Count)]); } ((RelativeLayout)view).SetGravity(isYours ? GravityFlags.Right : GravityFlags.Left); holder.CalloutLayout.Background.SetColorFilter( ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.PapayaWhip : _colors[item.Sender]), PorterDuff.Mode.SrcIn); holder.CalloutLayout.Alpha = isSent ? 1 : .35f; holder.SenderLabel.Text = String.Concat(isYours ? "YOU" : item.Sender.Split('@')[0], " "); holder.SenderLabel.SetTextColor(ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White)); holder.MessageLabel.Text = String.Concat(item.Content, " "); holder.MessageLabel.SetTextColor(ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White)); holder.DateLabel.Text = isSent ? String.Format(" sent @ {0:G}", item.PostDate) : String.Empty; holder.DateLabel.SetTextColor(ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White)); }
public override void GetView(int postion, CardViewHolder holder, View view, Marker item) { string markerImage = "button_marker_empty"; if (item.IsUsed) { if (!item.IsChange) { if (item.IsConsumed) { markerImage = "button_marker_green"; } else if (item.IsPartial) { markerImage = "button_marker_yellow"; } } else { markerImage = "button_marker_gray"; } } if (!String.IsNullOrWhiteSpace(item.TransactionColor)) { view.SetBackgroundColor(ViewBuilder.ColorFromARGB(item.TransactionColor)); } holder.MarkerImage.SetImageResource(markerImage); holder.ValueLabel.Text = item.Value < AppController.Globals.MarkerValue ? item.Value.ToString().Substring(1) : ((int)(item.Value)).ToString(); holder.ValueLabel.Visibility = item.IsUsed ? ViewStates.Visible : ViewStates.Gone; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, UITableViewCell cellView, Model.Message item) { var cell = cellView as ChatViewCell; cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.ContentView.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); bool isYours = _currentUser == item.Sender; bool isSending = item.PostDate == null; bool isSent = item.PostDate.GetValueOrDefault() != DateTime.MinValue; if (!isYours && !_colors.ContainsKey(item.Sender)) { _colors.Add(item.Sender, _palette[_rnd.Next(_palette.Count)]); } var margins = cell.ContentView.LayoutMarginsGuide; cell.CalloutLayout.LeadingAnchor.ConstraintEqualTo(margins.LeadingAnchor, 0).Active = !isYours; cell.CalloutLayout.TrailingAnchor.ConstraintEqualTo(margins.TrailingAnchor, 0).Active = isYours; cell.CalloutLayout.BackgroundColor = ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.PapayaWhip : _colors[item.Sender]); cell.CalloutLayout.Alpha = isSent ? 1 : .35f; cell.SenderLabel.Text = String.Concat(isYours ? "YOU" : item.Sender.Split('@')[0], " "); cell.SenderLabel.TextColor = ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White); cell.MessageLabel.Text = String.Concat(item.Content, " "); cell.MessageLabel.TextColor = ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White); cell.DateLabel.Text = isSent ? String.Format(" sent @ {0:G}", item.PostDate) : String.Empty; cell.DateLabel.TextColor = ViewBuilder.ColorFromARGB(isYours ? AppController.Colors.Jet : AppController.Colors.White); return(cell); }
public override void GetView(int postion, ChatViewHolder holder, View view, TodoItem item) { string checkImage = "image_check_selected"; Color taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.AshGray); if (!item.IsComplete) { checkImage = "image_check_empty_green"; DateTime dueDate = item.CreationDate.GetValueOrDefault().Date.AddDays(item.WillDoIn); int dueDays = (dueDate - DateTime.Now.Date).Days; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Green); if (dueDays < 2) { checkImage = "image_check_empty_red"; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Red); } else if (dueDays < 4) { checkImage = "image_check_empty_orange"; taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Orange); } } holder.CheckButton.SetImageResource(checkImage); holder.TitleLabel.Text = item.Title; holder.TitleLabel.SetTextColor(taskColor); }
private void HilightFilterButton(int filter) { for (int i = 0; i < this.FilterButtons.Length; i++) { UIButton b = this.FilterButtons[i]; b.SetTitleColor(ViewBuilder.ColorFromARGB(i == filter ? AppController.Colors.Jet : AppController.Colors.White), UIControlState.Normal); b.BackgroundColor = ViewBuilder.ColorFromARGB(i == filter ? AppController.Colors.White : AppController.Colors.Jet); } }
private void HilightFilterButton(int filter) { for (int i = 0; i < this.FilterButtons.Length; i++) { Button b = this.FilterButtons[i]; b.SetTextColor(ViewBuilder.ColorFromARGB(i == filter ? AppController.Colors.Jet : AppController.Colors.White)); b.SetBackgroundColor(ViewBuilder.ColorFromARGB(i == filter ? AppController.Colors.White : AppController.Colors.Jet)); } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff ResizeToShowKeyboard(); this.HasBarButtonItems = true; #endregion this.Title = "Chat"; this.NavigationController.SetNavigationBarHidden(false, true); this.HeaderLayout.UserInteractionEnabled = true; this.HeaderLayout.AddGestureRecognizer(new UITapGestureRecognizer( () => { var c = new IssueViewController(); c.Arguments = new UIBundle(); c.Arguments.PutInt("GimmickId", _gimmickId); c.Arguments.PutObject <Issue>("Issue", _issue); this.NavigationController.PushViewController(c, true); })); this.MessageList.Source = _source; this.MessageList.RowHeight = UITableView.AutomaticDimension; this.MessageList.EstimatedRowHeight = 74; this.MessageList.SeparatorStyle = UITableViewCellSeparatorStyle.None; this.MessageList.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); this.MessageList.TableFooterView = new UIView(CoreGraphics.CGRect.Empty); this.SendButton.TouchUpInside += SendButton_TouchUpInside; this.MessageText.Constraints.Single(x => x.GetIdentifier() == "Height").Constant = 30f; this.MessageText.Changed += MessageText_Changed; if (_issue != null) { LoadIssue(); } RefreshMessages(); }
public override void GetView(int postion, MatchViewHolder holder, View view, Match item) { //string checkImage = "image_check_selected"; Color taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.AshGray); //if (!item.IsComplete) //{ // checkImage = "image_check_empty_green"; // DateTime dueDate = item.CreationDate.GetValueOrDefault().Date.AddDays(item.WillDoIn); // int dueDays = (dueDate - DateTime.Now.Date).Days; // taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Green); // if (dueDays < 2) // { // checkImage = "image_check_empty_red"; // taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Red); // } // else if (dueDays < 4) // { // checkImage = "image_check_empty_orange"; // taskColor = ViewBuilder.ColorFromARGB(AppController.Colors.Orange); // } //} //holder.CheckButton.SetImageResource(checkImage); string weburl = "http://web-ghosts.azurewebsites.net/content/teams/"; holder.HomeLabel.Text = item.HomeTeam.DisplayName; holder.HomeScoreLabel.Text = item.HomeTeamScore.ToString(); holder.AwayLabel.Text = item.AwayTeam.DisplayName; holder.AwayScoreLabel.Text = item.AwayTeamScore.ToString(); holder.DateLabel.Text = item.MatchDate.ToString(); //AdMaiora.AppKit.Utils.ImageLoader loader = new AdMaiora.AppKit.Utils.ImageLoader(new AdMaiora.AppKit.Utils.ImageLoaderPlatofrmAndroid(), 10); //Uri uri = new Uri(weburl + item.HomeTeam.Club.Icon); //loader.SetImageForView(uri, "@drawable/icon.png", holder.HomeImage, null, 0, true, (message) => //{ // string done = ""; //}); //loader.SetImageForView(new Uri(weburl + item.AwayTeam.Club.Icon), "", holder.AwayImage); var imageBitmap = GetImageBitmapFromUrl(weburl + item.HomeTeam.Club.Icon); holder.HomeImage.SetImageBitmap(imageBitmap); imageBitmap = GetImageBitmapFromUrl(weburl + item.AwayTeam.Club.Icon); holder.AwayImage.SetImageBitmap(imageBitmap); //holder.TitleLabel.SetTextColor(taskColor); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, UITableViewCell cellView, Gimmick item) { var cell = cellView as GimmickViewCell; cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.ContentView.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); cell.CalloutLayout.Layer.BorderColor = ViewBuilder.ColorFromARGB(AppController.Colors.AndroidGreen).CGColor; cell.ContentLayout.BackgroundColor = UIColor.White; AppController.Images.SetImageForView( new Uri(item.ImageUrl), "image_gear", cell.ThumbImage); cell.NameLabel.Text = item.Name; cell.OwnerLabel.Text = item.Owner; return(cell); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff this.TitleText.SetPlaceholderColor(ViewBuilder.ColorFromARGB("FFd1d1d1")); AutoShouldReturnTextFields(new[] { this.TitleText }); SlideUpToShowKeyboard(); this.HasBarButtonItems = true; #endregion this.Title = _currentIssueType.ToString(); this.TypeImage.UserInteractionEnabled = _issue == null; this.TypeImage.AddGestureRecognizer(new UITapGestureRecognizer( () => { _currentIssueType++; if ((int)_currentIssueType == 4) { _currentIssueType = IssueType.Crash; } this.Title = _currentIssueType.ToString(); this.TapToChangeTypeLabel.Hidden = true; SetIssueTypeImage(_currentIssueType); })); this.EditButton.TouchUpInside += EditButton_TouchUpInside; SetIssueTypeImage(_currentIssueType); if (_issue != null) { LoadIssue(); } }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); #region Designer Stuff this.FilterButtons = new[] { this.FilterOpenedButton, this.FilterWorkingButton, this.FilterClosedButton }; this.HasBarButtonItems = true; #endregion this.Title = "Issues"; this.FilterOpenedButton.TouchUpInside += FilterOpenedButton_TouchUpInside; this.FilterWorkingButton.TouchUpInside += FilterOpenedButton_TouchUpInside; this.FilterClosedButton.TouchUpInside += FilterOpenedButton_TouchUpInside; _source = new IssueViewSource(this, new Issue[0]); this.IssueList.Source = _source; this.IssueList.RowHeight = UITableView.AutomaticDimension; this.IssueList.EstimatedRowHeight = 130; this.IssueList.SeparatorStyle = UITableViewCellSeparatorStyle.None; this.IssueList.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); this.IssueList.TableFooterView = new UIView(CoreGraphics.CGRect.Empty); this.IssueList.ItemSelected += IssueList_ItemSelected; if (_addNew) { _addNew = false; var c = new IssueViewController(); c.Arguments = new UIBundle(); c.Arguments.PutInt("GimmickId", _gimmickId); this.NavigationController.PushViewController(c, true); } else { RefreshIssues(_filter); } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, UITableViewCell cellView, Issue item) { var cell = cellView as IssueViewCell; cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.ContentView.BackgroundColor = ViewBuilder.ColorFromARGB(AppController.Colors.DarkLiver); cell.CalloutLayout.Layer.BorderColor = ViewBuilder.ColorFromARGB(AppController.Colors.AndroidGreen).CGColor; string[] typeImages = new[] { "image_gear", "image_issue_crash", "image_issue_blocking", "image_issue_nblocking" }; cell.TypeImage.Image = UIImage.FromBundle(typeImages[(int)item.Type]); cell.CodeLabel.Text = String.Format("code: #{0}", item.Code); cell.TitleLabel.Text = item.Title; cell.SenderLabel.Text = item.Sender.Split('@')[0]; cell.DescriptionLabel.Text = item.Description; cell.CreatedDateLabel.Text = item.CreationDate?.ToString("d"); cell.StatusDescriptionLabel.Text = item.Status.ToString(); return(cell); }
private void SetWillDoInDays(int willDoIn) { _willDoIn = willDoIn; if (_willDoIn < 0) { _willDoIn = 5; } UIColor color = ViewBuilder.ColorFromARGB(AppController.Colors.Green); if (_willDoIn < 2) { color = ViewBuilder.ColorFromARGB(AppController.Colors.Red); } else if (_willDoIn < 4) { color = ViewBuilder.ColorFromARGB(AppController.Colors.Orange); } this.DaysButton.SetTitle(_willDoIn.ToString(), UIControlState.Normal); this.DaysButton.SetTitleColor(color, UIControlState.Normal); }
private void SetWillDoInDays(int willDoIn) { _willDoIn = willDoIn; if (_willDoIn < 0) { _willDoIn = 5; } Color color = ViewBuilder.ColorFromARGB(AppController.Colors.Green); if (_willDoIn < 2) { color = ViewBuilder.ColorFromARGB(AppController.Colors.Red); } else if (_willDoIn < 4) { color = ViewBuilder.ColorFromARGB(AppController.Colors.Orange); } this.DaysButton.Text = _willDoIn.ToString(); this.DaysButton.SetTextColor(color); }
private void LoadStatistics(Dictionary <string, int> stats) { int opened = stats["Opened"]; this.OpenedNumberLabel.Text = opened.ToString(); this.OpenedNumberLabel.TextColor = ViewBuilder.ColorFromARGB(opened > 0 ? AppController.Colors.AndroidGreen : AppController.Colors.DarkLiver); this.ViewOpenedButton.Enabled = opened > 0; this.ViewOpenedButton.SetTextUnderline(opened > 0); int working = stats["Working"]; this.WorkingNumberLabel.Text = working.ToString(); this.WorkingNumberLabel.TextColor = ViewBuilder.ColorFromARGB(working > 0 ? AppController.Colors.AndroidGreen : AppController.Colors.DarkLiver); this.ViewWorkingButton.Enabled = working > 0; this.ViewWorkingButton.SetTextUnderline(working > 0); int closed = stats["Closed"]; this.ClosedNumberLabel.Text = closed.ToString(); this.ClosedNumberLabel.TextColor = ViewBuilder.ColorFromARGB(closed > 0 ? AppController.Colors.AndroidGreen : AppController.Colors.DarkLiver); this.ViewClosedButton.Enabled = closed > 0; this.ViewClosedButton.SetTextUnderline(closed > 0); }
public override void GetView(int postion, StoryViewHolder holder, View view, Transaction item) { holder.MarkerColorView.SetBackgroundColor(ViewBuilder.ColorFromARGB(item.MarkerColor)); holder.TransactionValueLabel.Text = String.Format("Totale speso: {0:0.00} pts", item.Value); holder.TransactionDetailsLabel.Text = String.Format("consumeazione fatta @ {0:g}", item.ConsumptionDate); }