/// <summary> /// Draws the publication cover view. /// </summary> private void DrawPublicationCoverView() { BackgroundColor = ColorUtil.ConvertFromHexColorCode(PrimaryColor); Frame = new CGRect(0, 0, ViewConstant.PUBLICATION_COVER_WIDTH * ZoomRate, ViewConstant.PUBLICATION_COVER_HEIGHT * ZoomRate); UserInteractionEnabled = true; }
public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (TagColorCollectionViewCell)collectionView.CellForItem(indexPath); // defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var cell = (TagColorCollectionViewCell)collectionView.CellForItem(indexPath); if (ColorTag != null) { defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); SelectedColorCode = optionTagColorList [indexPath.Row].ColorValue; ColorTag.Color = SelectedColorCode; collectionView.ReloadData(); } else if (firstDefaultSelectColor == "#FF00FF") { defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); SelectedColorCode = optionTagColorList [indexPath.Row].ColorValue; firstDefaultSelectColor = SelectedColorCode; collectionView.ReloadData(); } else if (firstDefaultSelectColor != "#FF00FF") { defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); SelectedColorCode = optionTagColorList [indexPath.Row].ColorValue; firstDefaultSelectColor = SelectedColorCode; collectionView.ReloadData(); } else { defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); SelectedColorCode = optionTagColorList [indexPath.Row].ColorValue; cell.SetOptionColorView(new TripleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { CustomizedPopoverHisoryTableViewCell cell = tableView.DequeueReusableCell(CustomizedPopoverHisoryTableViewCell.Key) as CustomizedPopoverHisoryTableViewCell; if (cell == null) { cell = CustomizedPopoverHisoryTableViewCell.Create(); } RecentHistoryItem item = HistoryList [indexPath.Row]; cell.TitleLabel.Text = item.PublicationTitle; cell.GuideCardNameLabel.Text = item.TOCTitle; cell.TimeLabel.Text = ((DateTime)item.LastReadDate).ToString("hh:mm t\\M, dd MMM yyyy"); if (cell.TitleLabel.Constraints.Length > 0) { CGSize expectedTitleLabelSize = TextDisplayUtil.GetStringBoundRect(item.PublicationTitle, UIFont.BoldSystemFontOfSize(14), new CGSize(295, 600)); for (int i = 0; i < cell.TitleLabel.Constraints.Length; i++) { if (cell.TitleLabel.Constraints [i].FirstAttribute == NSLayoutAttribute.Height && expectedTitleLabelSize.Height > 20) { cell.TitleLabel.Constraints [i].Constant = expectedTitleLabelSize.Height; } } } cell.CellColorHintView.BackgroundColor = ColorUtil.ConvertFromHexColorCode(item.ColorPrimary); return(cell); }
public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath) { var cell = collectionView.DequeueReusableCell(TagColorCollectionViewCell.Key, indexPath) as TagColorCollectionViewCell; defaultColor = ColorUtil.ConvertFromHexColorCode(optionTagColorList [indexPath.Row].ColorValue); if (ColorTag != null) { UIColor selectedColor = ColorUtil.ConvertFromHexColorCode(ColorTag.Color); nfloat selectedRed, selectedGreen, selectedBlue, selectedAlpha; selectedColor.GetRGBA(out selectedRed, out selectedGreen, out selectedBlue, out selectedAlpha); nfloat curRed, curGreen, curBlue, curAlpha; defaultColor.GetRGBA(out curRed, out curGreen, out curBlue, out curAlpha); if (selectedRed == curRed && selectedGreen == curGreen && selectedBlue == curBlue && selectedAlpha == curAlpha) { cell.SetOptionColorView(new TripleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } else { cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } } else if (firstDefaultSelectColor != null) { if (indexPath.Row == 0 && firstDefaultSelectColor == "#FF00FF") { cell.SetOptionColorView(new TripleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } else if (firstDefaultSelectColor != "#FF00FF") { UIColor selectedColor = ColorUtil.ConvertFromHexColorCode(firstDefaultSelectColor); nfloat selectedRed, selectedGreen, selectedBlue, selectedAlpha; selectedColor.GetRGBA(out selectedRed, out selectedGreen, out selectedBlue, out selectedAlpha); nfloat curRed, curGreen, curBlue, curAlpha; defaultColor.GetRGBA(out curRed, out curGreen, out curBlue, out curAlpha); if (selectedRed == curRed && selectedGreen == curGreen && selectedBlue == curBlue && selectedAlpha == curAlpha) { cell.SetOptionColorView(new TripleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } else { cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } } else { cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } } else { cell.SetOptionColorView(new DoubleCircleView(ViewConstant.TAG_INNER_CIRCLE_RADIUS, ViewConstant.TAG_OUTER_CIRCLE_RADIUS, defaultColor, UIColor.White, 0, 0)); } return(cell); }
public override void ViewDidLoad() { base.ViewDidLoad(); lineColor = ColorUtil.ConvertFromHexColorCode("#CAD2D3"); bgColor = ColorUtil.ConvertFromHexColorCode("#F1F1F4"); CollectionView.RegisterClassForCell(typeof(GotoCollectionViewCell), GotoCollectionViewCell.Key); CollectionView.BackgroundColor = UIColor.White; CollectionView.RegisterClassForSupplementaryView(typeof(GotoCollectionReusableView), UICollectionElementKindSection.Header, "HeaderView"); }
public override void ViewDidLoad() { base.ViewDidLoad(); UIColor lineColor = ColorUtil.ConvertFromHexColorCode("#E1E3E0"); lineView.BackgroundColor = lineColor; line2View.BackgroundColor = lineColor; UIColor backGroundColor = ColorUtil.ConvertFromHexColorCode("#F1F1F4"); this.View.BackgroundColor = backGroundColor; }
public GotoCollectionViewCell(CGRect frame) : base(frame) { UIColor lineColor = ColorUtil.ConvertFromHexColorCode("#C3C4C2"); ContentView.Layer.BorderColor = lineColor.CGColor; ContentView.Layer.BorderWidth = 0.5f; ContentView.SetNeedsDisplay(); titleLabe.Frame = new CGRect(0, 0, 106, 44); titleLabe.Font = UIFont.SystemFontOfSize(24); titleLabe.TextAlignment = UITextAlignment.Center; this.AddSubview(titleLabe); }
public TagColorCollectionViewCell(CGRect frame) : base(frame) { UIColor lineColor = ColorUtil.ConvertFromHexColorCode("#E1E3E0"); ContentView.Layer.BorderColor = lineColor.CGColor; ContentView.Layer.BorderWidth = 0.5f; ContentView.SetNeedsDisplay(); OptionalColorViewContainer = new UIView(new CGRect(0, 0, ViewConstant.TAG_OUTER_CIRCLE_RADIUS * 2, ViewConstant.TAG_OUTER_CIRCLE_RADIUS * 2)); OptionalColorViewContainer.BackgroundColor = UIColor.Clear; OptionalColorViewContainer.Center = ContentView.Center; ContentView.AddSubview(OptionalColorViewContainer); }
/// <summary> /// Display loan information on publication cover /// </summary> public void DrawLoanInfo() { if (LoanInfoStr != null) { LoanTagLabel = new UILabel(new CGRect(ViewConstant.PUBLICATION_TITLE_LABEL_X * ZoomRate, 200 * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate, 50 * ZoomRate)); LoanTagLabel.Text = LoanInfoStr; LoanTagLabel.TextAlignment = UITextAlignment.Center; LoanTagLabel.TextColor = ColorUtil.ConvertFromHexColorCode(FontColor); LoanTagLabel.Font = UIFont.FromName("AppleGaramond-Bold", 17 * ZoomRate); LoanTagLabel.Lines = new nint(2); AddSubview(LoanTagLabel); } }
public override UIView GetViewForHeader(UITableView tableView, nint section) { UIView bgView = new UIView(); bgView.BackgroundColor = ColorUtil.ConvertFromHexColorCode("#CBCCCD"); UILabel seactionText = new UILabel(); seactionText.Frame = new CGRect(20, 5, 280, 20); seactionText.Font = UIFont.SystemFontOfSize(17); seactionText.TextColor = UIColor.Black; seactionText.Text = SectionTitleArr [(int)section]; bgView.AddSubview(seactionText); return(bgView); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { CustomizeTagTableViewCell cell = tableView.DequeueReusableCell(CustomizeTagTableViewCell.Key) as CustomizeTagTableViewCell; if (cell == null) { cell = CustomizeTagTableViewCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; if (indexPath.Row == 0) { cell.TagNameLabel.Text = "All Tags"; cell.ContentView.AddSubview(new AllTagView(12, 10, 16)); bool isAllSelected = isNoTagSelected; if (isAllSelected) { foreach (var tag in tagList) { if (!tag.IsSelected) { isAllSelected = false; break; } } } cell.Accessory = isAllSelected ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } else if (indexPath.Row == 1) { cell.ContentView.Add(new DoubleCircleView(4, 5, UIColor.White, ColorUtil.ConvertFromHexColorCode("#808080"), 16, 17)); cell.TagNameLabel.Text = "No tag"; cell.Accessory = isNoTagSelected ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } else { Tag tag = tagList [indexPath.Row - 2]; cell.ContentView.Add(new DoubleCircleView(5, 6, ColorUtil.ConvertFromHexColorCode(tag.AnnoTag.Color), UIColor.White, 15, 16)); cell.TagNameLabel.Text = tag.AnnoTag.Title; cell.Accessory = tag.IsSelected? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } return(cell); }
public TagsButton() { this.BackgroundColor = UIColor.White; ColorView.Frame = new CGRect(0, 10, 10, 10); ColorView.Layer.BorderColor = UIColor.Clear.CGColor; ColorView.Layer.BorderWidth = 1; ColorView.Layer.CornerRadius = 10 / 2; ColorView.ClipsToBounds = true; this.AddSubview(ColorView); //((TagHeight-96)*4) (tableView.Frame.Size.Width/5) ColorLabel.Frame = new CGRect(15, 5, 58, 20); ColorLabel.Font = UIFont.SystemFontOfSize(14); ColorLabel.BackgroundColor = UIColor.Clear; ColorLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#cccccc"); ColorLabel.TextAlignment = UITextAlignment.Left; this.AddSubview(ColorLabel); }
public override UIView GetViewForHeader(UITableView tableView, nint section) { UIView bgView = new UIView(); bgView.Frame = new CoreGraphics.CGRect(0, 0, 320, 44); bgView.BackgroundColor = UIColor.White; bgView.AddSubview(titleLabel); UIView line = new UIView(new CGRect(0, 43, 320, 1)); line.BackgroundColor = ColorUtil.ConvertFromHexColorCode("#C3C4C2"); bgView.AddSubview(line); bgView.UserInteractionEnabled = false; return(bgView); }
private void initView() { leftEditButton = new UIButton(new CoreGraphics.CGRect(16, 0, 80, 44)); leftEditButton.TitleLabel.Font = UIFont.SystemFontOfSize(17); leftEditButton.SetTitle("Assign to:", UIControlState.Normal); leftEditButton.SetTitleColor(UIColor.LightGray, UIControlState.Normal); rightAddButton = new UIButton(new CoreGraphics.CGRect(260, 0, 60, 44)); rightAddButton.TitleLabel.Font = UIFont.SystemFontOfSize(17); rightAddButton.SetTitle("Edit", UIControlState.Normal); rightAddButton.SetTitleColor(UIColor.Red, UIControlState.Normal); rightAddButton.TouchUpInside += RightAddButton_TouchUpInside; line = new UIView(); line.Frame = new CoreGraphics.CGRect(0, 43, 320, 1); line.BackgroundColor = ColorUtil.ConvertFromHexColorCode("#C3C4C2"); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(NoteTextTagViewCell.Key) as NoteTextTagViewCell; if (cell == null) { cell = NoteTextTagViewCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; Tag tag = tagList[indexPath.Row]; cell.ContentView.Add(new DoubleCircleView(5, 6, ColorUtil.ConvertFromHexColorCode(tag.AnnoTag.Color), UIColor.White, 15, 16)); cell.TagNameLabel.Text = tag.AnnoTag.Title; cell.TintColor = UIColor.Red; cell.Accessory = tag.IsSelected?UITableViewCellAccessory.None:UITableViewCellAccessory.Checkmark; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { RecentHistoryItem item = HistoryList [indexPath.Row]; CustomizedHistoryTableViewCell cell = tableView.DequeueReusableCell(CustomizedHistoryTableViewCell.Key) as CustomizedHistoryTableViewCell; if (cell == null) { cell = CustomizedHistoryTableViewCell.Create(); } cell.TitleLabel.Text = item.PublicationTitle; cell.TitleLabel.LineBreakMode = UILineBreakMode.MiddleTruncation; cell.GuideCardNameLabel.Text = item.TOCTitle; cell.TimeLabel.Text = ((DateTime)item.LastReadDate).ToString("hh:mm t\\M, dd MMM yyyy"); cell.CellColorHintView.BackgroundColor = ColorUtil.ConvertFromHexColorCode(item.ColorPrimary); return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { CustomizeTagTableViewCell cell = tableView.DequeueReusableCell(CustomizeTagTableViewCell.Key) as CustomizeTagTableViewCell; if (cell == null) { cell = CustomizeTagTableViewCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; Tag tag = TagList[indexPath.Row]; cell.annotationTagId = tag.AnnoTag; cell.ContentView.Add(new DoubleCircleView(5, 6, ColorUtil.ConvertFromHexColorCode(tag.AnnoTag.Color), UIColor.White, 15, 16)); cell.TagNameLabel.Text = tag.AnnoTag.Title; return(cell); }
public override UIView GetViewForFooter(UITableView tableView, nint section) { UIView view = new UIView(new CoreGraphics.CGRect(0, 0, 320, 44)); UIView bottomLine = new UIView(new CoreGraphics.CGRect(0, 0, 320, 0.5)); bottomLine.BackgroundColor = UIColor.FromRGB(188, 186, 193); UILabel syncDateLabel = new UILabel(new CoreGraphics.CGRect(0, 10, 320, 20)); syncDateLabel.Text = "Latest server sync " + ((DateTime)SettingsUtil.Instance.GetLastSyncedTime()).ToString("hh:mm t\\M, dd MMM yyyy "); syncDateLabel.Font = UIFont.SystemFontOfSize(13); syncDateLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#6d6d72"); syncDateLabel.TextAlignment = UITextAlignment.Center; view.AddSubview(bottomLine); view.AddSubview(syncDateLabel); return(view); }
/// <summary> /// Initializes the publication title view. /// Publication title displayed in publication cover /// </summary> private void DrawPublicationTitleView() { TitleBackgroundView = new UIView(); TitleBackgroundView.Frame = new CGRect(ViewConstant.PUBLICATION_TITLE_LABEL_X * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_Y * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_HEIGHT * ZoomRate); TitleBackgroundView.BackgroundColor = ColorUtil.ConvertFromHexColorCode(SecondaryColor); TitleOuterLineView = new UIView(); TitleOuterLineView.Frame = new CGRect(0, 0, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_HEIGHT * ZoomRate); TitleOuterLineView.Layer.BorderWidth = 1.0f; TitleOuterLineView.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode(FontColor).CGColor; TitleBackgroundView.AddSubview(TitleOuterLineView); TitleInnerLineView = new UIView(); TitleInnerLineView.Frame = new CGRect(2, 2, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate - 4, ViewConstant.PUBLICATION_TITLE_LABEL_HEIGHT * ZoomRate - 4); TitleInnerLineView.Layer.BorderWidth = 3.0f; TitleInnerLineView.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode(FontColor).CGColor; TitleBackgroundView.AddSubview(TitleInnerLineView); TitleLabel = new UILabel(new CGRect(5, 5, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate - 10, ViewConstant.PUBLICATION_TITLE_LABEL_HEIGHT * ZoomRate - 10)); TitleLabel.TextAlignment = UITextAlignment.Center; TitleLabel.Text = Title; TitleLabel.TextColor = ColorUtil.ConvertFromHexColorCode(FontColor); TitleLabel.Lines = new nint(ViewConstant.PUBLICATION_TITLE_LABEL_LINES); TitleLabel.Font = UIFont.FromName("AppleGaramond-Bold", 17 * ZoomRate); TitleLabel.LineBreakMode = UILineBreakMode.MiddleTruncation; TitleBackgroundView.AddSubview(TitleLabel); AddSubview(TitleBackgroundView); FirstBottomLine = new UIView(); FirstBottomLine.Frame = new CGRect(15 * ZoomRate, 250 * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate, 2 * ZoomRate); FirstBottomLine.BackgroundColor = ColorUtil.ConvertFromHexColorCode(FontColor); AddSubview(FirstBottomLine); SecondBottomLine = new UIView(); SecondBottomLine.Frame = new CGRect(15 * ZoomRate, 253 * ZoomRate, ViewConstant.PUBLICATION_TITLE_LABEL_WIDTH * ZoomRate, 2 * ZoomRate); SecondBottomLine.BackgroundColor = ColorUtil.ConvertFromHexColorCode(FontColor); AddSubview(SecondBottomLine); }
public GotoTableViewControllerSource(UITableView tableview) { tableView = tableview; UIColor textColor = ColorUtil.ConvertFromHexColorCode("#ABAEAB"); NoResultLabel = new UILabel(new CGRect(55, 110, 210, 80)); NoResultLabel.Font = UIFont.SystemFontOfSize(14); NoResultLabel.Lines = 0; NoResultLabel.Text = "Use the number pad to go to \nthe page you're looking for."; NoResultLabel.TextAlignment = UITextAlignment.Center; NoResultLabel.TextColor = textColor; tableview.AddSubview(NoResultLabel); pageList = new List <PageSearchItem>(); NSNotificationCenter.DefaultCenter.AddObserver(new NSString("inputPageNumber"), ChangePageNumber); titleLabel.Frame = new CoreGraphics.CGRect(0, 0, 320, 42); titleLabel.TextAlignment = UITextAlignment.Center; titleLabel.Font = UIFont.BoldSystemFontOfSize(17); titleLabel.Text = "Page Not Found"; }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { PublicationAnnotationCell cell = tableView.DequeueReusableCell(PublicationAnnotationCell.Key) as PublicationAnnotationCell; if (cell == null) { cell = PublicationAnnotationCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; var annotation = AnnoListDict [SectionTitleArr [indexPath.Section]] [indexPath.Row]; UIColor TextColor = ColorUtil.ConvertFromHexColorCode("#959595"); DateTime date = annotation.UpdatedTime; cell.dateLabel.TextColor = TextColor; cell.dateLabel.Text = date.ToString("dd MMM yyyy"); cell.TocLabel.Text = annotation.TOCTitle; cell.TocLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#000000"); cell.conLabel.Text = annotation.HighlightText; cell.conLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#000000"); cell.imageIma.Image = new UIImage("Images/Setting/About.png"); cell.NoteLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#cccccc"); if (annotation.NoteText != "") { cell.NoteLabel.Text = annotation.NoteText; } else { cell.NoteLabel.Text = "Add a note..."; } nfloat TagHeight = (tableView.Frame.Size.Width - 60 * 4) / 5; getGuidList = annotation.CategoryTags; if (getGuidList.Count == 0) { UIView emptyBtn = new UIView(new CGRect(3, 5, 10, 10)); emptyBtn.BackgroundColor = UIColor.White; emptyBtn.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode("#cccccc").CGColor; emptyBtn.Layer.BorderWidth = 1; emptyBtn.Layer.CornerRadius = 10 / 2; UILabel emptyLabel = new UILabel(new CGRect(25, 0, 120, 18)); emptyLabel.Text = "Add a tag..."; emptyLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#cccccc"); emptyLabel.Font = UIFont.SystemFontOfSize(14); cell.bgView.AddSubview(emptyLabel); cell.bgView.AddSubview(emptyBtn); } else { for (int i = 0; i < getGuidList.Count; i++) { AnnotationTag tag = getGuidList [i]; UIColor defaultColor = ColorUtil.ConvertFromHexColorCode(tag.Color); TagsButton btn = new TagsButton(); btn.Frame = new CGRect((TagHeight + 60) * (i % 4) - 15 + TagHeight, (i / 4) * 25, 60, 30); btn.BackgroundColor = UIColor.White; btn.ColorView.BackgroundColor = defaultColor; btn.ColorLabel.Text = tag.Title; cell.bgView.AddSubview(btn); } } return(cell); }
public void Refresh() { switch (p.PublicationStatus) { case PublicationStatusEnum.Downloaded: StatusLabel.Text = "Up to date"; MoreStatusLabel.Text = "Currency Date " + ((DateTime)p.LastUpdatedDate).ToString("dd MMM yyyy"); break; case PublicationStatusEnum.NotDownloaded: StatusLabel.Text = "Download"; double mbSize = ((double)p.Size) / 1024 / 1024; string mbSizeStr = mbSize.ToString(); int count = mbSizeStr.LastIndexOf("."); MoreStatusLabel.Text = mbSizeStr.Substring(0, count + 3) + " MB"; break; case PublicationStatusEnum.RequireUpdate: StatusLabel.Text = p.UpdateCount + (p.UpdateCount > 1 ? " Updates avaiable" : " Update avaiable"); MoreStatusLabel.Text = "Currency Date " + ((DateTime)p.LastUpdatedDate).ToString("dd MMM yyyy"); break; } if (p.DaysRemaining < 0) { StatusLabel.Text = "Expired"; MoreStatusLabel.Text = "Currency Date " + ((DateTime)p.LastUpdatedDate).ToString("dd MMM yyyy"); } //TODO, the text of StatusLabel should be determined by publication status other than whether it is empty or not if (StatusLabel.Text == "") { StatusLabel.Text = "Download Failed"; } if (p.PublicationStatus == PublicationStatusEnum.NotDownloaded) { InfoButton.TintColor = UIColor.LightGray; } else { InfoButton.TintColor = UIColor.Red; } //If publication has not been downloaded or publication has update if (p.PublicationStatus == PublicationStatusEnum.NotDownloaded || p.PublicationStatus == PublicationStatusEnum.RequireUpdate) { RightTopView.TriangleBackgroundColor = UIColor.FromRGB(22, 132, 250); } //If publication expired if (p.DaysRemaining < 0) { RightTopView.TriangleBackgroundColor = UIColor.FromRGB(253, 59, 47); } if (p.PublicationStatus == PublicationStatusEnum.RequireUpdate) { RightTopView.ShowHintText("Update"); } if (p.DaysRemaining < 0) { RightTopView.ShowHintText("Expired"); RightTopView.AddGestureRecognizer(new UITapGestureRecognizer(delegate() { AppDataUtil.Instance.SetCurrentPublication(P); AppDisplayUtil.Instance.ShowPublicationInfoView(); })); } if (p.DaysRemaining >= 0 && (p.PublicationStatus == PublicationStatusEnum.NotDownloaded || p.PublicationStatus == PublicationStatusEnum.RequireUpdate)) { RightTopView.ShowDownloadActionView(p, StartDownload, ShowDownloadAlert); } if (p.DaysRemaining >= 0 && p.PublicationStatus == PublicationStatusEnum.Downloaded) { RightTopView.Hidden = true; RightTopView.RemoveFromSuperview(); } else { RightTopView.Hidden = false; AddSubview(RightTopView); } RightTopView.ZoomRate = ZoomRate; RightTopView.SetNeedsDisplay(); if (p.PublicationStatus == PublicationStatusEnum.NotDownloaded) { InfoButton.Enabled = false; } else { InfoButton.Enabled = true; } if (p.PublicationStatus == PublicationStatusEnum.NotDownloaded) { Cover.InvisibleOpenPublicationButton.Enabled = false; } else { Cover.InvisibleOpenPublicationButton.Enabled = true; } DownloadCancelTokenSource = new CancellationTokenSource(); //TODO, update publication cover if (p.IsLoan) { if (p.DaysRemaining == 0) { Cover.LoanTagLabel.Text = "Due to Expire"; } else { Cover.LoanTagLabel.Text = "LOAN" + Environment.NewLine + p.DaysRemaining + (p.DaysRemaining > 1 ? " days Remaining" : " day Remaining"); } } Cover.TitleLabel.Text = p.Name; Cover.BackgroundColor = ColorUtil.ConvertFromHexColorCode(p.ColorPrimary); Cover.TitleBackgroundView.BackgroundColor = ColorUtil.ConvertFromHexColorCode(p.ColorSecondary); Cover.TitleBackgroundView.SetNeedsDisplay(); Cover.TitleOuterLineView.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode(p.FontColor).CGColor; Cover.TitleOuterLineView.SetNeedsDisplay(); Cover.TitleInnerLineView.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode(p.FontColor).CGColor; Cover.TitleInnerLineView.SetNeedsDisplay(); Cover.TitleLabel.TextColor = ColorUtil.ConvertFromHexColorCode(p.FontColor); Cover.FirstBottomLine.BackgroundColor = ColorUtil.ConvertFromHexColorCode(p.FontColor); Cover.FirstBottomLine.SetNeedsDisplay(); Cover.SecondBottomLine.BackgroundColor = ColorUtil.ConvertFromHexColorCode(p.FontColor); Cover.SecondBottomLine.SetNeedsDisplay(); Cover.LoanTagLabel.TextColor = ColorUtil.ConvertFromHexColorCode(p.FontColor); Cover.SetNeedsDisplay(); }
public AllTagView(float height, float frameX, float frameY) : base(new CGRect(frameX, frameY, height * 2, height)) { float outerRadius = height / 2; float innerRadius = outerRadius - 1; DoubleCircleView greenCircle = new DoubleCircleView(innerRadius, outerRadius, UIColor.Green, UIColor.White, 0, 0); DoubleCircleView yellowCircle = new DoubleCircleView(innerRadius, outerRadius, ColorUtil.ConvertFromHexColorCode("#EEC900"), UIColor.White, outerRadius, 0); DoubleCircleView redCircle = new DoubleCircleView(innerRadius, outerRadius, UIColor.Red, UIColor.White, 2 * outerRadius, 0); AddSubview(redCircle); AddSubview(yellowCircle); AddSubview(greenCircle); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { CustomizedAnnotationTableViewCell cell = tableView.DequeueReusableCell(CustomizedAnnotationTableViewCell.Key) as CustomizedAnnotationTableViewCell; if (cell == null) { cell = CustomizedAnnotationTableViewCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; if (AnnotationList.Count != 0) { var annotation = AnnotationList[indexPath.Row]; cell.PublicationNameLabel.Text = annotation.BookTitle; DateTime date = annotation.UpdatedTime; cell.DateLabel.Text = date.ToString("dd MMM yyyy"); string guidCardTitle = annotation.GuideCardName + ">" + annotation.TOCTitle; cell.GuidecardLabel.Text = guidCardTitle; cell.HighlightTextLabel.Text = annotation.HighlightText; cell.NoteLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#cccccc"); if (annotation.NoteText != "") { cell.NoteLabel.Text = annotation.NoteText; } else { cell.NoteLabel.Text = "Add a note..."; } getGuidList = annotation.CategoryTags; nfloat TagHeight = (tableView.Frame.Size.Width - 60 * 8) / 9; if (getGuidList.Count == 0) { UIView emptyBtn = new UIView(new CGRect(0, 10, 10, 10)); emptyBtn.BackgroundColor = UIColor.White; emptyBtn.Layer.BorderColor = ColorUtil.ConvertFromHexColorCode("#cccccc").CGColor; emptyBtn.Layer.BorderWidth = 1; emptyBtn.Layer.CornerRadius = 10 / 2; UILabel emptyLabel = new UILabel(new CGRect(18, 5, 120, 18)); emptyLabel.Text = "Add a tag..."; emptyLabel.TextColor = ColorUtil.ConvertFromHexColorCode("#cccccc"); emptyLabel.Font = UIFont.SystemFontOfSize(14); cell.TagContainerView.AddSubview(emptyLabel); cell.TagContainerView.AddSubview(emptyBtn); } else { for (int i = 0; i < getGuidList.Count; i++) { AnnotationTag tag = getGuidList[i]; UIColor defaultColor = ColorUtil.ConvertFromHexColorCode(tag.Color); TagsButton btn = new TagsButton(); btn.Frame = new CGRect((TagHeight + 60) * (i % 8), (i / 8) * 25, 60, 30); btn.BackgroundColor = UIColor.White; btn.ColorView.BackgroundColor = defaultColor; btn.ColorLabel.Text = tag.Title; btn.Layer.BorderColor = UIColor.Clear.CGColor; btn.Layer.BorderWidth = 1; btn.Layer.CornerRadius = 10 / 2; btn.ClipsToBounds = true; cell.TagContainerView.AddSubview(btn); } } } cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return(cell); }