void SetupAMPMLabel(View view, AgendaCellViewModel viewModel, Color textColor)
        {
            TextView timelabel = view.FindViewById <TextView>(Resource.Id.timelabel);

            timelabel.Text = viewModel.Time.ToString("tt");
            timelabel.SetTextColor(textColor);
            timelabel.Typeface = bold;
            timelabel.TextSize = 9;
        }
        void SetupTime(View view, AgendaCellViewModel viewModel, Color textColor)
        {
            TextView time = view.FindViewById <TextView>(Resource.Id.time);

            time.Text = viewModel.Time.ToString("h:mm");
            time.SetTextColor(textColor);
            time.TranslationY = 7;
            time.Typeface     = light;
            time.TextSize     = 24;
        }
Exemple #3
0
 UIView CreateBackgroundView(RectangleF bounds, AgendaCellViewModel viewModel)
 {
     return(new UIView {
         AutoresizingMask = UIViewAutoresizing.FlexibleHeight,
         Frame = bounds,
         BackgroundColor = ((Xamarin.Forms.Color) new TrackBackgroundColorConverter()
                            .Convert(viewModel.Track, typeof(Xamarin.Forms.Color), null, CultureInfo.CurrentCulture))
                           .ToUIColor()
     });
 }
Exemple #4
0
        UIView CreateTrackLabel(AgendaCellViewModel viewModel, UIColor textColor)
        {
            var label = new UILabel {
                Text      = new TrackValueConverter().Convert(viewModel.Track, typeof(string), null, CultureInfo.CurrentCulture) as string,
                TextColor = textColor,
                Frame     = new RectangleF {
                    X      = Padding + TitleWidth / 2,
                    Y      = Padding + TitleHeight,
                    Width  = TitleWidth / 2,
                    Height = 20
                },
                Font = UIFont.FromName(Fonts.OpenSansLight, 12)
            };

            return(label);
        }
Exemple #5
0
        UIView CreateLocationLabel(AgendaCellViewModel viewModel, UIColor textColor)
        {
            var label = new UILabel {
                Text      = viewModel.Location.ToUpper(),
                TextColor = textColor,
                Frame     = new RectangleF {
                    X      = Padding,
                    Y      = Padding + TitleHeight,
                    Width  = TitleWidth / 2,
                    Height = 20
                },
                Font = UIFont.FromName(Fonts.OpenSansBold, 12)
            };

            return(label);
        }
        void SetupLocation(View view, AgendaCellViewModel viewModel, Color textColor, bool visible)
        {
            TextView location = view.FindViewById <TextView>(Resource.Id.location);

            if (visible)
            {
                location.Visibility = ViewStates.Visible;
                location.Text       = viewModel.Location.ToUpper();
                location.SetTextColor(textColor);
                location.Typeface = bold;
                location.TextSize = 12;
            }
            else
            {
                location.Visibility = ViewStates.Gone;
            }
        }
        void SetupTitle(View view, AgendaCellViewModel viewModel, Color textColor, bool visible)
        {
            TextView title = view.FindViewById <TextView>(Resource.Id.title);

            if (visible)
            {
                title.Visibility = ViewStates.Visible;
                title.Text       = viewModel.Title;
                title.SetTextColor(textColor);
                title.Typeface = light;
                title.TextSize = 14;
            }
            else
            {
                title.Visibility = ViewStates.Gone;
            }
        }
        void SetupTrack(View view, AgendaCellViewModel viewModel, Color textColor, bool visible)
        {
            TextView track = view.FindViewById <TextView>(Resource.Id.track);

            if (visible)
            {
                track.Visibility = ViewStates.Visible;
                track.Text       = new TrackValueConverter().Convert(viewModel.Track, typeof(string), null, CultureInfo.CurrentCulture) as string;
                track.SetTextColor(textColor);
                track.Typeface = regular;
                track.TextSize = 12;
            }
            else
            {
                track.Visibility = ViewStates.Gone;
            }
        }
Exemple #9
0
        UIView CreateAMPMLabel(AgendaCellViewModel viewModel, UIColor textColor)
        {
            var label = new UILabel {
                Text      = viewModel.Time.ToString("tt"),
                TextColor = textColor,
                Frame     = new RectangleF {
                    X      = Padding + TitleWidth + TimeWidth,
                    Y      = TimeTop + 16,
                    Width  = 16,
                    Height = 20
                },
                Font          = UIFont.FromName(Fonts.OpenSansBold, 9),
                TextAlignment = UITextAlignment.Right
            };

            return(label);
        }
Exemple #10
0
        UIView CreateTimeLabel(AgendaCellViewModel viewModel, UIColor textColor)
        {
            var label = new UILabel {
                Text      = viewModel.Time.ToString("h:mm"),
                TextColor = textColor,
                Frame     = new RectangleF {
                    X      = Padding + TitleWidth,
                    Y      = TimeTop,
                    Width  = TimeWidth,
                    Height = 40
                },
                Font          = UIFont.FromName(Fonts.OpenSansLight, 24),
                TextAlignment = UITextAlignment.Right
            };

            return(label);
        }
Exemple #11
0
        UIView CreateTitleLabel(AgendaCellViewModel viewModel, UIColor textColor)
        {
            var label = new UILabel {
                Text      = viewModel.Title,
                TextColor = textColor,
                Frame     = new RectangleF {
                    X      = Padding,
                    Y      = Padding,
                    Width  = TitleWidth,
                    Height = TitleHeight
                },
                Font = UIFont.FromName(Fonts.OpenSansLight, 14),
                UserInteractionEnabled = false,
                LineBreakMode          = UILineBreakMode.WordWrap,
                Lines = 0
            };

            return(label);
        }