From dba2233312bca935dbfc0e84030a7b33bb68aca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Mu=CC=88ller?= Date: Sun, 7 Feb 2021 15:17:29 +0100 Subject: [PATCH] :sparkles: UI adjustments --- DHBW-Service/Views/Tabs/HomeView.swift | 16 ++++++++++++---- DHBW-Service/Views/Tabs/LecturePlanList.swift | 4 +++- DHBW-Service/Views/Tabs/SettingsMain.swift | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/DHBW-Service/Views/Tabs/HomeView.swift b/DHBW-Service/Views/Tabs/HomeView.swift index 2744b75..5449f90 100644 --- a/DHBW-Service/Views/Tabs/HomeView.swift +++ b/DHBW-Service/Views/Tabs/HomeView.swift @@ -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() diff --git a/DHBW-Service/Views/Tabs/LecturePlanList.swift b/DHBW-Service/Views/Tabs/LecturePlanList.swift index 5587cb2..f9fb747 100644 --- a/DHBW-Service/Views/Tabs/LecturePlanList.swift +++ b/DHBW-Service/Views/Tabs/LecturePlanList.swift @@ -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 = [] diff --git a/DHBW-Service/Views/Tabs/SettingsMain.swift b/DHBW-Service/Views/Tabs/SettingsMain.swift index cc2c9af..6d1d224 100644 --- a/DHBW-Service/Views/Tabs/SettingsMain.swift +++ b/DHBW-Service/Views/Tabs/SettingsMain.swift @@ -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)),