Frame createSummary()
        {
            var summaryLabel = new Label {
                Style     = AppStyles.GetLabelStyle(NamedSize.Large),
                TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                Text      = _statsPageEnum == StatsPageEnum.LabsRating || _statsPageEnum == StatsPageEnum.PractiseMarks ?
                            CrossLocalization.Translate("stats_summary_rating") :
                            CrossLocalization.Translate("stats_summary_visiting")
            };

            var summaryDetailsLabel = new Label {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                Style             = AppStyles.GetLabelStyle(NamedSize.Large),
                TextColor         = Color.FromHex(Theme.Current.StatisticsDetailsResultsColor)
            };

            summaryDetailsLabel.SetBinding(Label.TextProperty, "Summary");

            return(new Frame {
                HasShadow = false,
                Margin = _studentNameMargin,
                BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor),
                Content = new StackLayout {
                    Orientation = StackOrientation.Horizontal,
                    Children = { summaryLabel, summaryDetailsLabel }
                }
            });
        }
Esempio n. 2
0
        public CalendarSubjectsViewCell()
        {
            var subjectColorView = new BoxView {
                Margin          = _boxViewMargin,
                HeightRequest   = _boxViewSize,
                WidthRequest    = _boxViewSize,
                CornerRadius    = _boxViewSize / 2,
                VerticalOptions = LayoutOptions.Center
            };

            subjectColorView.SetBinding(BoxView.ColorProperty, "Color", converter: new StringToColorConverter());

            var subject = new Label {
                TextColor       = Color.FromHex(Theme.Current.TodayCalendarSubjectTextColor),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Style           = AppStyles.GetLabelStyle()
            };

            subject.SetBinding(Label.TextProperty, "Subject");

            View = new StackLayout {
                BackgroundColor = Color.FromHex(Theme.Current.TodaySubjectBackgroundColor),
                Padding         = _padding,
                Orientation     = StackOrientation.Horizontal,
                Children        =
                {
                    subjectColorView,
                    subject
                }
            };
        }
 Label createSubtitleLabel()
 {
     return(new Label {
         TextColor = Color.FromHex(Theme.Current.SettingsGroupUserColor),
         Style = AppStyles.GetLabelStyle()
     });
 }
Esempio n. 4
0
        public TestingResultsViewCell()
        {
            _answer = new Label {
                TextColor       = Color.FromHex(Theme.Current.TestResultsAnswerTextColor),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Style           = AppStyles.GetLabelStyle()
            };

            _boxView = new BoxView {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                HeightRequest     = _boxSize,
                WidthRequest      = _boxSize,
                CornerRadius      = _boxSize / 2,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };

            var frame = new Frame {
                BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor),
                HasShadow       = false,
                CornerRadius    = _frameRadius,
                Margin          = _frameMargin,
                Content         = new StackLayout {
                    Orientation = StackOrientation.Horizontal,
                    Children    =
                    {
                        _answer,
                        _boxView
                    }
                }
            };

            View = frame;
        }
        Label createRightLabelLayout(
            string title, string bindingProperty = null, NamedSize namedSize = NamedSize.Medium)
        {
            var color = Color.FromHex(Theme.Current.AboutTextColor);

            var leftSpan = new Span {
                Text            = title,
                ForegroundColor = color,
                FontAttributes  = FontAttributes.Bold,
                Style           = AppStyles.GetLabelStyle(namedSize, true)
            };

            var formattedString = new FormattedString {
                Spans =
                {
                    leftSpan
                }
            };

            if (bindingProperty != null)
            {
                var rightSpan = new Span {
                    ForegroundColor = color,
                    Style           = AppStyles.GetLabelStyle()
                };

                rightSpan.SetBinding(Span.TextProperty, bindingProperty);
                formattedString.Spans.Add(rightSpan);
            }

            return(new Label {
                FormattedText = formattedString
            });
        }
Esempio n. 6
0
        public CalendarCarouselViewCell()
        {
            addResources();

            var collection = new CollectionView {
                ItemsLayout   = new GridItemsLayout(_daysOfWeekNumber, ItemsLayoutOrientation.Vertical),
                ItemTemplate  = new DataTemplate(() => new CalendarCollectionViewCell(_dataBindingDay, true)),
                SelectionMode = SelectionMode.Single
            };

            collection.SetBinding(ItemsView.ItemsSourceProperty, "Days");
            collection.SetBinding(SelectableItemsView.SelectedItemProperty, "CalendarSelectedItem");
            collection.SetBinding(
                SelectableItemsView.SelectionChangedCommandProperty, "CalendarSelectionChangedCommand");

            var monthYearLabel = new Label {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                TextColor         = Color.FromHex(Theme.Current.TodayCalendarBaseTextColor),
                Style             = AppStyles.GetLabelStyle()
            };

            monthYearLabel.SetBinding(Label.TextProperty, "MonthYear");

            Content = new StackLayout {
                Padding           = _padding,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Children          =
                {
                    collection, monthYearLabel
                }
            };
        }
Esempio n. 7
0
        private void loadData()
        {
            Root.Clear();
            Root.Add(
                from slot in (ViewModel.TimeSlots ?? new List <TimeSlot>())
                select new CommandBindableSection <SessionElement>("", ViewModel.ViewSessionCommand)
            {
                ItemsSource = slot.Sessions,
                HeaderView  = AppStyles.CreateListHeader(string.Format("{0} - {1}", slot.StartTime.FormatTime(), slot.EndTime.FormatTime()), UITableViewStyle.Plain)
            }
                );

            var fullScheduleSection = new Section
            {
                HeaderView = new UIView(new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, 33))
                {
                    BackgroundColor = UIColor.Clear
                }
            };

            fullScheduleSection.Add(
                new StyledStringElement("See full schedule")
            {
                Accessory       = UITableViewCellAccessory.DisclosureIndicator,
                SelectedCommand = ViewModel.ViewFullScheduleCommand,
                BackgroundColor = AppStyles.SemiTransparentCellBackgroundColor,
                TextColor       = AppStyles.ListTitleColor,
                Font            = AppStyles.ListTitleFont
            }
                );
            Root.Add(fullScheduleSection);
            ReloadData();
        }
Esempio n. 8
0
        public EemcPageViewCell()
        {
            _icon = new CachedImage {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                HeightRequest     = _iconHeight
            };

            var title = new Label {
                TextColor               = Color.FromHex(Theme.Current.EemcItemTitleColor),
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                Style = AppStyles.GetLabelStyle()
            };

            title.SetBinding(Label.TextProperty, "Name");

            Content = new StackLayout {
                Margin   = _margin,
                Children =
                {
                    _icon,
                    title
                }
            };
        }
        public TestEditableAnswerViewCell()
        {
            var answerEntry = new Entry {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.FromHex(Theme.Current.TestPassingEntryColor),
                TextColor         = Color.FromHex(Theme.Current.TestPassingAnswerColor),
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                Style             = AppStyles.GetEntryStyle()
            };

            answerEntry.SetBinding(Entry.TextProperty, "ContentToAnswer");

            View = new Frame {
                BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor),
                HasShadow       = false,
                Margin          = _frameMargin,
                CornerRadius    = _frameRadius,
                Content         = new StackLayout {
                    Orientation = StackOrientation.Horizontal,
                    Children    =
                    {
                        answerEntry
                    }
                }
            };
        }
        public TestMultipleAnswerViewCell()
        {
            _boxView = new BoxView {
                HeightRequest   = _boxSize,
                WidthRequest    = _boxSize,
                Color           = Color.FromHex(Theme.Current.AppBackgroundColor),
                VerticalOptions = LayoutOptions.CenterAndExpand
            };

            _answer = new Label {
                TextColor       = Color.FromHex(Theme.Current.TestPassingAnswerColor),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Style           = AppStyles.GetLabelStyle()
            };

            _answer.SetBinding(Label.TextProperty, "Content");

            View = new Frame {
                BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor),
                HasShadow       = false,
                Margin          = _frameMargin,
                CornerRadius    = _frameRadius,
                Content         = new StackLayout {
                    Orientation = StackOrientation.Horizontal,
                    Children    =
                    {
                        _boxView,
                        _answer
                    }
                }
            };
        }
Esempio n. 11
0
 /// <summary>
 /// Create description label.
 /// </summary>
 /// <param name="description">Frame description.</param>
 /// <returns>Description label.</returns>
 Label createDescriptionLabel(string description)
 {
     return(new Label {
         Text = description,
         TextColor = Color.FromHex(Theme.Current.SwitchFrameDescriptionColor),
         Style = AppStyles.GetLabelStyle(NamedSize.Small)
     });
 }
Esempio n. 12
0
 /// <summary>
 /// Create title label.
 /// </summary>
 /// <param name="title">Frame title.</param>
 /// <returns>Title label.</returns>
 Label createTitleLabel(string title)
 {
     return(new Label {
         TextColor = Color.FromHex(Theme.Current.SwitchFrameTextColor),
         Text = title,
         Style = AppStyles.GetLabelStyle()
     });
 }
Esempio n. 13
0
 Label createExpandLabel(string expandTextString)
 {
     return(new Label {
         Text = expandTextString,
         HorizontalTextAlignment = TextAlignment.Center,
         Style = AppStyles.GetLabelStyle(NamedSize.Small),
         TextColor = Color.FromHex(Theme.Current.StatisticsExpandableTextColor)
     });
 }
Esempio n. 14
0
 Label createContributorLabel(string localizedKey, bool bold = false)
 {
     return(new Label {
         Style = AppStyles.GetLabelStyle(bold: bold),
         HorizontalTextAlignment = TextAlignment.Center,
         Text = CrossLocalization.Translate(localizedKey),
         TextColor = Color.FromHex(Theme.Current.AboutTextColor)
     });
 }
        Label createQuestionLabel()
        {
            var questionLabel = new Label {
                TextColor = Color.FromHex(Theme.Current.TestPassingQuestionColor),
                Style     = AppStyles.GetLabelStyle(NamedSize.Large)
            };

            questionLabel.SetBinding(Label.TextProperty, "Question");
            return(questionLabel);
        }
Esempio n. 16
0
        /// <summary>
        /// Create description label.
        /// </summary>
        /// <returns>Description label.</returns>
        Label createDescription()
        {
            var description = new Label {
                TextColor = Color.FromHex(Theme.Current.CheckboxDescriptionColor),
                Style     = AppStyles.GetLabelStyle(NamedSize.Small)
            };

            description.SetBinding(Label.TextProperty, "Description");
            return(description);
        }
Esempio n. 17
0
 Label createChooseLabel()
 {
     return(new Label {
         Margin = _chooseLabelMargin,
         FontAttributes = FontAttributes.Bold,
         TextColor = Color.FromHex(Theme.Current.BaseSectionTextColor),
         Text = CrossLocalization.Translate("settings_theme_choose"),
         Style = AppStyles.GetLabelStyle(NamedSize.Large, true)
     });
 }
 Label createTimePassedLabel()
 {
     return(new Label {
         HorizontalTextAlignment = TextAlignment.Center,
         HorizontalOptions = LayoutOptions.CenterAndExpand,
         Style = AppStyles.GetLabelStyle(NamedSize.Medium),
         TextColor = Color.FromHex(Theme.Current.TestResultsRatingColor),
         Text = $"{CrossLocalization.Translate("test_results_time")} {_timePassed}"
     });
 }
 Label createRatingTitleLabel()
 {
     return(new Label {
         TextColor = Color.FromHex(Theme.Current.BaseSectionTextColor),
         HorizontalTextAlignment = TextAlignment.Center,
         HorizontalOptions = LayoutOptions.CenterAndExpand,
         Text = CrossLocalization.Translate("test_results_label"),
         Style = AppStyles.GetLabelStyle()
     });
 }
Esempio n. 20
0
 Label createHeaderLabel()
 {
     return(new Label {
         Padding = _headerPadding,
         FontAttributes = FontAttributes.Bold,
         Text = CrossLocalization.Translate("files_header"),
         TextColor = Color.FromHex(Theme.Current.BaseSectionTextColor),
         BackgroundColor = Color.FromHex(Theme.Current.AppBackgroundColor),
         Style = AppStyles.GetLabelStyle(NamedSize.Large, true)
     });
 }
        Label createUserLabel()
        {
            var userLabel = new Label {
                TextColor       = Color.FromHex(Theme.Current.SettingsTitleColor),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Style           = AppStyles.GetLabelStyle()
            };

            userLabel.SetBinding(Label.TextProperty, "Username");
            return(userLabel);
        }
Esempio n. 22
0
        void CreateDescription()
        {
            UITextView description = new UITextView(new RectangleF(0, 50, Frame.Width, Frame.Height));

            description.Text            = ResourceManager.GetString("loginRequired");
            description.BackgroundColor = UIColor.Clear;
            description.Font            = AppStyles.HelveticaNeue(20);
            description.TextAlignment   = UITextAlignment.Center;
            description.Editable        = false;
            AddSubview(description);
        }
        Label createDescriptionLabel()
        {
            var descriptionLabel = new Label {
                TextColor = Color.FromHex(Theme.Current.TestPassingQuestionColor),
                TextType  = TextType.Html,
                Style     = AppStyles.GetLabelStyle()
            };

            descriptionLabel.SetBinding(Label.TextProperty, "Description");
            return(descriptionLabel);
        }
 Label createStudentNameLabel(string name)
 {
     return(new Label {
         Text = name,
         Margin = _studentNameMargin,
         TextColor = Color.FromHex(Theme.Current.StatisticsDetailsNameColor),
         HorizontalOptions = LayoutOptions.CenterAndExpand,
         HorizontalTextAlignment = TextAlignment.Center,
         Style = AppStyles.GetLabelStyle(NamedSize.Large)
     });
 }
        Label createAnswerLabel()
        {
            var answer = new Label {
                TextColor       = Color.FromHex(Theme.Current.TestPassingAnswerColor),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Style           = AppStyles.GetLabelStyle()
            };

            answer.SetBinding(Label.TextProperty, "Content");
            return(answer);
        }
Esempio n. 26
0
 Label createSubjectsLabel()
 {
     return(new Label {
         BackgroundColor = Color.FromHex(Theme.Current.AppBackgroundColor),
         Padding = _subjectsLabelMargin,
         FontAttributes = FontAttributes.Bold,
         TextColor = Color.FromHex(Theme.Current.BaseSectionTextColor),
         Text = CrossLocalization.Translate("today_subjects"),
         Style = AppStyles.GetLabelStyle(NamedSize.Large, true)
     });
 }
        /// <summary>
        /// Create subject label.
        /// </summary>
        /// <returns>Subject label.</returns>
        Label createSubjectLabel()
        {
            var subject = new Label {
                TextColor = Color.FromHex(Theme.Current.BasePickerTextColor),
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                Style = AppStyles.GetLabelStyle()
            };

            subject.SetBinding(Label.TextProperty, ChosenSubjectProperty);
            return(subject);
        }
Esempio n. 28
0
 private void loadSessions()
 {
     Root.Clear();
     Root.Add(
         from slot in ViewModel.TimeSlots
         select new CommandBindableSection <SessionElement>("", ViewModel.ViewSessionCommand)
     {
         ItemsSource = slot.Sessions,
         HeaderView  = AppStyles.CreateListHeader(string.Format("{0} - {1}", slot.StartTime.FormatTime(), slot.EndTime.FormatTime()), UITableViewStyle.Plain)
     }
         );
     ReloadData();
 }
        Label createRatingLabel()
        {
            var mark = new Label {
                FontAttributes          = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                TextColor = Color.FromHex(Theme.Current.TestResultsRatingColor),
                Style     = AppStyles.GetLabelStyle(NamedSize.Large, true)
            };

            mark.SetBinding(Label.TextProperty, "Mark");
            return(mark);
        }
        Label createNewsTitle()
        {
            var newsTitleLabel = new Label {
                Padding                 = _newsTitlePadding,
                TextColor               = Color.FromHex(Theme.Current.NewsTextColor),
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                Style = AppStyles.GetLabelStyle(NamedSize.Large)
            };

            newsTitleLabel.SetBinding(Label.TextProperty, "NewsTitle");
            return(newsTitleLabel);
        }