From 8c39776135c6f4b0f658c7c04ec20493b0049913 Mon Sep 17 00:00:00 2001 From: Shevchnko Evgeniy Date: Thu, 11 Apr 2024 16:42:21 +0300 Subject: [PATCH] [UPDATE] design change --- source/EduCATS/Localization/en.json | 12 ++-- source/EduCATS/Localization/lt.json | 7 ++- source/EduCATS/Localization/ru.json | 2 + .../ViewModels/SavePracticeAndLabsPageView.cs | 4 +- .../Views/SavePracticeAndLabsPageViewModel.cs | 8 +-- .../Views/SaveSingleStudentMarkPageView.cs | 24 ++------ .../ViewModels/SaveMarksPageViewModel.cs | 40 ++++++------- .../SaveMarks/Views/SaveMarksPageView.cs | 13 +++-- .../Statistics/Base/Views/StatsPageView.cs | 51 ++++++++++------ .../Base/Views/ViewCells/StatsPageViewCell.cs | 6 +- .../Views/ViewCells/VisitingPageViewCell.cs | 4 +- .../Results/Views/StatsResultsPageView.cs | 27 +++++---- .../ViewCells/StatsResultsPageViewCell.cs | 38 +++++++----- .../Students/Views/StudentsPageView.cs | 6 +- .../Views/ViewCells/StudentsPageViewCell.cs | 6 +- .../Today/Base/Models/SubjectPageModel.cs | 58 +++++++++++++------ 16 files changed, 180 insertions(+), 126 deletions(-) diff --git a/source/EduCATS/Localization/en.json b/source/EduCATS/Localization/en.json index 45b5081e..ca7d6fa0 100644 --- a/source/EduCATS/Localization/en.json +++ b/source/EduCATS/Localization/en.json @@ -17,14 +17,14 @@ "contributor_julia_popova": "Julia Popova", "role_student": "Student", - "role_professor": "Professor", + "role_professor": "Lecturer", "address_building": "b.", "address_room": "а.", "type_activity_lecture": "Lecture", - "type_activity_lab": "Lab work", - "type_activity_practical": "Practical work", + "type_activity_lab": "Lab", + "type_activity_practical": "Workshop", "server_test": "Test server", "server_local": "Local server", @@ -84,7 +84,7 @@ "lectures_fetch_error": "Error occurred during retrieving lectures. Please try to refresh page or contact support.", "learning_card_tests": "Tests", - "learning_card_eemc": "EEMC", + "learning_card_eemc": "Educational Complex", "learning_card_files": "Files", "learning_card_adaptive": "Adaptive learning", @@ -213,7 +213,7 @@ "empty_fields_forgot_password": "Required fields (Login, Specific question, Answer, New Password, Confirm Password) must be filled!", "set_marks": "Set marks", - "set_visiting": "Put up gaps", + "set_visiting": "Mark attendance", "save_marks": "Save", "practiсe_visiting": "Practiсe visiting", @@ -226,7 +226,7 @@ "show_for_student": "Show for student", "skipped_hours": "Skipped hours", - "demo_eemc_open_error": "Viewing EEMC documents is not available for a demo account.", + "demo_eemc_open_error": "Viewing Educational Complex documents is not available for a demo account.", "demo_files_download_error": "Downloading tutorials is not available for a demo account.", "demo_delete_account_error": "Deleting a demo account is not possible." } diff --git a/source/EduCATS/Localization/lt.json b/source/EduCATS/Localization/lt.json index b9e2e9c7..3fc631e9 100644 --- a/source/EduCATS/Localization/lt.json +++ b/source/EduCATS/Localization/lt.json @@ -22,9 +22,10 @@ "address_building": "p.", "address_room": "a.", - "type_activity_lecture": "Lezione", - "type_activity_lab": "Lavoro di laboratorio", - "type_activity_practical": "Lavoro pratico", + "type_activity_lecture": "Paskaita", + + "type_activity_lab": "Laboratoriniai darbai", + "type_activity_practical": "Praktinė pamoka", "server_test": "Testavimo serveris", "server_local": "Vietinis serveris", diff --git a/source/EduCATS/Localization/ru.json b/source/EduCATS/Localization/ru.json index 346835f5..7be6d170 100644 --- a/source/EduCATS/Localization/ru.json +++ b/source/EduCATS/Localization/ru.json @@ -25,6 +25,8 @@ "type_activity_lecture": "Лекция", "type_activity_lab": "Лаб. работа", "type_activity_practical": "Практ. занятие", + "type_activity_kconsultation": "КП", + "type_activity_dconsultation": "ДП", "server_test": "Тестовый сервер", "server_local": "Локальный сервер", diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SavePracticeAndLabsPageView.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SavePracticeAndLabsPageView.cs index a5586cea..5610985b 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SavePracticeAndLabsPageView.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SavePracticeAndLabsPageView.cs @@ -68,7 +68,7 @@ public SavePracticeAndLabsPageView(string title, int subjectId, int groupId, str BindingContext = new SavePracticeAndLabsPageViewModel(new PlatformServices(), subjectId, labMarksList, groupId, title); createLabsMarks(); } - + } void createLabsMarks() @@ -79,6 +79,7 @@ void createLabsMarks() Style = AppStyles.GetLabelStyle(), Font = Font.SystemFontOfSize(NamedSize.Large), Text = CrossLocalization.Translate("choose_group") + " " + _groupName, + HorizontalOptions = LayoutOptions.Center, }; var stackLayout = new StackLayout(); @@ -136,6 +137,7 @@ Picker subGroupPicker() var subGroupPicker = new Picker { BackgroundColor = Color.White, + HeightRequest = 70, }; subGroupPicker.SetBinding(Picker.ItemsSourceProperty, "SubGroup"); subGroupPicker.SetBinding(Picker.SelectedItemProperty, new Binding("SelectedSubGroup")); diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SavePracticeAndLabsPageViewModel.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SavePracticeAndLabsPageViewModel.cs index c851886c..016f1891 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SavePracticeAndLabsPageViewModel.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SavePracticeAndLabsPageViewModel.cs @@ -94,7 +94,7 @@ private void createLabsMarksPage(LabsVisitingList labsVisitingList) { if (group.SubGroup == 1) { - _currentLabsVisitingMarksSubGroup1.Add(new StudentsPageModel(group.Login ,group.FullName)); + _currentLabsVisitingMarksSubGroup1.Add(new StudentsPageModel(group.Login, group.FullName)); FullNames.Add(group.FullName); } else @@ -219,7 +219,7 @@ public string SelectedSubGroup { get { - if (SubGroup.Count != 0) + if (SubGroup.Count != 0) { if (_selectedSubGroup == SubGroup[0]) { @@ -232,7 +232,7 @@ public string SelectedSubGroup LabsVisitingMarksSubGroup = LabsVisitingMarksSubGroupTwo; DateLabs = Date2; selSubGroup = 2; - } + } } return _selectedSubGroup; } @@ -261,7 +261,7 @@ void openPage(object selectedObject) { _services.Navigation.OpenAddSingleMark(_title, student.Name, labsVisitingList, _takedLabs, selSubGroup); } - + } catch (Exception ex) { diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs index a50a3ac2..fed5cc0e 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs @@ -20,7 +20,6 @@ public class SaveSingleStudentMarkPageView : ContentPage const double _heightRequest = 40; static Thickness _padding = new Thickness(10, 1); - static Thickness _margin = new Thickness(0, 10); public List Marks = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; public List NameOfLabOrPractice = new List(); public string _title { get; set; } @@ -29,13 +28,13 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList { _title = title; - if(title == CrossLocalization.Translate("practice_mark")) + if (title == CrossLocalization.Translate("practice_mark")) { - foreach(var pract in prOrLabStat.Practicals) + foreach (var pract in prOrLabStat.Practicals) { NameOfLabOrPractice.Add(pract.ShortName); } - BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(), + BindingContext = new SaveSingleStudentMarkPageViewModel(new PlatformServices(), NameOfLabOrPractice.FirstOrDefault(), marks, prOrLabStat, title, name, subGruop); } else if (title == CrossLocalization.Translate("stats_page_labs_rating")) @@ -57,11 +56,10 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList var inicials = new Label { VerticalOptions = LayoutOptions.CenterAndExpand, - Margin = _margin, HorizontalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle(), - Font = Font.SystemFontOfSize(NamedSize.Large).WithSize(20).WithAttributes(FontAttributes.None), + Font = Font.SystemFontOfSize(NamedSize.Large).WithSize(20).WithAttributes(FontAttributes.Bold), Text = name, }; @@ -144,20 +142,6 @@ public SaveSingleStudentMarkPageView(string title, string name, LabsVisitingList commentEntry.SetBinding(Entry.TextProperty, "Comment"); - nameOfPrOrLb.PropertyChanged += delegate { - if (nameOfPrOrLb.SelectedItem is not null) - if (marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Mark != string.Empty) - { - markPicker.SelectedIndex = Convert.ToInt32(marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Mark) - 1; - commentEntry.Text = marks.Students.First(student => student.FullName == name).LabsMarks.First(labmarks => labmarks.LabId == prOrLabStat.Labs.First(lab => lab.ShortName == nameOfPrOrLb.SelectedItem as string).LabId).Comment; - } - else - { - markPicker.SelectedItem = null; - commentEntry.Text = string.Empty; - } - }; - var gridLayout = new Grid { BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), diff --git a/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs b/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs index efa5f1ba..e849bb2b 100644 --- a/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs +++ b/source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs @@ -42,15 +42,15 @@ public class SaveMarksPageViewModel : ViewModel public List _currentLabsVisitingMarksSubGroup1; public string _titleOfPage { get; set; } public List FullNames { get; set; } - + public TakedLabs _takedLabs { get; set; } public SaveMarksPageViewModel(IPlatformServices services, int _subjectId, object stat, int groupId, string title) { ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; }; - + _titleOfPage = title; - _services = services; + _services = services; if (title == CrossLocalization.Translate("stats_page_lectures_visiting")) { groupData = stat as VisitingLecturesList; @@ -156,7 +156,7 @@ void createLecturesVisitingPage(VisitingLecturesList statistics) Date.Add(groupVisit.Date); } if (Date[0] == groupVisit.Date && - !(_currentLecturesVisitingMarks.Contains(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment, + !(_currentLecturesVisitingMarks.Contains(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment, groupVisit.Mark, false)))) { _currentLecturesVisitingMarks.Add(new VisitingPageModel(groupVis.StudentName, groupVisit.Comment, @@ -165,7 +165,7 @@ void createLecturesVisitingPage(VisitingLecturesList statistics) } } } - SelectedDate = Date[Date.Count-1]; + SelectedDate = Date[Date.Count - 1]; LecturesMarks = _currentLecturesVisitingMarks; } @@ -190,7 +190,7 @@ public Command SaveMarksCommand var i = 0; foreach (var lect in lecturesVisiting.LecturesMarksVisiting) { - for(int m = 0; m < lect.Marks.Count; m++) + for (int m = 0; m < lect.Marks.Count; m++) { if (lect.Marks[m].Date == selDateForSave) { @@ -215,7 +215,7 @@ public Command SaveMarksCommand dateId = lab.ScheduleProtectionLabId; } int i = 0; - for(int stud = 0; stud < labsVisiting.Count; stud++) + for (int stud = 0; stud < labsVisiting.Count; stud++) { if (labsVisiting[stud].FullName == LabsVisitingMarksSubGroup[i].Title) { @@ -252,9 +252,9 @@ public Command SaveMarksCommand dateId = pr.ScheduleProtectionPracticalId; } int i = 0; - for(int pract = 0; pract < practVisiting.Count; pract++) + for (int pract = 0; pract < practVisiting.Count; pract++) { - foreach(var mark in practVisiting[pract].PracticalVisitingMark.Where(v => v.ScheduleProtectionPracticalId == dateId)) + foreach (var mark in practVisiting[pract].PracticalVisitingMark.Where(v => v.ScheduleProtectionPracticalId == dateId)) { mark.Mark = LecturesMarks[i].Mark; mark.Comment = LecturesMarks[i].Comment; @@ -368,9 +368,9 @@ public string SelectedDate LecturesMarks = _currentLecturesVisitingMarks; return _selectedDate; } - set - { - SetProperty(ref _selectedDate, value); + set + { + SetProperty(ref _selectedDate, value); } } @@ -405,7 +405,7 @@ public string SelectedPracDate string _selectedLabDate; public string SelectedLabDate { - get + get { _currentLabsVisitingMarksSubGroup1 = new List(); foreach (var date in _takedLabs.ScheduleProtectionLabs.Where(v => v.Date == _selectedLabDate)) @@ -422,11 +422,11 @@ public string SelectedLabDate } } LabsVisitingMarksSubGroup = _currentLabsVisitingMarksSubGroup1; - return _selectedLabDate; + return _selectedLabDate; } - set - { - SetProperty(ref _selectedLabDate, value); + set + { + SetProperty(ref _selectedLabDate, value); } } @@ -454,15 +454,15 @@ public string SelectedSubGroup } DateLabs = Date1; LabsVisitingMarksSubGroup = _currentLabsVisitingMarksSubGroup1; - + if (DateLabs.Count != 0) SelectedLabDate = DateLabs[DateLabs.Count - 1]; return _selectedSubGroup; } - set + set { - SetProperty(ref _selectedSubGroup, value); + SetProperty(ref _selectedSubGroup, value); } } } diff --git a/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs b/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs index f47962ab..67ab3109 100644 --- a/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs +++ b/source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs @@ -17,7 +17,7 @@ namespace EduCATS.Pages.SaveMarks.Views { - public class SaveMarksPageView : ContentPage + public class SaveMarksPageView : ContentPage { public string _title { get; set; } @@ -45,14 +45,14 @@ public SaveMarksPageView(int subjectId, int groupId, string title, string groupN if (title == CrossLocalization.Translate("stats_page_lectures_visiting")) { string link = Links.GetLecturesCalendarData + "subjectId=" + subjectId + "&groupId=" + groupId; - var obj = requestDataAsync(link,httpContent); + var obj = requestDataAsync(link, httpContent); groupData = JsonConvert.DeserializeObject(obj.Result.ToString()); BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, groupData, groupId, title); } else if (title == CrossLocalization.Translate("stats_page_labs_visiting")) { string link = Links.GetLabsCalendarData + "subjectId=" + subjectId + "&groupId=" + groupId; - var obj = requestDataAsync(link,httpContent); + var obj = requestDataAsync(link, httpContent); labsVisitingList = JsonConvert.DeserializeObject(obj.Result.ToString()); BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, labsVisitingList, groupId, title); } @@ -64,7 +64,7 @@ public SaveMarksPageView(int subjectId, int groupId, string title, string groupN groupItems.SubjectId = subjectId; var body = JsonConvert.SerializeObject(groupItems); httpContent = new StringContent(body, Encoding.UTF8, "application/json"); - var obj = requestDataAsync(link,httpContent); + var obj = requestDataAsync(link, httpContent); particialVisitingList = JsonConvert.DeserializeObject(obj.Result.ToString()); BindingContext = new SaveMarksPageViewModel(new PlatformServices(), subjectId, particialVisitingList, groupId, title); } @@ -97,6 +97,7 @@ void createView() Style = AppStyles.GetLabelStyle(), Font = Font.SystemFontOfSize(NamedSize.Large), Text = CrossLocalization.Translate("choose_group") + " " + _groupName, + HorizontalOptions = LayoutOptions.Center, }; var stackLayout = new StackLayout(); var resultsListView = new RoundedListView(typeof(VisitingPageViewCell)); @@ -175,7 +176,7 @@ void createView() StackLayout stackView() { - + var save = saveMarksButton(); var form = new StackLayout { @@ -183,7 +184,7 @@ StackLayout stackView() VerticalOptions = LayoutOptions.Center, Children = { - save, + save, } }; return form; diff --git a/source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs b/source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs index 0aa8cfc9..4ff4c1ea 100644 --- a/source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs +++ b/source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs @@ -47,11 +47,12 @@ void createViews() RoundedListView createRoundedList(View header) { - var roundedListView = new RoundedListView(typeof(StatsPageViewCell), header: header) { + var roundedListView = new RoundedListView(typeof(StatsPageViewCell), header: header) + { IsPullToRefreshEnabled = true }; - //roundedListView.ItemTapped += (sender, e) => ((ListView)sender).SelectedItem = null; + roundedListView.ItemTapped += (sender, e) => ((ListView)sender).SelectedItem = null; roundedListView.SetBinding(ListView.IsRefreshingProperty, "IsLoading"); roundedListView.SetBinding(ListView.RefreshCommandProperty, "RefreshCommand"); roundedListView.SetBinding(ListView.SelectedItemProperty, "SelectedItem"); @@ -63,9 +64,10 @@ StackLayout createHeaderView() { var subjectsView = new SubjectsPickerView(); var radarChartView = createFrameWithChartView(); - //radarChartView.SetBinding(IsVisibleProperty, "IsStudent"); + radarChartView.SetBinding(IsVisibleProperty, "IsStudent"); - return new StackLayout { + return new StackLayout + { Padding = _headerPadding, Children = { subjectsView, @@ -86,10 +88,12 @@ Frame createFrameWithChartView() var collapsibleView = createExpandableView(false); collapsibleView.SetBinding(IsVisibleProperty, "IsExpandedStatistics"); - return new Frame { + return new Frame + { HasShadow = false, BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), - Content = new StackLayout { + Content = new StackLayout + { Children = { chartView, hiddenDetailsView, @@ -112,7 +116,7 @@ StackLayout createHiddenDetailsView() CrossLocalization.Translate("stats_chart_average_labs"), Color.FromHex(Theme.Current.StatisticsChartLabsColor), "AverageLabs"); - avgLabsView.SetBinding(IsVisibleProperty,"IsLabs"); + avgLabsView.SetBinding(IsVisibleProperty, "IsLabs"); var avgTestsView = createStatisticsView( CrossLocalization.Translate("stats_chart_average_tests"), @@ -124,7 +128,8 @@ StackLayout createHiddenDetailsView() Color.FromHex(Theme.Current.StatisticsChartRatingColor), "Rating"); - var avgStatsLayout = new StackLayout { + var avgStatsLayout = new StackLayout + { Children = { avgLabsView, avgTestsView, avgPractView, avgRatingView } @@ -137,7 +142,8 @@ StackLayout createHiddenDetailsView() notEnoughDataLabel.SetBinding(IsVisibleProperty, "IsNotEnoughDetails"); - var hiddenDetailsView = new StackLayout { + var hiddenDetailsView = new StackLayout + { Padding = _hiddenDetailsPadding, Children = { avgStatsLayout, @@ -154,7 +160,8 @@ Grid createStatisticsView(string text, Color color, string property) var statsBoxView = createStatisticsBoxView(color, property); var statsLabel = createStatisticsLabel(text); - var grid = new Grid { + var grid = new Grid + { HorizontalOptions = LayoutOptions.StartAndExpand, ColumnSpacing = _statsSpacing, ColumnDefinitions = { @@ -170,7 +177,8 @@ Grid createStatisticsView(string text, Color color, string property) StackLayout createStatisticsBoxView(Color color, string property) { - var ratingLabel = new Label { + var ratingLabel = new Label + { TextColor = Color.FromHex(Theme.Current.StatisticsBoxTextColor), FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), VerticalOptions = LayoutOptions.CenterAndExpand, @@ -179,7 +187,8 @@ StackLayout createStatisticsBoxView(Color color, string property) ratingLabel.SetBinding(Label.TextProperty, property); - return new StackLayout { + return new StackLayout + { HeightRequest = _boxSize, BackgroundColor = color, Children = { @@ -190,14 +199,16 @@ StackLayout createStatisticsBoxView(Color color, string property) Label createStatisticsLabel(string text, bool isCenteredHorizontally = false) { - var statsLabel = new Label { + var statsLabel = new Label + { TextColor = Color.FromHex(Theme.Current.StatisticsBaseRatingTextColor), Style = AppStyles.GetLabelStyle(NamedSize.Small), VerticalOptions = LayoutOptions.CenterAndExpand, Text = text }; - if (isCenteredHorizontally) { + if (isCenteredHorizontally) + { statsLabel.HorizontalOptions = LayoutOptions.CenterAndExpand; statsLabel.HorizontalTextAlignment = TextAlignment.Center; } @@ -221,7 +232,8 @@ StackLayout createExpandableView(bool isExpand = true) var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, "ExpandCommand"); - return new StackLayout { + return new StackLayout + { Padding = _expandableViewPadding, HorizontalOptions = LayoutOptions.FillAndExpand, GestureRecognizers = { @@ -236,7 +248,8 @@ StackLayout createExpandableView(bool isExpand = true) Label createExpandLabel(string expandTextString) { - return new Label { + return new Label + { Text = expandTextString, HorizontalTextAlignment = TextAlignment.Center, Style = AppStyles.GetLabelStyle(NamedSize.Small), @@ -246,7 +259,8 @@ Label createExpandLabel(string expandTextString) CachedImage createExpandIcon(string expandIconString) { - return new CachedImage { + return new CachedImage + { HeightRequest = _expandIconHeight, Source = ImageSource.FromFile(expandIconString), Transformations = new List { @@ -260,7 +274,8 @@ CachedImage createExpandIcon(string expandIconString) ChartView createChartView() { - var radarChartView = new ChartView { + var radarChartView = new ChartView + { HeightRequest = _chartHeight }; diff --git a/source/EduCATS/Pages/Statistics/Base/Views/ViewCells/StatsPageViewCell.cs b/source/EduCATS/Pages/Statistics/Base/Views/ViewCells/StatsPageViewCell.cs index 0d44f61f..026aaf4a 100644 --- a/source/EduCATS/Pages/Statistics/Base/Views/ViewCells/StatsPageViewCell.cs +++ b/source/EduCATS/Pages/Statistics/Base/Views/ViewCells/StatsPageViewCell.cs @@ -10,14 +10,16 @@ public class StatsPageViewCell : ViewCell public StatsPageViewCell() { - var menuLabel = new Label { + var menuLabel = new Label + { TextColor = Color.FromHex(Theme.Current.StatisticsBaseTitleColor), Style = AppStyles.GetLabelStyle() }; menuLabel.SetBinding(Label.TextProperty, "Title"); - View = new StackLayout { + View = new StackLayout + { BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), Padding = _padding, Children = { diff --git a/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs b/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs index b53d32af..08d7ad69 100644 --- a/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs +++ b/source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs @@ -14,7 +14,7 @@ public class VisitingPageViewCell : ViewCell const double _controlHeight = 50; - public List listOfMarks = new List {"1", "2", "3", "4" }; + public List listOfMarks = new List { "1", "2", "3", "4" }; public BindableProperty HeightRequestProperty { get; private set; } public BindableProperty BackgroundColorProperty { get; private set; } @@ -26,7 +26,7 @@ public VisitingPageViewCell() { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), - Font = Font.SystemFontOfSize(NamedSize.Large).WithAttributes(FontAttributes.Bold), + //Font = Font.SystemFontOfSize(NamedSize.Large).WithAttributes(FontAttributes.Bold), Style = AppStyles.GetLabelStyle() }; diff --git a/source/EduCATS/Pages/Statistics/Results/Views/StatsResultsPageView.cs b/source/EduCATS/Pages/Statistics/Results/Views/StatsResultsPageView.cs index fb361c20..329bd7d2 100644 --- a/source/EduCATS/Pages/Statistics/Results/Views/StatsResultsPageView.cs +++ b/source/EduCATS/Pages/Statistics/Results/Views/StatsResultsPageView.cs @@ -13,7 +13,7 @@ namespace EduCATS.Pages.Statistics.Results.Views public class StatsResultsPageView : ContentPage { static Thickness _padding = new Thickness(10, 1); - static Thickness _studentNameMargin = new Thickness(5, 5); + static Thickness _studentNameMargin = new Thickness(1, 5); readonly StatsPageEnum _statsPageEnum; @@ -33,13 +33,15 @@ void createViews(string name) { var headerLayout = new StackLayout(); - if (!string.IsNullOrEmpty(name)) { + if (!string.IsNullOrEmpty(name)) + { headerLayout.Children.Add(createStudentNameLabel(name)); } headerLayout.Children.Add(createSummary()); - var resultsListView = new RoundedListView(typeof(StatsResultsPageViewCell), header: headerLayout) { + var resultsListView = new RoundedListView(typeof(StatsResultsPageViewCell), header: headerLayout) + { IsPullToRefreshEnabled = true }; @@ -54,15 +56,17 @@ void createViews(string name) Frame createSummary() { - var summaryLabel = new Label { + var summaryLabel = new Label + { Style = AppStyles.GetLabelStyle(NamedSize.Large), TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), - Text = _statsPageEnum == StatsPageEnum.LabsRating || _statsPageEnum == StatsPageEnum.PractiseMarks ? + Text = _statsPageEnum == StatsPageEnum.LabsRating || _statsPageEnum == StatsPageEnum.PractiseMarks ? CrossLocalization.Translate("stats_summary_rating") : CrossLocalization.Translate("stats_summary_visiting") }; - var summaryDetailsLabel = new Label { + var summaryDetailsLabel = new Label + { HorizontalOptions = LayoutOptions.EndAndExpand, Style = AppStyles.GetLabelStyle(NamedSize.Large), TextColor = Color.FromHex(Theme.Current.StatisticsDetailsResultsColor) @@ -70,11 +74,13 @@ Frame createSummary() summaryDetailsLabel.SetBinding(Label.TextProperty, "Summary"); - return new Frame { - HasShadow = false, + return new Frame + { + HasShadow = false, Margin = _studentNameMargin, BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), - Content = new StackLayout { + Content = new StackLayout + { Orientation = StackOrientation.Horizontal, Children = { summaryLabel, summaryDetailsLabel } } @@ -83,7 +89,8 @@ Frame createSummary() Label createStudentNameLabel(string name) { - return new Label { + return new Label + { Text = name, Margin = _studentNameMargin, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsNameColor), diff --git a/source/EduCATS/Pages/Statistics/Results/Views/ViewCells/StatsResultsPageViewCell.cs b/source/EduCATS/Pages/Statistics/Results/Views/ViewCells/StatsResultsPageViewCell.cs index 47793c6c..dfa5cd0c 100644 --- a/source/EduCATS/Pages/Statistics/Results/Views/ViewCells/StatsResultsPageViewCell.cs +++ b/source/EduCATS/Pages/Statistics/Results/Views/ViewCells/StatsResultsPageViewCell.cs @@ -16,7 +16,8 @@ public class StatsResultsPageViewCell : ViewCell public StatsResultsPageViewCell() { - var titleLabel = new Label { + var titleLabel = new Label + { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor), Style = AppStyles.GetLabelStyle() @@ -25,7 +26,8 @@ public StatsResultsPageViewCell() titleLabel.SetBinding(Label.TextProperty, "Title"); titleLabel.SetBinding(VisualElement.IsVisibleProperty, "IsTitle"); - var dateIcon = new CachedImage { + var dateIcon = new CachedImage + { VerticalOptions = LayoutOptions.CenterAndExpand, Source = ImageSource.FromFile(Theme.Current.StatisticsCalendarIcon), HeightRequest = _iconSize, @@ -38,7 +40,8 @@ public StatsResultsPageViewCell() } }; - var dateLabel = new Label { + var dateLabel = new Label + { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsColor), Style = AppStyles.GetLabelStyle(NamedSize.Small) @@ -46,7 +49,8 @@ public StatsResultsPageViewCell() dateLabel.SetBinding(Label.TextProperty, "Date"); - var dateLayout = new StackLayout { + var dateLayout = new StackLayout + { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.CenterAndExpand, Children = { @@ -57,7 +61,8 @@ public StatsResultsPageViewCell() dateLayout.SetBinding(VisualElement.IsVisibleProperty, "IsDate"); - var commentIcon = new CachedImage { + var commentIcon = new CachedImage + { VerticalOptions = LayoutOptions.StartAndExpand, Source = ImageSource.FromFile(Theme.Current.StatisticsCommentIcon), HeightRequest = _iconSize, @@ -70,7 +75,8 @@ public StatsResultsPageViewCell() } }; - var commentLabel = new Label { + var commentLabel = new Label + { VerticalOptions = LayoutOptions.CenterAndExpand, TextColor = Color.FromHex(Theme.Current.StatisticsDetailsColor), Style = AppStyles.GetLabelStyle(NamedSize.Small) @@ -78,7 +84,8 @@ public StatsResultsPageViewCell() commentLabel.SetBinding(Label.TextProperty, "Comment"); - var commentLayout = new StackLayout { + var commentLayout = new StackLayout + { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.CenterAndExpand, Children = { @@ -89,7 +96,8 @@ public StatsResultsPageViewCell() commentLayout.SetBinding(VisualElement.IsVisibleProperty, "IsComment"); - var infoLayout = new StackLayout { + var infoLayout = new StackLayout + { VerticalOptions = LayoutOptions.StartAndExpand, Spacing = _infoSpacing, Children = { @@ -99,16 +107,18 @@ public StatsResultsPageViewCell() } }; - var resultLabel = new Label { + var resultLabel = new Label + { TextColor = Color.FromHex(Theme.Current.StatisticsDetailsResultsColor), HorizontalOptions = LayoutOptions.EndAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, - Style = AppStyles.GetLabelStyle(NamedSize.Large) + Style = AppStyles.GetLabelStyle(NamedSize.Large), }; resultLabel.SetBinding(Label.TextProperty, "Result"); - var gridLayout = new Grid { + var gridLayout = new Grid + { Padding = _gridPadding, VerticalOptions = LayoutOptions.FillAndExpand, ColumnDefinitions = { @@ -120,8 +130,10 @@ public StatsResultsPageViewCell() gridLayout.Children.Add(infoLayout, 0, 0); gridLayout.Children.Add(resultLabel, 1, 0); - View = new StackLayout { - BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), + View = new StackLayout + { + + BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), Children = { gridLayout } diff --git a/source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs b/source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs index c73daf1a..40b4b541 100644 --- a/source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs +++ b/source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs @@ -96,7 +96,8 @@ Button createAddMarksButton() SearchBar createSearchBar() { - var searchBar = new SearchBar { + var searchBar = new SearchBar + { Margin = _searchBarMargin, BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), CancelButtonColor = Color.FromHex(Theme.Current.BaseAppColor), @@ -112,7 +113,8 @@ SearchBar createSearchBar() RoundedListView createRoundedListView(View header) { - var roundedListView = new RoundedListView(typeof(StudentsPageViewCell), header: header) { + var roundedListView = new RoundedListView(typeof(StudentsPageViewCell), header: header) + { IsPullToRefreshEnabled = true }; diff --git a/source/EduCATS/Pages/Statistics/Students/Views/ViewCells/StudentsPageViewCell.cs b/source/EduCATS/Pages/Statistics/Students/Views/ViewCells/StudentsPageViewCell.cs index ae74b8a6..86a6d91f 100644 --- a/source/EduCATS/Pages/Statistics/Students/Views/ViewCells/StudentsPageViewCell.cs +++ b/source/EduCATS/Pages/Statistics/Students/Views/ViewCells/StudentsPageViewCell.cs @@ -10,14 +10,16 @@ public class StudentsPageViewCell : ViewCell public StudentsPageViewCell() { - var nameLabel = new Label { + var nameLabel = new Label + { TextColor = Color.FromHex(Theme.Current.StatisticsBaseTitleColor), Style = AppStyles.GetLabelStyle() }; nameLabel.SetBinding(Label.TextProperty, "Name"); - View = new StackLayout { + View = new StackLayout + { BackgroundColor = Color.FromHex(Theme.Current.BaseBlockColor), Padding = _padding, Children = { diff --git a/source/EduCATS/Pages/Today/Base/Models/SubjectPageModel.cs b/source/EduCATS/Pages/Today/Base/Models/SubjectPageModel.cs index 17579447..c24d7e60 100644 --- a/source/EduCATS/Pages/Today/Base/Models/SubjectPageModel.cs +++ b/source/EduCATS/Pages/Today/Base/Models/SubjectPageModel.cs @@ -12,8 +12,10 @@ public class SubjectPageModel : IRoundedListType public string Name { get; set; } string _teacherFullName; - public string TeacherFullName { - get { + public string TeacherFullName + { + get + { var splitted = _teacherFullName.Split(' '); var surname = ""; var name = ""; @@ -21,44 +23,57 @@ public class SubjectPageModel : IRoundedListType var nameFirstLetter = ""; var patronymicFirstLetter = ""; - if (splitted.Length > 2) { + if (splitted.Length > 2) + { surname = splitted[0]; name = splitted[1]; patronymic = splitted[2]; - } else if (splitted.Length < 3 && splitted.Length > 1) { + } + else if (splitted.Length < 3 && splitted.Length > 1) + { surname = splitted[0]; name = splitted[1]; - } else if (splitted.Length == 1) { + } + else if (splitted.Length == 1) + { surname = splitted[0]; } - if (!string.IsNullOrEmpty(name) && name.Length > 0) { + if (!string.IsNullOrEmpty(name) && name.Length > 0) + { nameFirstLetter = $"{name[0]}"; } - if (!string.IsNullOrEmpty(patronymic) && patronymic.Length > 0) { + if (!string.IsNullOrEmpty(patronymic) && patronymic.Length > 0) + { patronymicFirstLetter = $"{patronymic[0]}"; } if (!string.IsNullOrEmpty(surname) && !string.IsNullOrEmpty(nameFirstLetter) && - !string.IsNullOrEmpty(patronymicFirstLetter)) { + !string.IsNullOrEmpty(patronymicFirstLetter)) + { return $"{surname} {nameFirstLetter}. {patronymicFirstLetter}."; - } else if ( + } + else if ( string.IsNullOrEmpty(patronymicFirstLetter) && !string.IsNullOrEmpty(surname) && - !string.IsNullOrEmpty(nameFirstLetter)) { + !string.IsNullOrEmpty(nameFirstLetter)) + { return $"{surname} {nameFirstLetter}."; - } else if ( + } + else if ( string.IsNullOrEmpty(nameFirstLetter) && string.IsNullOrEmpty(patronymicFirstLetter) && - !string.IsNullOrEmpty(surname)) { + !string.IsNullOrEmpty(surname)) + { return surname; } return string.Empty; } - set { + set + { _teacherFullName = value; } } @@ -73,13 +88,16 @@ public SubjectPageModel(Schedule schedule) void setDefaultProps(Schedule schedule) { - if (schedule != null) { + if (schedule != null) + { Color = schedule.Color; Address = $"{CrossLocalization.Translate("address_building")} {schedule.Building}, {CrossLocalization.Translate("address_room")} {schedule.Audience}"; Date = schedule.Start + "-" + schedule.End; Name = schedule.Name; - switch (schedule.Type) { + + switch (schedule.Type) + { case 0: Type = CrossLocalization.Translate("type_activity_lecture"); break; @@ -89,12 +107,18 @@ void setDefaultProps(Schedule schedule) case 2: Type = CrossLocalization.Translate("type_activity_lab"); break; - + case 3: + Type = CrossLocalization.Translate("type_activity_kconsultation"); + break; + case 4: + Type = CrossLocalization.Translate("type_activity_dconsultation"); + break; default: break; } - if (schedule.Teacher != null) { + if (schedule.Teacher != null) + { TeacherFullName = schedule.Teacher.FullName; } }