Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Bring main up to date #521

Merged
merged 15 commits into from
Feb 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Design/login (#513)
* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text
AW-tum authored Nov 10, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 475c7e7cac9c1981d8a5bf1638b4aab3e2f590c6
4 changes: 0 additions & 4 deletions Campus-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -226,7 +226,6 @@
36BBE7342798B04D0018FD3F /* NewsSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36BBE7332798B04D0018FD3F /* NewsSource.swift */; };
36C70FB128538A190097416E /* PanelContentCafeteriasListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36C70FB028538A190097416E /* PanelContentCafeteriasListView.swift */; };
36C70FB32854D2AB0097416E /* PanelContentStudyGroupsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36C70FB22854D2AB0097416E /* PanelContentStudyGroupsListView.swift */; };
36E964A32774932B0055777F /* CalendarToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E964A22774932B0055777F /* CalendarToolbar.swift */; };
36E964A5277493D90055777F /* CalendarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E964A4277493D90055777F /* CalendarViewModel.swift */; };
36E964A7277498540055777F /* CalendarContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E964A6277498540055777F /* CalendarContentView.swift */; };
36E964AA277498B60055777F /* KVKCalendar in Frameworks */ = {isa = PBXBuildFile; productRef = 36E964A9277498B60055777F /* KVKCalendar */; };
@@ -498,7 +497,6 @@
36BBE7332798B04D0018FD3F /* NewsSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewsSource.swift; sourceTree = "<group>"; };
36C70FB028538A190097416E /* PanelContentCafeteriasListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PanelContentCafeteriasListView.swift; sourceTree = "<group>"; };
36C70FB22854D2AB0097416E /* PanelContentStudyGroupsListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PanelContentStudyGroupsListView.swift; sourceTree = "<group>"; };
36E964A22774932B0055777F /* CalendarToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarToolbar.swift; sourceTree = "<group>"; };
36E964A4277493D90055777F /* CalendarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewModel.swift; sourceTree = "<group>"; };
36E964A6277498540055777F /* CalendarContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarContentView.swift; sourceTree = "<group>"; };
36E964AB277499860055777F /* CalendarDisplayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarDisplayView.swift; sourceTree = "<group>"; };
@@ -1468,7 +1466,6 @@
36E9649F277492B70055777F /* Views */ = {
isa = PBXGroup;
children = (
36E964A22774932B0055777F /* CalendarToolbar.swift */,
36E964A6277498540055777F /* CalendarContentView.swift */,
36E964AB277499860055777F /* CalendarDisplayView.swift */,
36AD5CF327B8C83500DAE143 /* CalendarSingleEventView.swift */,
@@ -1722,7 +1719,6 @@
36BB6F7027B1197400F224AB /* Profile.swift in Sources */,
08D0703A28776DD6004140B1 /* TextWidgetView.swift in Sources */,
08FAFD15287DC484006A0E27 /* CalendarWidgetView.swift in Sources */,
36E964A32774932B0055777F /* CalendarToolbar.swift in Sources */,
3654F3762851710E008AD5DC /* RoomFinderViewModel.swift in Sources */,
36108BC427A3046B007DC62D /* LectureDetailsDetailedInfoRowView.swift in Sources */,
36108C1C27A307FA007DC62D /* GradesView.swift in Sources */,
4 changes: 2 additions & 2 deletions Campus-iOS/App.swift
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ struct CampusApp: App {
if UIDevice.current.userInterfaceIdiom == .phone {
NavigationView {
WidgetScreen(model: model)
//.navigationTitle("My Widgets")

.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
ProfileToolbar(model: model)
@@ -95,7 +95,7 @@ struct CampusApp: App {
.navigationViewStyle(.stack)
.tag(0)
.tabItem {
Label("My Widgets", systemImage: "rectangle.3.group").environment(\.symbolVariants, .none)
Label("Home", systemImage: "rectangle.3.group").environment(\.symbolVariants, .none)
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "TUMLogo_oZ_Vollfl_negativ_RGB.png",
"filename" : "TUM2.png",
"idiom" : "universal",
"scale" : "1x"
},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
21 changes: 21 additions & 0 deletions Campus-iOS/Assets.xcassets/set-permissions.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "set-permissions.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion Campus-iOS/CalendarComponent/Views/CalendarContentView.swift
Original file line number Diff line number Diff line change
@@ -71,7 +71,12 @@ struct CalendarContentView: View {
}
.toolbar {
ToolbarItemGroup(placement: .navigationBarLeading) {
CalendarToolbar(viewModel: self.viewModel, selectedEventID: self.$selectedEventID, isTodayPressed: self.$isTodayPressed)
Button(action: {
self.isTodayPressed = true
selectedType = .day
}) {
Text("Today")
}
}
ToolbarItem(placement: .principal) {
Picker("Calendar Type", selection: $selectedType) {
@@ -88,6 +93,7 @@ struct CalendarContentView: View {
}
}
}
.opacity(1.0)
.pickerStyle(.segmented)
.onAppear {
UISegmentedControl.appearance().backgroundColor = UIColor.systemBlue.withAlphaComponent(0.2)
52 changes: 0 additions & 52 deletions Campus-iOS/CalendarComponent/Views/CalendarToolbar.swift

This file was deleted.

5 changes: 4 additions & 1 deletion Campus-iOS/CalendarComponent/Views/CalendarWidgetView.swift
Original file line number Diff line number Diff line change
@@ -51,7 +51,10 @@ struct CalendarWidgetView: View {
showDetails.toggle()
}
.sheet(isPresented: $showDetails) {
CalendarContentView(model: model, refresh: .constant(false))
VStack {
Spacer().frame(height: 10)
CalendarContentView(model: model, refresh: .constant(false))
}
}
.expandable(size: $size, initialSize: initialSize, scale: $scale)
}
1 change: 1 addition & 0 deletions Campus-iOS/Campus-iOS/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -179,6 +179,7 @@

// Map
"Search ..." = "Search ...";
"Traffic" = "Traffic";

// Movies
"No more movies this semester 😢\nGet excited for the next season!" = "No more movies this semester 😢\nGet excited for the next season!";
1 change: 1 addition & 0 deletions Campus-iOS/Campus-iOS/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -173,6 +173,7 @@

// Map
"Search ..." = "Suchen ...";
"Traffic" = "Auslastung";

// Movies
"No more movies this semester 😢\nGet excited for the next season!" = "Keine Filme mehr dieses Semester 😢\nMacht euch ready für die nächste Saison!";
12 changes: 6 additions & 6 deletions Campus-iOS/GradesComponent/Views/GradeView.swift
Original file line number Diff line number Diff line change
@@ -36,34 +36,34 @@ struct GradeView: View {
VStack(alignment: .leading, spacing: 8) {
HStack(spacing: 16) {
HStack {
Image(systemName: "pencil.circle.fill")
Image(systemName: "pencil.circle")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(grade.modusShort)
.font(.system(size: 12))
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity)

HStack {
Image(systemName: "number.circle.fill")
Image(systemName: "number.circle")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(grade.lvNumber)
.font(.system(size: 12))
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity)
}.foregroundColor(.init(.darkGray))

HStack {
Image(systemName: "person.circle.fill")
Image(systemName: "person.circle")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(grade.examiner)
.font(.system(size: 12))
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
.fixedSize(horizontal: false, vertical: true)
}.foregroundColor(.init(.darkGray))
9 changes: 3 additions & 6 deletions Campus-iOS/GradesComponent/Views/GradesView.swift
Original file line number Diff line number Diff line change
@@ -32,12 +32,9 @@ struct GradesView: View {
}

ForEach(self.vm.gradesByDegreeAndSemester[index].1, id: \.0) { gradesBySemester in
Section(
header:
GroupBoxLabelView(
iconName: "graduationcap.fill",
text: gradesBySemester.0
)
Section(header: Text(gradesBySemester.0)
.font(.headline.bold())
.foregroundColor(Color("tumBlue"))
) {
ForEach(gradesBySemester.1) { item in
VStack {
Original file line number Diff line number Diff line change
@@ -62,12 +62,16 @@ struct LectureDetailsBasicInfoView: View {
text: lectureDetails.organisation
)
Divider()
LectureDetailsBasicInfoRowView(
iconName: "person.fill",
text: lectureDetails.speaker
)
.onTapGesture {
self.showActionSheet = true
HStack {
LectureDetailsBasicInfoRowView(
iconName: "person.fill",
text: lectureDetails.speaker
)
Spacer()
Button(
action: { self.showActionSheet = true },
label: { Image(systemName: "magnifyingglass").foregroundColor(.blue) }
)
}
if let firstMeeting = lectureDetails.firstScheduledDate {
Divider()
13 changes: 6 additions & 7 deletions Campus-iOS/LectureComponent/Views/LectureView.swift
Original file line number Diff line number Diff line change
@@ -15,38 +15,37 @@ struct LectureView: View {
VStack(alignment: .leading, spacing: 8) {
Text(lecture.title)
.bold()
.font(.title3)

HStack(spacing: 16) {
HStack {
Image(systemName: "pencil.circle.fill")
Image(systemName: "pencil.circle")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(lecture.eventType)
.font(.subheadline)
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity)

HStack {
Image(systemName: "clock.fill")
Image(systemName: "clock")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(lecture.duration + " SWS")
.font(.subheadline)
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity)
}.foregroundColor(.init(.darkGray))

HStack {
Image(systemName: "person.circle.fill")
Image(systemName: "person.circle")
.frame(width: 12, height: 12)
.foregroundColor(Color("tumBlue"))
Text(lecture.speaker)
.font(.subheadline)
.font(.footnote)
.foregroundColor(colorScheme == .dark ? .init(UIColor.lightGray) : .init(UIColor.darkGray))
.fixedSize(horizontal: false, vertical: true)
}.foregroundColor(.init(.darkGray))
8 changes: 3 additions & 5 deletions Campus-iOS/LectureComponent/Views/LecturesView.swift
Original file line number Diff line number Diff line change
@@ -29,11 +29,9 @@ struct LecturesView: View {
var body: some View {
List {
ForEach(lecturesBySemesterSearchResult, id: \.0) { lecturesBySemester in
Section(
header: GroupBoxLabelView(
iconName: "graduationcap.fill",
text: lecturesBySemester.0
)
Section(header: Text(lecturesBySemester.0)
.font(.headline.bold())
.foregroundColor(Color("tumBlue"))
) {
ForEach(lecturesBySemester.1) { item in
VStack {
39 changes: 9 additions & 30 deletions Campus-iOS/LoginComponent/Views/LoginView.swift
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@ struct LoginView: View {
@ObservedObject var viewModel: LoginViewModel
@FocusState private var focusedField: Field?

@State var isActive = true

@State var logInState: LoginViewModel.LoginState = .notChecked
@State var showLoginAlert: Bool = false
@State var buttonBackgroundColor: Color = .tumBlue
@@ -108,7 +110,7 @@ struct LoginView: View {
switch result {
case .success:
withAnimation() {
buttonBackgroundColor = .green
buttonBackgroundColor = .blue
logInState = .loggedIn
}
print("Log in Successfull")
@@ -148,20 +150,12 @@ struct LoginView: View {
}
}
case .loggedIn:
HStack {
Image(systemName: "checkmark.circle.fill")
Text("Log in Successfull")
}
.lineLimit(1)
.font(.title3)
.frame(alignment: .center)
.onAppear() {
Task {
try? await Task.sleep(nanoseconds: 1_500_000_000)
withAnimation() {
showLoginButton = false
}
}
NavigationLink(destination:
TokenConfirmationView(viewModel: self.viewModel).navigationBarTitle(Text("Check Token")), isActive: $isActive) {
Text("Log in 🎓")
.lineLimit(1)
.font(.title3)
.frame(alignment: .center)
}
}

@@ -175,21 +169,6 @@ struct LoginView: View {
.cornerRadius(10)
.buttonStyle(.plain)
}


if !showLoginButton {
NavigationLink(destination:
TokenConfirmationView(viewModel: self.viewModel).navigationBarTitle(Text("Check Token"))) {
Text("Next")
.font(.body)
.frame(width: 200, height: 48, alignment: .center)
.foregroundColor(.white)
.background(.green)
.cornerRadius(10)
.buttonStyle(.plain)
}
}


Spacer().frame(height: 20)

164 changes: 81 additions & 83 deletions Campus-iOS/LoginComponent/Views/TokenConfirmationView.swift
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ struct TokenConfirmationView: View {
@State var showCheckTokenButton: Bool = true
@State var showTUMOnline = false
@State var currentStep: Int = 1
@State var isActive = true

/// The `LoginViewModel` that manages the content of the login screen
@ObservedObject var viewModel: LoginViewModel

@@ -102,102 +104,97 @@ struct TokenConfirmationView: View {
.shadow(radius: 10)
// Video is 2532 x 1170
.frame(width: screenWidth*0.109*5, height: screenWidth*0.185*5, alignment: .center)


VStack {
Spacer()

Button {
self.showTUMOnline = true
} label: {
HStack {
Image(systemName: "globe")
Text("Open TUMOnline")
HStack {
Spacer()
Button {
self.showTUMOnline = true
} label: {
HStack {
Image(systemName: "globe")
Text("Open TUMOnline")
}
.lineLimit(1)
.font(.system(size: 14, weight: .bold))
.frame(width: 150, height: 48, alignment: .center)
}
.lineLimit(1).font(.body)
.frame(width: 200, height: 48, alignment: .center)
}
.font(.title)
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)

Spacer()

if !tokenPermissionButton {
Button(action: {
self.viewModel.checkAuthorization() { result in
switch result {
case .success:
withAnimation {
tokenState = .active
buttonBackgroundColor = .green
showTokenHelp = false
}
case .failure(_):
withAnimation {
tokenState = .inactive
buttonBackgroundColor = .red
showTokenHelp = true
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)
.padding()

Spacer()

if !tokenPermissionButton {
Button(action: {
self.viewModel.checkAuthorization() { result in
switch result {
case .success:
withAnimation {
tokenState = .active
buttonBackgroundColor = .green
showTokenHelp = false
}
case .failure(_):
withAnimation {
tokenState = .inactive
buttonBackgroundColor = .red
showTokenHelp = true
}
}
}
}
}) {
switch tokenState {
case .notChecked:
Text("Check Token").lineLimit(1).font(.body)
case .inactive:
VStack {
HStack {
Image(systemName: "x.circle.fill")
Text("Token inactive").lineLimit(1).font(.body)
}) {
switch tokenState {
case .notChecked:
Text("Check Token")
.lineLimit(1)
.font(.system(size: 14, weight: .bold))
case .inactive:
VStack {
HStack {
Text("Token inactive")
.lineLimit(1)
.font(.system(size: 14, weight: .bold))
}
}
}
.padding()
.onAppear() {
Task {
try? await Task.sleep(nanoseconds: 1_500_000_000)
withAnimation(.easeInOut) {
tokenState = .notChecked
buttonBackgroundColor = .tumBlue
.padding()
.onAppear() {
Task {
try? await Task.sleep(nanoseconds: 1_500_000_000)
withAnimation(.easeInOut) {
tokenState = .notChecked
buttonBackgroundColor = .tumBlue
}
}
}
}
case .active:
HStack {
Image(systemName: "checkmark.circle.fill")
Text("Token active").lineLimit(1).font(.body)
}
.padding()
.onAppear() {
Task {
try? await Task.sleep(nanoseconds: 3_000_000_000)
withAnimation() {
tokenPermissionButton = true
// showCheckTokenButton = false
case .active:
if let model = self.viewModel.model {
NavigationLink(destination: TokenPermissionsView(viewModel: TokenPermissionsViewModel(model: model)).navigationTitle("Check Permissions"), isActive: $isActive) {
Text("Next")
.lineLimit(1)
.font(.body)
.frame(width: 200, height: 48, alignment: .center)
.foregroundColor(.white)
.background(.green)
.cornerRadius(10)
.buttonStyle(.plain)
}
}
}
}
.frame(width: 150, height: 48, alignment: .center)
.font(.system(size: 14, weight: .bold))
.foregroundColor(.white)
.background(buttonBackgroundColor)
.cornerRadius(10)
.buttonStyle(.plain)
.padding()
}
.frame(width: 200, height: 48, alignment: .center)
.font(.title)
.foregroundColor(.white)
.background(buttonBackgroundColor)
.cornerRadius(10)
.buttonStyle(.plain)
}

if tokenPermissionButton, let model = self.viewModel.model {
NavigationLink(destination: TokenPermissionsView(viewModel: TokenPermissionsViewModel(model: model)).navigationTitle("Check Permissions")) {
Text("Next")
.lineLimit(1)
.font(.body)
.frame(width: 200, height: 48, alignment: .center)
.foregroundColor(.white)
.background(.green)
.cornerRadius(10)
.buttonStyle(.plain)
}
Spacer()
}

if showTokenHelp {
@@ -226,9 +223,10 @@ struct TokenConfirmationView: View {
self.showBackButtonAlert = true
}) {
HStack {
Image(systemName: "arrow.left")
Image(systemName: "chevron.left")
Text("Back")
}.foregroundColor(Color(.tumBlue))
}
.foregroundColor(Color(.tumBlue))
}
)
.alert(isPresented: $showBackButtonAlert) {
110 changes: 67 additions & 43 deletions Campus-iOS/LoginComponent/Views/TokenPermissionsView.swift
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ struct TokenPermissionsView: View {
@State var showTUMOnline = false
@State var notAllPermissionsGranted = false
@State var permissionsWarning = ""
@State var showHelp = true

var dismissWhenDone: Bool = false

@@ -25,65 +26,81 @@ struct TokenPermissionsView: View {
HStack {
Spacer(minLength: 10)
Text("You can change your permissions on TUMOnline")
.foregroundColor(.tumBlue)
.foregroundColor(.blue)
.lineLimit(2)
.multilineTextAlignment(.center)
.font(.title2)
Spacer(minLength: 10)
}
HStack {
VStack(alignment: .leading) {
Text("Calendar").padding()
Text("Lectures").padding()
Text("Grades").padding()
Text("Tuition fees").padding()
Text("Identification (TUM ID and name)").padding()
}
Spacer()
VStack {
ForEach(permissionTypes, id: \.self) { permissionType in

VStack {
ForEach(permissionTypes, id: \.self) { permissionType in
HStack {
Text(permissionType.rawValue)
Spacer()
if let currentState = viewModel.states[permissionType] {
check(state: currentState).padding()
} else {
Image(systemName: "questionmark.circle.fill").foregroundColor(.gray).padding()
}
}
}

HStack {
if showHelp {
VStack {
Image(uiImage: UIImage(named: "set-permissions.png")!)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 250)
.cornerRadius(5)
}
}
}
}
.font(.system(size: 20))
.padding()

VStack (){
Button {
self.showTUMOnline = true
} label: {
HStack {
Image(systemName: "globe")
Text("Open TUMOnline")
VStack {
HStack (){
Button {
self.showTUMOnline = true
self.doneButton = false
} label: {
HStack {
Image(systemName: "globe")
Text("Open TUMOnline")
}
.lineLimit(1)
.font(.system(size: 14, weight: .bold))
.frame(width: 150, height: 48, alignment: .center)
}
.lineLimit(1).font(.body)
.frame(width: 200, height: 48, alignment: .center)
}
.font(.title)
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)

Button {
Task {
await viewModel.checkPermissionFor(types: [.grades, .lectures, .calendar, .identification, .tuitionFees])

withAnimation() {
doneButton = true
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)
.padding()
Spacer()
Button {
Task {
await viewModel.checkPermissionFor(types: [.grades, .lectures, .calendar, .identification, .tuitionFees])
withAnimation() {
doneButton = true
}
}
} label: {
Text("Check Permissions")
.lineLimit(1)
.font(.system(size: 14, weight: .bold))
.frame(width: 150, height: 48, alignment: .center)
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)
.buttonStyle(.plain)
}
} label: {
Text("Check Permissions")
.lineLimit(1)
.font(.body)
.frame(width: 200, height: 48, alignment: .center)
.foregroundColor(.white)
.background(Color(.tumBlue))
.cornerRadius(10)
.buttonStyle(.plain)
.padding()
}

if doneButton {
@@ -112,7 +129,7 @@ struct TokenPermissionsView: View {
} label: {
Text("Done")
.lineLimit(1)
.font(.body)
.font(.system(size: 17, weight: .bold))
.frame(width: 200, height: 48, alignment: .center)
.foregroundColor(.white)
.background(allPermissionsAreGranted() ? .green : .tumBlue)
@@ -137,6 +154,13 @@ struct TokenPermissionsView: View {
}
}))
}
.task {
await viewModel.checkPermissionFor(types: [.grades, .lectures, .calendar, .identification, .tuitionFees])

withAnimation() {
doneButton = true
}
}
}

func notGrantedPermissions() -> [TokenPermissionsViewModel.PermissionType] {
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ struct CafeteriaRowView: View {
.font(.title3)
Spacer()
if let queue = cafeteria.queue {
let explainText = explainStatus ? "Auslastung " : ""
let explainText = explainStatus ? "Traffic " : ""
Text("\(explainText)\(Int(queue.percent))%")
.font(.footnote)
.onTapGesture {
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ struct StudyRoomGroupView: View {
VStack(spacing: 1) {
HStack{
VStack(alignment: .leading){
Spacer().frame(height: 10).gesture(panelDragGesture)
Text(group.name ?? "")
.bold()
.font(.title3)
2 changes: 1 addition & 1 deletion Campus-iOS/MoviesComponent/Views/MovieCard.swift
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ struct MovieCard: View {
.frame(height: 55)

}
.frame(width: 390 * 0.425, height: 390 * 0.75)
.frame(width: 390 * 0.425, height: 390 * 0.73)
.background(Color(.systemGray5))
.cornerRadius(15)
.shadow(color: Color.black.opacity(0.2), radius: 7, x: 0, y: 2)
4 changes: 4 additions & 0 deletions Campus-iOS/WidgetComponent/Screen/WidgetScreen.swift
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@ import MapKit
struct WidgetScreen: View {

@StateObject private var recommender: WidgetRecommender
@StateObject var model: Model = Model()
@State private var refresh = false
@State private var widgetTitle = String()
private let timer = Timer.publish(every: 60, on: .main, in: .common).autoconnect()

init(model: Model) {
@@ -39,10 +41,12 @@ struct WidgetScreen: View {
}
.task {
try? await recommender.fetchRecommendations()
widgetTitle = "Hi, " + (model.profile.profile?.firstname ?? "")
}
.onReceive(timer) { _ in
refresh.toggle()
}
.navigationTitle(widgetTitle)
}

// Source: https://stackoverflow.com/a/58876712