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

Commit

Permalink
Redesign of Home Screen and Maps Screen (#548)
Browse files Browse the repository at this point in the history
* Added first Theme Extensions

Also added first colors and font

* Created theme class

Changed from extensions to theme class

* Solved Xcode issue

* returned to extensions

* Added new Header in Lecture Home and Grades

* Added Header to Calendar

Small 🐞: calendar resizes once after switching to different date format

* Adapted CalenderView Design

Adapted calendar view to new header and implemented theme

* Added Theme to widget Screen

* Made Header responsive to all iphone sizes

* Added HomeView that incorporates widget screen

* Added basis for ContactView in HomeView

* Added personDetailedViewModel to ContactView

* Added GradesViewModel to ContactView

Also added layout of two new Buttons in ContactView

* Added Tuition to ContactView

* Added links to Buttons

* Added ImagePicker to ContactView

Note: Image cant be saved yet

* Code cleanup

Split up ContactView in multiple Views for clarity

* Code Cleanup

Refactored some stuff
Added string translations
Added heading for WidgetScreen

* Rearranged tabs

Also some Codecleanup and error handling

* Some UI Changes

Added Theme to more Views
Changed Dark Mode Colors
Added String Translation
Changed Divider Color in Header
Temp. Bugfix in CalendarWidget

* Added movies to HomeScreen

also removed tutition and grades widget

* Added some error handling to the new movieView

* Added ViewModifier for Title

* Buttons on HomeScreen no use WebView

* Added WebView to LectureDetailsView

* Added new Calendar Widget

* Readded the removed widgets

* Added basis for StudyRoomWidget

* Added ListSection ViewModifier

* Added new StudyRoomWidget

* Added first iteration of cafeteria widget

* Did some refactoring

* Added Robyns RecommenderSystem to new Widgets

* Fixed Calendar Widget Bug

* Added base for new cafeteria widget

* Added new more powerful Cafeteria widget

* fixed bug in MovieVM

* Added News to the HomeScreen

Also adapted news to new design

* Implemented the styling theme in more places

* Added theme support in more views

* Some Bugfixing and code cleanup

* Changed deployment target to iOS 16

* Fixed Bug in NewsCard

* Updated decorative images

Added decorative: to images that can be ignored by screenreader/voiceover

* Updated links that leave the app

added accessibilityHint to Feedback Button

* Login Error is now alert

Old error was prettier but disappeared automatically which is not good for accessibility

* Added Accessibility to TUM Sexy List

* Added Accessibility headings

* Added accessibilityHints to Links

* Added detailedProfileView to new HomeScreen

* ProfileImage is now saved on local storage

* Small UI tweak

* added comment

* public transportation departures as a widget with a detailed view (#532)

* add fetching from MVV Api, calculation of nearest campus

* add placeholder for widget, details view with 20 departures wih real time, bump project to 16.0

* add refetching after first departure should depart, user can select default station per campus, show walking distance, show line information, only fetch reachable departures, link to maps app for directions

* fix bug where line infos where not loaded because they were array instead of element

* add widget view, minor adjustments, translations for german version

* fix fetching error by changing to station ids

* adjust departures widget to stylings, integrate departures in recommender

* fix some stylings, only show departures if within 2km of campus, fix some warnings

* small bug fix cafeteria widget

* Adapted to navigatum changes

* Adapted homescreen to davids api changes

Still some changes need to be done
-> but app runs again

* Further adapted to API changes

Also fixed some bugs and performance improvements

* Fix swift 5.8 compile errors

* Initial setup of Places Screen

* Solved compiler issue

* Added cafeterias to campus views

* Added study rooms to campusView

* Force refresh of token requests

* Fix auth issues

* Added most searched rooms to campusView

* Added maps to campusView

Also did some design stuff

* Added new studyRoomsView with Maps

* Fix loading error. Revert images view since it's not needed.

* Fixed bug where app would crash in PlacesView

* Fixed files saved in wrong directory

* Updated error handling of widgets on HomeScreen

* Improved Campus locations for some campuses

* related to error handling of homescreen widgets

small fix

* Version and build number increase

* adapted to dev changes

* Made annotations clickable

* Code cleanup refactoring etc

Added base for new location view

* More Code clean up

* Added location view

extended annotationMap

* Added new universal room details view

* First wave of refactoring

* second wave of refactoring

* Adressed warnings related to changes

* Solved loading issues of 'HomeScreen'

* Adapted TabView to match design

* More refactoring

* Bugfixes, translations and refactoring

* Refactored "MoviesWidget" and "NewsWidget"

* Adapted the ProfileView to design

* Added FailedView to 'HomeScreen'

Now behaves in the same way as other screens without internet

* Adapted Search to new design

Customised the individual SearchResultViews to conform to new design

* Further adapted search + bug fixes

* Adapted Search to dark mode

* Small visual fixes

* Bump dependencies

* Cleanup

* Cleanup v2

* Fix search + news & tufilm

* Revert url changes as backend is fixed

* Some accessibility changes

* Merge fixes

---------

Co-authored-by: Jakob Körber <[email protected]>
Co-authored-by: Philipp Zagar <[email protected]>
Co-authored-by: Atharva Mathapati <[email protected]>
  • Loading branch information
4 people authored Aug 29, 2023
1 parent 875fbb2 commit 2ebc48c
Show file tree
Hide file tree
Showing 257 changed files with 6,837 additions and 2,814 deletions.
1,787 changes: 1,024 additions & 763 deletions Campus-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
135 changes: 74 additions & 61 deletions Campus-iOS/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,31 @@ import MapKit
import KVKCalendar
import Firebase

@available(iOS 16.0, *)
@main
@MainActor
struct CampusApp: App {
@StateObject var model: Model = Model()

let persistenceController = PersistenceController.shared
@State var selectedTab = 0
@State private var selectedTab: Tab = .home
@State var isLoginSheetPresented = false


enum Tab {
case home
case grades
case lectures
case calendar
case maps
}

init() {
#if !DEBUG
FirebaseApp.configure()
FirebaseApp.configure()
#endif

UITabBar.appearance().isOpaque = true
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
UITabBar.appearance().scrollEdgeAppearance = appearance
}
let appearance = UITabBarAppearance()
UITabBar.appearance().scrollEdgeAppearance = appearance
}

var body: some Scene {
Expand All @@ -36,9 +43,6 @@ struct CampusApp: App {
.sheet(isPresented: $isLoginSheetPresented) {
NavigationView {
LoginView(model: model)
.onAppear {
selectedTab = 0
}
}
.navigationViewStyle(.stack)
}
Expand All @@ -63,86 +67,95 @@ struct CampusApp: App {
model.isLoginSheetPresented = false
}
}
.background(Color.primaryBackground)
}
}

func tabViewComponent() -> some View {
TabView(selection: $selectedTab) {
// MARK: - Home Screen
if UIDevice.current.userInterfaceIdiom == .phone {
NavigationView {
HomeScreen(model: model)
.overlay(NavigationBarView(model: model))
}
.navigationViewStyle(.stack)
.tag(Tab.home)
.tabItem {
if selectedTab == .home {
Label("Home", systemImage: "house")
.foregroundColor(.highlightText)
} else {
Label("Home", systemImage: "house").environment(\.symbolVariants, .none)
}
}
.toolbarBackground(Color.primaryBackground, for: .tabBar)
}
// MARK: - Grades Screen
NavigationView {
CalendarScreen(
model: model,
refresh: $model.isUserAuthenticated
)
.navigationTitle("Calendar")
GradesScreen(model: model, refresh: $model.isUserAuthenticated)
.background(Color.primaryBackground)
.overlay(NavigationBarView(model: model, title: "Grades".localized))
}
.tag(4)
.tag(Tab.grades)
.tabItem {
Label("Calendar", systemImage: "calendar")
if selectedTab == .grades {
Label("Grades", systemImage: "checkmark.shield")
} else {
Label("Grades", systemImage: "checkmark.shield").environment(\.symbolVariants, .none)
}

}
.navigationViewStyle(.stack)

NavigationView {
.toolbarBackground(Color.secondaryBackground, for: .tabBar)
.if(UIDevice.current.userInterfaceIdiom == .pad, transformT: { view in
view.navigationViewStyle(.stack)
})
// MARK: - Lecture Screen
NavigationView {
LecturesScreen(vm: LecturesViewModel(
model: model,
service: LecturesService()
), refresh: $model.isUserAuthenticated)
.navigationTitle("Lectures")
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
ProfileToolbar(model: model)
}
}
.background(Color.primaryBackground)
.overlay(NavigationBarView(model: model, title: "Lectures".localized))
}
.tag(1)
.tag(Tab.lectures)
.tabItem {
Label("Lectures", systemImage: "studentdesk")
}
.toolbarBackground(Color.primaryBackground, for: .tabBar)
.if(UIDevice.current.userInterfaceIdiom == .pad, transformT: { view in
view.navigationViewStyle(.stack)
})

if UIDevice.current.userInterfaceIdiom == .phone {
// MARK: - Calendar Screen
NavigationView {
WidgetScreen(model: model)

.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
ProfileToolbar(model: model)
}
}
}
.navigationViewStyle(.stack)
.tag(0)
.tabItem {
Label("Home", systemImage: "rectangle.3.group").environment(\.symbolVariants, .none)
}
}

NavigationView {
GradesScreen(model: model, refresh: $model.isUserAuthenticated)
.navigationTitle("Grades")
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
ProfileToolbar(model: model)
}
}
CalendarScreen(
model: model,
refresh: $model.isUserAuthenticated
)
.background(Color.primaryBackground)
.overlay(NavigationBarView(model: model, title: "Calendar".localized))
}
.tag(2)
.tag(Tab.calendar)
.tabItem {
Label("Grades", systemImage: "checkmark.shield").environment(\.symbolVariants, .none)
Label("Calendar", systemImage: "calendar")
}
.if(UIDevice.current.userInterfaceIdiom == .pad, transformT: { view in
view.navigationViewStyle(.stack)
})

.toolbarBackground(Color.primaryBackground, for: .tabBar)
.navigationViewStyle(.stack)
// MARK: - Places Screen
NavigationView {
MapScreenView(vm: MapViewModel(cafeteriaService: CafeteriasService(), studyRoomsService: StudyRoomsService()))
PlacesScreen(vm: MapViewModel(cafeteriaService: CafeteriasService(), studyRoomsService: StudyRoomsService()))
.background(Color.primaryBackground)
.overlay(NavigationBarView(model: model, title: "Places".localized))
//MapScreenView(vm: MapViewModel(cafeteriaService: CafeteriasService(), studyRoomsService: StudyRoomsService()))
}
.tag(3)
.tag(Tab.maps)
.tabItem {
Label("Places", systemImage: "mappin.and.ellipse")
}
.toolbarBackground(Color.primaryBackground, for: .tabBar)
.navigationViewStyle(.stack)
}
.accentColor(.highlightText)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "campus-freising.jpg",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "campus-garching.jpeg",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "campus-klinikum.jpeg",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "campus-olympia.jpeg",
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "campus-stamm.jpeg",
"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.
6 changes: 6 additions & 0 deletions Campus-iOS/Assets.xcassets/Colors/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF7",
"green" : "0xF2",
"red" : "0xF2"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x19",
"green" : "0x19",
"red" : "0x19"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 2ebc48c

Please sign in to comment.