UI adjustments

This commit is contained in:
Patrick Müller 2021-02-07 15:17:29 +01:00 committed by Patrick Müller
parent 99b996550e
commit dba2233312
3 changed files with 16 additions and 5 deletions

View File

@ -44,14 +44,16 @@ struct HomeView: View {
VStack {
Text("today".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity)
.frame(maxWidth: .infinity, alignment: .leading)
VStack {
if(!todaysEvents.isEmpty){
ForEach(todaysEvents, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
}
} else {
Text("noLectures".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
@ -64,14 +66,16 @@ struct HomeView: View {
VStack {
Text("tomorrow".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity)
.frame(maxWidth: .infinity, alignment: .leading)
VStack {
if(!tomorrowsEvents.isEmpty){
ForEach(tomorrowsEvents, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
}
} else {
Text("noLectures".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
@ -91,14 +95,16 @@ struct HomeView: View {
VStack {
Text("upcomingExams".localized(tableName: "HomeView"))
.font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/)
.frame(maxWidth: .infinity)
.frame(maxWidth: .infinity, alignment: .leading)
VStack {
if(!upcomingExams.isEmpty){
ForEach(upcomingExams, id: \.self) { exam in
Text(exam.value(forKey: "summary") as! String)
.frame(maxWidth: .infinity, alignment: .leading)
}
} else {
Text("noExams".localized(tableName: "HomeView"))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
}
@ -116,7 +122,9 @@ struct HomeView: View {
}
}
.navigationBarTitle(Text("Home"))
}.onAppear{
}
.navigationViewStyle(StackNavigationViewStyle())
.onAppear{
self.readFromCoreData()
self.todaysEvents = getTodaysEvents()
self.tomorrowsEvents = getTomorrowsEvents()

View File

@ -55,7 +55,9 @@ struct LecturePlanList: View {
// Text("Switch order")
// }
// })
}.onAppear{
}
.navigationViewStyle(StackNavigationViewStyle())
.onAppear{
let sectionSortDescriptor = NSSortDescriptor(key: "startDate", ascending: true)
let sortDescriptors = [sectionSortDescriptor]
self.events = []

View File

@ -30,6 +30,7 @@ struct SettingsMain: View {
.navigationTitle("settings".localized(tableName: "General", plural: false))
.listStyle(GroupedListStyle())
}
.navigationViewStyle(StackNavigationViewStyle())
.alert(isPresented: $showLogoutConfirmationAlert, content: {
Alert(
title: Text("logout".localized(tableName: "General", plural: false)),