Skip to content

Commit

Permalink
[UPDATE/FIX] Visual adjustments to the today main page and mark savin…
Browse files Browse the repository at this point in the history
…g pages
  • Loading branch information
yu-raa committed Mar 3, 2024
1 parent f1b2927 commit 75fb6ad
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
12 changes: 12 additions & 0 deletions source/EduCATS.iOS/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion source/EduCATS/Controls/RoundedListView/RoundedListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class RoundedListView : ListView
double footerBottomPadding = 0,
Func<object> func = null)
{
HasUnevenRows = true;
//HasUnevenRows = true;
ItemTemplate = func == null ?
new RoundedListTemplateSelector(type, checkbox) :
new RoundedListTemplateSelector(func, checkbox);
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> Marks = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
public List<string> NameOfLabOrPractice = new List<string>();
public string _title { get; set; }
Expand Down Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion source/EduCATS/Pages/SaveMarks/SavePractSingle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
13 changes: 9 additions & 4 deletions source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -23,21 +25,23 @@ 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<CalendarSubjectsModel> _calendarSubjectsBackup;

public TodayPageViewModel(double subjectHeight, double subjectsHeaderHeight, IPlatformServices services)
{
_subjectHeight = subjectHeight;
_subjectsHeaderHeight = subjectsHeaderHeight;
_subjectsFooterHeight = subjectsHeaderHeight;
_services = services;

initSetup();
Expand Down Expand Up @@ -179,6 +183,7 @@ void update()
IsNewsRefreshing = true;
await getAndSetCalendarNotes();
await getAndSetNews();
//_isCreation = false;
IsNewsRefreshing = false;
} catch (Exception ex) {
AppLogs.Log(ex);
Expand Down Expand Up @@ -505,8 +510,8 @@ void setupNewsSubjectsHeight()
}

CalendarSubjectsHeight =
(_subjectHeight * NewsSubjectList.Count * 2) +
(_subjectsHeaderHeight) + _subjectsHeightToAdd;
(_subjectHeight * (NewsSubjectList.Count) /** 2*/) +
_subjectsHeaderHeight + _subjectsFooterHeight + _subjectsHeightToAdd;
}
catch (Exception ex)
{
Expand Down
7 changes: 5 additions & 2 deletions source/EduCATS/Pages/Today/Base/Views/TodayPageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -147,6 +147,7 @@ ListView createNewsList()
newsListView.SetBinding(ItemsView<Cell>.ItemsSourceProperty, "NewsList");
newsListView.SetBinding(ListView.SelectedItemProperty, "SelectedNewsItem");
newsListView.ItemSelected += (sender, e) => { ((ListView)sender).SelectedItem = null; };

return newsListView;
}

Expand Down Expand Up @@ -189,6 +190,8 @@ ListView createSubjectsList()
subjectsListView.SetBinding(ItemsView<Cell>.ItemsSourceProperty, "CalendarSubjects");
}



subjectsListView.SetBinding(HeightRequestProperty, "CalendarSubjectsHeight");
return subjectsListView;
}
Expand Down

0 comments on commit 75fb6ad

Please sign in to comment.