From 75fb6ad7de897bb637e58aa434a24f515ec3c7b1 Mon Sep 17 00:00:00 2001 From: Yuliya Raikova Date: Sun, 3 Mar 2024 10:22:09 +0300 Subject: [PATCH] [UPDATE/FIX] Visual adjustments to the today main page and mark saving pages --- source/EduCATS.iOS/packages.lock.json | 12 ++++++++++++ .../Controls/RoundedListView/RoundedListView.cs | 3 ++- .../Views/SaveSingleStudentMarkPageView.cs | 4 +++- source/EduCATS/Pages/SaveMarks/SavePractSingle.cs | 2 +- .../Today/Base/ViewModels/TodayPageViewModel.cs | 13 +++++++++---- .../EduCATS/Pages/Today/Base/Views/TodayPageView.cs | 7 +++++-- 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/source/EduCATS.iOS/packages.lock.json b/source/EduCATS.iOS/packages.lock.json index 784c10ce..6242fe76 100644 --- a/source/EduCATS.iOS/packages.lock.json +++ b/source/EduCATS.iOS/packages.lock.json @@ -291,6 +291,18 @@ "contentHash": "WG3r7EyjUe9CMPFSs6bty5doUqT+q9pbI80hlNzo2SkPkZ4VTuZkGWjpp77JB8+uaL4DFPRdBsAY+DX3dBK92A==" } }, + "Xamarin.iOS,Version=v1.0/win-arm64": { + "SkiaSharp": { + "type": "Transitive", + "resolved": "2.80.2", + "contentHash": "D25rzdCwh+3L+XyXqpNa+H/yiLJbE3/R3K/XexwHyQjGdzZvSufFW3oqf3En7hhqSIsxsJ8f5NEZ0J5W5wlGBg==" + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "WG3r7EyjUe9CMPFSs6bty5doUqT+q9pbI80hlNzo2SkPkZ4VTuZkGWjpp77JB8+uaL4DFPRdBsAY+DX3dBK92A==" + } + }, "Xamarin.iOS,Version=v1.0/win-x64": { "SkiaSharp": { "type": "Transitive", diff --git a/source/EduCATS/Controls/RoundedListView/RoundedListView.cs b/source/EduCATS/Controls/RoundedListView/RoundedListView.cs index e3c393c2..4e920271 100644 --- a/source/EduCATS/Controls/RoundedListView/RoundedListView.cs +++ b/source/EduCATS/Controls/RoundedListView/RoundedListView.cs @@ -55,7 +55,7 @@ public class RoundedListView : ListView double footerBottomPadding = 0, Func func = null) { - HasUnevenRows = true; + //HasUnevenRows = true; ItemTemplate = func == null ? new RoundedListTemplateSelector(type, checkbox) : new RoundedListTemplateSelector(func, checkbox); @@ -142,6 +142,7 @@ Grid createFooterCap(double bottomPadding) }; var frame = new Frame { + Padding = new Thickness(0, 0, 0, bottomPadding), HasShadow = false, CornerRadius = (float)_capHeight, BackgroundColor = Color.FromHex(Theme.Current.RoundedListViewBackgroundColor) diff --git a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs index 49ca2e8b..264eca33 100644 --- a/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs +++ b/source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs @@ -20,6 +20,7 @@ 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; } @@ -56,10 +57,11 @@ 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.Bold), + Font = Font.SystemFontOfSize(NamedSize.Large).WithSize(20).WithAttributes(FontAttributes.None), Text = name, }; diff --git a/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs b/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs index 2e034541..72b258d5 100644 --- a/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs +++ b/source/EduCATS/Pages/SaveMarks/SavePractSingle.cs @@ -7,7 +7,7 @@ namespace EduCATS.Pages.SaveMarks { public class SavePractSingle { - [JsonProperty("comment")] + [JsonProperty("Comment")] public string Comment { get; set; } public string date { get; set; } public int id { get; set; } diff --git a/source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs b/source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs index 283e9c2b..819a6cee 100644 --- a/source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs +++ b/source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using EduCATS.Controls.RoundedListView; using EduCATS.Data; using EduCATS.Data.Models; using EduCATS.Data.Models.Calendar; @@ -12,6 +13,7 @@ using EduCATS.Helpers.Forms; using EduCATS.Helpers.Logs; using EduCATS.Pages.Today.Base.Models; +using EduCATS.Pages.Today.Base.Views; using EduCATS.Themes; using Nyxbull.Plugins.CrossLocalization; using Xamarin.Forms; @@ -23,13 +25,15 @@ public class TodayPageViewModel : ViewModel readonly IPlatformServices _services; readonly double _subjectHeight; - readonly double _subjectsHeaderHeight; + readonly double _subjectsFooterHeight; + readonly double _subjectsHeaderHeight = 71; const int _minimumCalendarPosition = 0; const int _maximumCalendarPosition = 2; const double _subjectsHeightToAdd = 55; const double _emptySubjectsHeight = 110; + // bool _isCreation = true; bool _isManualSelectedCalendarDay; DateTime _manualSelectedCalendarDay; List _calendarSubjectsBackup; @@ -37,7 +41,7 @@ public class TodayPageViewModel : ViewModel public TodayPageViewModel(double subjectHeight, double subjectsHeaderHeight, IPlatformServices services) { _subjectHeight = subjectHeight; - _subjectsHeaderHeight = subjectsHeaderHeight; + _subjectsFooterHeight = subjectsHeaderHeight; _services = services; initSetup(); @@ -179,6 +183,7 @@ void update() IsNewsRefreshing = true; await getAndSetCalendarNotes(); await getAndSetNews(); + //_isCreation = false; IsNewsRefreshing = false; } catch (Exception ex) { AppLogs.Log(ex); @@ -505,8 +510,8 @@ void setupNewsSubjectsHeight() } CalendarSubjectsHeight = - (_subjectHeight * NewsSubjectList.Count * 2) + - (_subjectsHeaderHeight) + _subjectsHeightToAdd; + (_subjectHeight * (NewsSubjectList.Count) /** 2*/) + + _subjectsHeaderHeight + _subjectsFooterHeight + _subjectsHeightToAdd; } catch (Exception ex) { diff --git a/source/EduCATS/Pages/Today/Base/Views/TodayPageView.cs b/source/EduCATS/Pages/Today/Base/Views/TodayPageView.cs index 33a56cb8..1afc9a8c 100644 --- a/source/EduCATS/Pages/Today/Base/Views/TodayPageView.cs +++ b/source/EduCATS/Pages/Today/Base/Views/TodayPageView.cs @@ -20,11 +20,11 @@ public class TodayPageView : ContentPage const double _calendarDaysOfWeekCollectionHeight = 50; const string _calendarCollectionDataBinding = "."; - double _subjectRowHeight = 50; + double _subjectRowHeight = 80; double _subjectDetailedRowHeight = 80; static Thickness _newsLabelMagin = new Thickness(10); - static Thickness _subjectsMargin = new Thickness(10, 5); + static Thickness _subjectsMargin = new Thickness(10, 5, 10, 0); static Thickness _margin = new Thickness(0, 0, 0, 1); static Thickness _listMargin = new Thickness(0, 1, 0, 0); static Thickness _subjectsLabelMargin = new Thickness(0, 10, 10, 10); @@ -147,6 +147,7 @@ ListView createNewsList() newsListView.SetBinding(ItemsView.ItemsSourceProperty, "NewsList"); newsListView.SetBinding(ListView.SelectedItemProperty, "SelectedNewsItem"); newsListView.ItemSelected += (sender, e) => { ((ListView)sender).SelectedItem = null; }; + return newsListView; } @@ -189,6 +190,8 @@ ListView createSubjectsList() subjectsListView.SetBinding(ItemsView.ItemsSourceProperty, "CalendarSubjects"); } + + subjectsListView.SetBinding(HeightRequestProperty, "CalendarSubjectsHeight"); return subjectsListView; }