Skip to content

Commit e9c9402

Browse files
committed
Timetable preview fix, inline long breaks, class IDs
1 parent 925b1f7 commit e9c9402

File tree

11 files changed

+271
-61
lines changed

11 files changed

+271
-61
lines changed

assets/resources/strings/de.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,14 @@
22932293
{
22942294
"id": "64D1FFB7-0CF9-43D1-8B74-998F2AB6CAA6",
22952295
"translation": "User session not active!"
2296+
},
2297+
{
2298+
"id": "DDD07FF6-9A27-4F9E-B7FD-B5F0A2094C9E",
2299+
"translation": "Break: lessons {} - {}"
2300+
},
2301+
{
2302+
"id": "2B271B34-8698-48C9-911F-12DC5FAEB100",
2303+
"translation": "Break: {} - {}"
22962304
}
22972305
],
22982306
"splashes": [

assets/resources/strings/en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,14 @@
22932293
{
22942294
"id": "64D1FFB7-0CF9-43D1-8B74-998F2AB6CAA6",
22952295
"translation": "User session not active!"
2296+
},
2297+
{
2298+
"id": "DDD07FF6-9A27-4F9E-B7FD-B5F0A2094C9E",
2299+
"translation": "Break: lessons {} - {}"
2300+
},
2301+
{
2302+
"id": "2B271B34-8698-48C9-911F-12DC5FAEB100",
2303+
"translation": "Break: {} - {}"
22962304
}
22972305
],
22982306
"splashes": [

assets/resources/strings/pl.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,14 @@
22932293
{
22942294
"id": "64D1FFB7-0CF9-43D1-8B74-998F2AB6CAA6",
22952295
"translation": "Sesja użytkownika wygasła!"
2296+
},
2297+
{
2298+
"id": "DDD07FF6-9A27-4F9E-B7FD-B5F0A2094C9E",
2299+
"translation": "Okienko: lekcje {} - {}"
2300+
},
2301+
{
2302+
"id": "2B271B34-8698-48C9-911F-12DC5FAEB100",
2303+
"translation": "Okienko: {} - {}"
22962304
}
22972305
],
22982306
"splashes": [

lib/interface/components/cupertino/elements/event.dart

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ extension LessonWidgetExtension on TimetableLesson {
640640
onPressed: () {
641641
try {
642642
calendar.Add2Calendar.addEvent2Cal(calendar.Event(
643-
title: subject?.name ?? '6BB62617-7000-4A27-A499-534F1E04764E'.localized.format(DateFormat("EEEE, MMM d, y").format(date)),
643+
title: subject?.name ??
644+
'6BB62617-7000-4A27-A499-534F1E04764E'.localized.format(DateFormat("EEEE, MMM d, y").format(date)),
644645
location: classroom?.name,
645646
startDate: timeFrom ?? date,
646647
endDate: timeTo ?? date));
@@ -682,10 +683,12 @@ extension LessonWidgetExtension on TimetableLesson {
682683
context: context,
683684
builder: (context) => MessageComposePage(
684685
receivers: teacher != null ? [teacher!] : [],
685-
subject:
686-
'4DF5CFE9-2B5F-4AE1-AEFC-B4B8888A09ED'.localized.format(lessonCallMessageString, DateFormat("y.M.d").format(date), lessonNo),
687-
message:
688-
'7955E73E-D260-43BA-8E2F-88CD43348BBD'.localized.format(lessonCallMessageString, subject?.name, DateFormat("y.M.d").format(date), lessonNo),
686+
subject: '4DF5CFE9-2B5F-4AE1-AEFC-B4B8888A09ED'
687+
.localized
688+
.format(lessonCallMessageString, DateFormat("y.M.d").format(date), lessonNo),
689+
message: '7955E73E-D260-43BA-8E2F-88CD43348BBD'
690+
.localized
691+
.format(lessonCallMessageString, subject?.name, DateFormat("y.M.d").format(date), lessonNo),
689692
signature:
690693
'${Share.session.data.student.account.name}, ${Share.session.data.student.mainClass.name}'));
691694
},
@@ -700,7 +703,9 @@ extension LessonWidgetExtension on TimetableLesson {
700703
context: context,
701704
builder: (context) => MessageComposePage(
702705
receivers: teacher != null ? [teacher!] : [],
703-
subject: '50CFA04B-E8EB-4BC9-80F1-C5EF39FE8F3A'.localized.format(DateFormat("y.M.d").format(date), lessonNo),
706+
subject: '50CFA04B-E8EB-4BC9-80F1-C5EF39FE8F3A'
707+
.localized
708+
.format(DateFormat("y.M.d").format(date), lessonNo),
704709
signature:
705710
'${Share.session.data.student.account.name}, ${Share.session.data.student.mainClass.name}'));
706711
},
@@ -826,6 +831,24 @@ extension LessonWidgetExtension on TimetableLesson {
826831
],
827832
)),
828833
lessonNo >= 0)
834+
.appendIf(
835+
AdaptiveCard(
836+
child: Row(
837+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
838+
children: [
839+
Text('B96EA577-6DBF-491C-9781-9C85CCBD4119'.localized),
840+
Flexible(
841+
child: Container(
842+
margin: EdgeInsets.only(left: 3, top: 5, bottom: 5),
843+
child: Opacity(
844+
opacity: 0.5,
845+
child: Text(lessonClass?.className ?? '',
846+
maxLines: 3,
847+
overflow: TextOverflow.ellipsis,
848+
textAlign: TextAlign.end))))
849+
],
850+
)),
851+
lessonClass?.className.isNotEmpty ?? false)
829852
// Substitution details - original lesson
830853
.appendIf(
831854
AdaptiveCard(
@@ -870,7 +893,9 @@ extension LessonWidgetExtension on TimetableLesson {
870893
child: Row(
871894
mainAxisAlignment: MainAxisAlignment.spaceBetween,
872895
children: [
873-
Text(isCanceled ? '43026DF3-97E9-4449-BD20-D1E256C42F89'.localized : '8A2F8A9D-1428-4EAA-BA31-CE64A64789C6'.localized),
896+
Text(isCanceled
897+
? '43026DF3-97E9-4449-BD20-D1E256C42F89'.localized
898+
: '8A2F8A9D-1428-4EAA-BA31-CE64A64789C6'.localized),
874899
Flexible(
875900
child: Container(
876901
margin: EdgeInsets.only(left: 3, top: 5, bottom: 5),

lib/interface/components/material/data_page.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
2-
import 'package:autoscale_tabbarview/autoscale_tabbarview.dart';
2+
import 'package:contentsize_tabbarview/contentsize_tabbarview.dart';
33
import 'package:darq/darq.dart';
44
import 'package:dynamic_color/dynamic_color.dart';
55
import 'package:enum_flag/enum_flag.dart';
@@ -247,9 +247,8 @@ class DataPageState extends State<DataPage> with TickerProviderStateMixin {
247247
)
248248
: Column(
249249
children: [
250-
AutoScaleTabBarView(
250+
ContentSizeTabBarView(
251251
controller: tabController,
252-
// viewportFraction: MediaQuery.of(context).size.width >= 640 ? (1 / 3) : 1.0,
253252
children: List.generate(widget.segments!.length,
254253
(index) => widget.pageBuilder!(context, widget.segments!.keys.elementAt(index))),
255254
),

lib/interface/components/material/elements/event.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,13 @@ extension LessonWidgetExtension on TimetableLesson {
707707
after: lessonNo.toString(),
708708
),
709709
lessonNo >= 0)
710+
.appendIf(
711+
AdaptiveCard(
712+
child: 'B96EA577-6DBF-491C-9781-9C85CCBD4119'.localized,
713+
regular: true,
714+
after: lessonClass?.className ?? '',
715+
),
716+
lessonClass?.className.isNotEmpty ?? false)
710717
// Substitution details - original lesson
711718
.appendIf(
712719
AdaptiveCard(

lib/interface/shared/pages/home.dart

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class _HomePageState extends VisibilityAwareState<HomePage> {
622622
.appendIf(homeworksWidget, homeworksLast)
623623
.toList()
624624
:
625-
// ---------- Material home screen ----------
625+
// ---------- Material home screen ----------
626626
<Widget>[
627627
CardContainer(
628628
radius: 25,
@@ -769,36 +769,37 @@ class _HomePageState extends VisibilityAwareState<HomePage> {
769769
child: Container(
770770
margin: EdgeInsets.only(),
771771
child: Row(
772+
crossAxisAlignment: CrossAxisAlignment.start,
772773
children: [
773-
Text(
774-
// If the "next" lesson is the first one
775-
(nextLesson != null &&
776-
(currentDay?.lessonsStrippedCancelled
777-
.firstWhereOrDefault(
778-
(l) => l?.any((x) => !x.isCanceled) ?? false)
779-
?.any((x) => x == nextLesson) ??
780-
false))
781-
? 'D8F15F8A-2EA6-474D-80B8-E71625B3D121'.localized
782-
: // If the "next" lesson is the last one
774+
Text(
775+
// If the "next" lesson is the first one
783776
(nextLesson != null &&
784777
(currentDay?.lessonsStrippedCancelled
785-
.lastWhereOrDefault(
778+
.firstWhereOrDefault(
786779
(l) => l?.any((x) => !x.isCanceled) ?? false)
787780
?.any((x) => x == nextLesson) ??
788781
false))
789-
? '6B3280B8-EDDB-44E2-A2D5-824FE98E8247'.localized
790-
: '2754A69F-9E60-4FDA-903B-95CFAB85E982'.localized,
791-
style: TextStyle(fontWeight: FontWeight.w500),
792-
),
793-
Flexible(
794-
child: Container(
795-
margin: EdgeInsets.only(right: 3, left: 3),
796-
child: Text(
797-
nextLesson?.subject?.name ??
798-
'/Notifications/Placeholder/Lesson'.localized,
799-
style: TextStyle(fontWeight: FontWeight.w500),
800-
))),
801-
].appendIf(
782+
? 'D8F15F8A-2EA6-474D-80B8-E71625B3D121'.localized
783+
: // If the "next" lesson is the last one
784+
(nextLesson != null &&
785+
(currentDay?.lessonsStrippedCancelled
786+
.lastWhereOrDefault((l) =>
787+
l?.any((x) => !x.isCanceled) ?? false)
788+
?.any((x) => x == nextLesson) ??
789+
false))
790+
? '6B3280B8-EDDB-44E2-A2D5-824FE98E8247'.localized
791+
: '2754A69F-9E60-4FDA-903B-95CFAB85E982'.localized,
792+
style: TextStyle(fontWeight: FontWeight.w500),
793+
),
794+
Flexible(
795+
child: Container(
796+
margin: EdgeInsets.only(right: 6, left: 6),
797+
child: Text(
798+
nextLesson?.subject?.name ??
799+
'/Notifications/Placeholder/Lesson'.localized,
800+
style: TextStyle(fontWeight: FontWeight.w500),
801+
))),
802+
].appendIf(
802803
Text(
803804
'C33F8288-5BAD-4574-9C53-B54FED6757AC'
804805
.localized
@@ -831,25 +832,26 @@ class _HomePageState extends VisibilityAwareState<HomePage> {
831832
crossAxisAlignment: CrossAxisAlignment.start,
832833
children: [
833834
Row(
835+
crossAxisAlignment: CrossAxisAlignment.start,
834836
children: [
835-
Text(
836-
'First:',
837-
style: TextStyle(fontWeight: FontWeight.w500),
838-
),
839-
Flexible(
840-
child: Container(
841-
margin: EdgeInsets.only(right: 3, left: 3),
842-
child: Text(
843-
nextDay?.lessonsStrippedCancelled
844-
.firstWhereOrDefault(
845-
(x) => x?.any((y) => !y.isCanceled) ?? false)
846-
?.firstWhereOrDefault((x) => !x.isCanceled)
847-
?.subject
848-
?.name ??
849-
'/Notifications/Placeholder/Lesson'.localized,
850-
style: TextStyle(fontWeight: FontWeight.w500),
851-
))),
852-
].appendIf(
837+
Text(
838+
'D8F15F8A-2EA6-474D-80B8-E71625B3D121'.localized,
839+
style: TextStyle(fontWeight: FontWeight.w500),
840+
),
841+
Flexible(
842+
child: Container(
843+
margin: EdgeInsets.only(right: 6, left: 6),
844+
child: Text(
845+
nextDay?.lessonsStrippedCancelled
846+
.firstWhereOrDefault(
847+
(x) => x?.any((y) => !y.isCanceled) ?? false)
848+
?.firstWhereOrDefault((x) => !x.isCanceled)
849+
?.subject
850+
?.name ??
851+
'/Notifications/Placeholder/Lesson'.localized,
852+
style: TextStyle(fontWeight: FontWeight.w500),
853+
))),
854+
].appendIf(
853855
Text(
854856
'C33F8288-5BAD-4574-9C53-B54FED6757AC'.localized.format(nextDay
855857
?.lessonsStrippedCancelled

0 commit comments

Comments
 (0)