diff --git a/AvH Plan.xcodeproj/project.pbxproj b/AvH Plan.xcodeproj/project.pbxproj index 6d80b39..ef59257 100644 --- a/AvH Plan.xcodeproj/project.pbxproj +++ b/AvH Plan.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ A96133A22299867A00B541D4 /* AvH_PlanUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96133A12299867A00B541D4 /* AvH_PlanUITests.swift */; }; A96D4CC822DDE01A006BAB34 /* GeneralPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96D4CC722DDE01A006BAB34 /* GeneralPlanViewController.swift */; }; A96D4CCA22DDE184006BAB34 /* PersonalPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A96D4CC922DDE184006BAB34 /* PersonalPlanViewController.swift */; }; + A976907A233F2E680015AF1A /* CoursePickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9769079233F2E680015AF1A /* CoursePickerViewController.swift */; }; A996BFF922E05AAB00E7BE42 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A996BFFB22E05AAB00E7BE42 /* InfoPlist.strings */; }; A99AB5F8230155DE00555295 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A99AB5F7230155DE00555295 /* GoogleService-Info.plist */; }; A9A3496C22D4859200F35AE0 /* SubstModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A3496B22D4859200F35AE0 /* SubstModel.swift */; }; @@ -95,6 +96,7 @@ A96133A32299867A00B541D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A96D4CC722DDE01A006BAB34 /* GeneralPlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralPlanViewController.swift; sourceTree = ""; }; A96D4CC922DDE184006BAB34 /* PersonalPlanViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalPlanViewController.swift; sourceTree = ""; }; + A9769079233F2E680015AF1A /* CoursePickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoursePickerViewController.swift; sourceTree = ""; }; A996BFF322E05AAB00E7BE42 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; A996BFFC22E05AAB00E7BE42 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; A996BFFD22E05AAB00E7BE42 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -206,6 +208,7 @@ A96D4CC922DDE184006BAB34 /* PersonalPlanViewController.swift */, A9C1D2FF22D656DD00139043 /* MenuViewController.swift */, A9B0464D22E1F75A005FB0DB /* CustomizationViewController.swift */, + A9769079233F2E680015AF1A /* CoursePickerViewController.swift */, A9B0464F22E21207005FB0DB /* ColourPickerView.swift */, A9C1D30122D7237200139043 /* DataFetcher.swift */, A96133852299867400B541D4 /* Main.storyboard */, @@ -480,7 +483,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AvH Plan/Pods-AvH Plan-frameworks.sh\"\n\"${PODS_ROOT}/Fabric/run\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AvH Plan/Pods-AvH Plan-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -495,6 +498,7 @@ A96133802299867400B541D4 /* AppDelegate.swift in Sources */, A9378D352336015000C07D07 /* LoginViewController.swift in Sources */, A9A3496C22D4859200F35AE0 /* SubstModel.swift in Sources */, + A976907A233F2E680015AF1A /* CoursePickerViewController.swift in Sources */, A9C1D30022D656DD00139043 /* MenuViewController.swift in Sources */, A957A75122DDC15500E0A2ED /* MenuViewCell.swift in Sources */, A9B0464C22E1F255005FB0DB /* CustomTabBarController.swift in Sources */, diff --git a/AvH Plan/Base.lproj/Main.storyboard b/AvH Plan/Base.lproj/Main.storyboard index d1b5243..c92a58d 100644 --- a/AvH Plan/Base.lproj/Main.storyboard +++ b/AvH Plan/Base.lproj/Main.storyboard @@ -32,6 +32,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,307 +327,52 @@ - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - + - - - - - - - - - - - - - + - + @@ -411,7 +429,7 @@ - + @@ -664,14 +682,12 @@ Tell me your name. - @@ -740,9 +756,22 @@ Tell me your name. + + + + + + + + + + + + + diff --git a/AvH Plan/ColourPickerView.swift b/AvH Plan/ColourPickerView.swift index 5ba3da0..da13d2c 100644 --- a/AvH Plan/ColourPickerView.swift +++ b/AvH Plan/ColourPickerView.swift @@ -43,6 +43,8 @@ class ColourPickerView: UIViewController, UICollectionViewDataSource, UICollecti super.viewDidLoad() index = prefs.integer(forKey: key) self.toolbar!.topItem!.title = "\(course)" + self.collectionView.delegate = self + self.collectionView.dataSource = self } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { diff --git a/AvH Plan/ColourViewCell.xib b/AvH Plan/ColourViewCell.xib index 9b50ab4..1f2f8f1 100644 --- a/AvH Plan/ColourViewCell.xib +++ b/AvH Plan/ColourViewCell.xib @@ -13,27 +13,23 @@ - + - + - - - - - + - + @@ -45,30 +41,33 @@ + + + + - - - - - - - - - - - - + + + + + + + + + + + - + - + diff --git a/AvH Plan/CoursePickerViewController.swift b/AvH Plan/CoursePickerViewController.swift new file mode 100644 index 0000000..276bb6c --- /dev/null +++ b/AvH Plan/CoursePickerViewController.swift @@ -0,0 +1,102 @@ +// +// CoursePickerViewController.swift +// AvH Plan +// +// Created by Deniz Duezgoeren on 28.09.19. +// Copyright © 2019 Deniz Duezgoeren. All rights reserved. +// + +import UIKit +import MagazineLayout + +class CoursePickerViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateMagazineLayout { + + @IBOutlet weak var collectionView: UICollectionView! + let identifier = "customisation_cell" + let df = DataFetcher.sharedInstance + var courses = [String]() + var translatedCourses = [String]() + let prefs = UserDefaults.standard + + @IBAction func saveButton(_ sender: UIBarButtonItem) { + self.dismiss(animated: true, completion: nil) + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + courses = self.df.courses + translatedCourses = self.df.translatedCourses + self.collectionView.register(UINib(nibName: "ColourViewCell", bundle: nil), forCellWithReuseIdentifier: identifier) + } + + override func viewDidLoad() { + super.viewDidLoad() + + self.collectionView.delegate = self + self.collectionView.dataSource = self + NotificationCenter.default.addObserver(self, selector: #selector(loadList), name: NSNotification.Name(rawValue: "load"), object: nil) + } + + @objc func loadList(notification: NSNotification){ + self.collectionView.reloadItems(at: [notification.userInfo?["indexPath"] as! IndexPath]) + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + if let s = storyboard?.instantiateViewController(withIdentifier: "ColourPickerView") as? ColourPickerView { + s.course = self.translatedCourses[indexPath.item] + s.internalCourse = self.courses[indexPath.item] + s.currentIndexPath = indexPath + self.present(s, animated: true) + } + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeModeForItemAt indexPath: IndexPath) -> MagazineLayoutItemSizeMode { + let widthMode = MagazineLayoutItemWidthMode.fullWidth(respectsHorizontalInsets: true) + let heightMode = MagazineLayoutItemHeightMode.static(height: 55) + return MagazineLayoutItemSizeMode(widthMode: widthMode, heightMode: heightMode) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForHeaderInSectionAtIndex index: Int) -> MagazineLayoutHeaderVisibilityMode { + return .hidden + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForFooterInSectionAtIndex index: Int) -> MagazineLayoutFooterVisibilityMode { + return .hidden + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForBackgroundInSectionAtIndex index: Int) -> MagazineLayoutBackgroundVisibilityMode { + return .hidden + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, horizontalSpacingForItemsInSectionAtIndex index: Int) -> CGFloat { + return 0 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, verticalSpacingForElementsInSectionAtIndex index: Int) -> CGFloat { + return 0 + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetsForSectionAtIndex index: Int) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetsForItemsInSectionAtIndex index: Int) -> UIEdgeInsets { + return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + } + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return self.courses.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath as IndexPath) as! ColourViewCell + cell.label.text = self.translatedCourses[indexPath.item] + cell.colorView.layer.cornerRadius = cell.colorView.frame.height / 2 + cell.colorView.layer.borderWidth = 0.4 + cell.colorView.layer.borderColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1) + cell.colorView.backgroundColor = self.df.getColourPalette()[prefs.integer(forKey: "colour-index-\(courses[indexPath.item])")] + cell.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + return cell + } +} diff --git a/AvH Plan/CustomizationViewController.swift b/AvH Plan/CustomizationViewController.swift index 92113a3..d0b57ea 100644 --- a/AvH Plan/CustomizationViewController.swift +++ b/AvH Plan/CustomizationViewController.swift @@ -7,28 +7,20 @@ // import UIKit -import MagazineLayout -class CustomizationViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateMagazineLayout, UITextFieldDelegate { +class CustomizationViewController: UITableViewController, UITextFieldDelegate { - var courses = [String]() - var translatedCourses = [String]() - @IBOutlet weak var collectionView: UICollectionView! - let identifier = "customisation_cell" let prefs = UserDefaults.standard let df = DataFetcher.sharedInstance @IBOutlet weak var txtName: UITextField! @IBOutlet weak var txtClasses: UITextField! @IBOutlet weak var txtCourses: UITextField! - @IBOutlet weak var defaultSegments: UISegmentedControl! + @IBOutlet weak var defaultSwitch: UISwitch! @IBOutlet weak var textToolbar: UIToolbar! @IBOutlet weak var orderingSegments: UISegmentedControl! @IBOutlet weak var autoRefreshToggle: UISwitch! - @IBOutlet weak var inputsView: UIView! - @IBOutlet weak var colourView: UIView! - @IBAction func textDismissButton(_ sender: UIBarButtonItem) { view.endEditing(true) } @@ -49,26 +41,31 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource, textField.inputAccessoryView = textToolbar } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - courses = self.df.courses - translatedCourses = self.df.translatedCourses - self.collectionView.register(UINib(nibName: "ColourViewCell", bundle: nil), forCellWithReuseIdentifier: identifier) - } - @IBAction func done(_ sender: UIBarButtonItem) { self.prefs.set(self.txtName.text, forKey: "username") self.prefs.set(self.txtClasses.text, forKey: "classes") self.prefs.set(self.txtCourses.text, forKey: "courses") - self.prefs.set(self.defaultSegments.selectedSegmentIndex, forKey: "default-plan") + + var defaultPlan: Int + if self.defaultSwitch.isOn { + defaultPlan = 1 + } else { + defaultPlan = 0 + } + self.prefs.set(defaultPlan, forKey: "default-plan") self.prefs.set(self.orderingSegments.selectedSegmentIndex == 1, forKey: "original_sorting") self.prefs.set(self.autoRefreshToggle.isOn, forKey: "auto_refresh") - self.prefs.synchronize() self.dismiss(animated: true, completion: nil) } + @IBAction func customizeColoursButton(_ sender: UIButton) { + if let s = storyboard?.instantiateViewController(withIdentifier: "CoursePickerViewController") as? CoursePickerViewController { + self.present(s, animated: true) + } + } + override func viewDidLoad() { super.viewDidLoad() @@ -79,7 +76,11 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource, self.txtName.text = prefs.string(forKey: "username") self.txtClasses.text = prefs.string(forKey: "classes") self.txtCourses.text = prefs.string(forKey: "courses") - self.defaultSegments.selectedSegmentIndex = prefs.integer(forKey: "default-plan") + if self.prefs.integer(forKey: "default-plan") == 1 { + self.defaultSwitch.isOn = true + } else { + self.defaultSwitch.isOn = false + } var order: Int if self.prefs.bool(forKey: "original_sorting") { order = 1 @@ -88,69 +89,5 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource, } self.orderingSegments.selectedSegmentIndex = order self.autoRefreshToggle.isOn = self.prefs.bool(forKey: "auto_refresh") - - NotificationCenter.default.addObserver(self, selector: #selector(loadList), name: NSNotification.Name(rawValue: "load"), object: nil) - } - - @objc func loadList(notification: NSNotification){ - self.collectionView.reloadItems(at: [notification.userInfo?["indexPath"] as! IndexPath]) - } - - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - if let s = storyboard?.instantiateViewController(withIdentifier: "ColourPickerView") as? ColourPickerView { - s.course = self.translatedCourses[indexPath.item] - s.internalCourse = self.courses[indexPath.item] - s.currentIndexPath = indexPath - self.present(s, animated: true) - } - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeModeForItemAt indexPath: IndexPath) -> MagazineLayoutItemSizeMode { - let widthMode = MagazineLayoutItemWidthMode.fullWidth(respectsHorizontalInsets: true) - let heightMode = MagazineLayoutItemHeightMode.dynamic - return MagazineLayoutItemSizeMode(widthMode: widthMode, heightMode: heightMode) - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForHeaderInSectionAtIndex index: Int) -> MagazineLayoutHeaderVisibilityMode { - return .hidden - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForFooterInSectionAtIndex index: Int) -> MagazineLayoutFooterVisibilityMode { - return .hidden - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, visibilityModeForBackgroundInSectionAtIndex index: Int) -> MagazineLayoutBackgroundVisibilityMode { - return .hidden - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, horizontalSpacingForItemsInSectionAtIndex index: Int) -> CGFloat { - return 0 - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, verticalSpacingForElementsInSectionAtIndex index: Int) -> CGFloat { - return 0 - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetsForSectionAtIndex index: Int) -> UIEdgeInsets { - return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetsForItemsInSectionAtIndex index: Int) -> UIEdgeInsets { - return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) - } - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return self.courses.count - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath as IndexPath) as! ColourViewCell - cell.label.text = self.translatedCourses[indexPath.item] - cell.colorView.layer.cornerRadius = cell.colorView.frame.height / 2 - cell.colorView.layer.borderWidth = 0.4 - cell.colorView.layer.borderColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1) - cell.colorView.backgroundColor = self.df.getColourPalette()[prefs.integer(forKey: "colour-index-\(courses[indexPath.item])")] - cell.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - return cell } } diff --git a/AvH Plan/DataFetcher.swift b/AvH Plan/DataFetcher.swift index d0c149e..82d6f68 100644 --- a/AvH Plan/DataFetcher.swift +++ b/AvH Plan/DataFetcher.swift @@ -133,28 +133,17 @@ class DataFetcher { private func assignRanking(for group: String, _ isPSA: Bool) -> Int { if isPSA { - return -31 + return -102 } if group.count > 0 { let a = String(group[...group.startIndex]) - if self.checkStringForArray(s: a, checking: juniors) == true { - return -30 - } else if a == "1" || a == "2" { - if group.count > 1 { - - let b = Int(String(group[group.index(group.startIndex, offsetBy: 1)...group.index(group.startIndex, offsetBy: 1)])) - - if b == nil { - return 0 - } else { - return (b! - (b! * 2)) - } - } else { - return 0 - } + if group.count > 1, let b = Int(String(group[group.index(group.startIndex, offsetBy: 0)...group.index(group.startIndex, offsetBy: 1)])) { + return -b + } else if self.checkStringForArray(s: a, checking: juniors) == true { + return -101 } else { - return -29 + return -100 } } diff --git a/AvH Plan/FirstTimeViewController.swift b/AvH Plan/FirstTimeViewController.swift index 789e600..db12dae 100644 --- a/AvH Plan/FirstTimeViewController.swift +++ b/AvH Plan/FirstTimeViewController.swift @@ -8,13 +8,18 @@ import UIKit -class FirstTimeViewController: UIViewController { +class FirstTimeViewController: UIViewController, UITextFieldDelegate { - @IBOutlet weak var scrollView: UIScrollView! let df = DataFetcher.sharedInstance let prefs = UserDefaults.standard + @IBOutlet weak var nameTextField: UITextField! + @IBOutlet weak var gradeTextField: UITextField! + @IBOutlet weak var courseTextField: UITextField! + @IBOutlet weak var defaultPlanSegmentedControl: UISegmentedControl! + @IBOutlet weak var textToolbar: UIToolbar! + @IBAction func gradeInfoButton(_ sender: UIButton) { self.present(self.df.getInfoAlert(for: "grade"), animated: true) } @@ -23,11 +28,14 @@ class FirstTimeViewController: UIViewController { self.present(self.df.getInfoAlert(for: "course"), animated: true) } - @IBOutlet weak var nameTextField: UITextField! - @IBOutlet weak var gradeTextField: UITextField! - @IBOutlet weak var courseTextField: UITextField! - @IBOutlet weak var defaultPlanSegmentedControl: UISegmentedControl! - + @IBAction func textDismissButton(_ sender: UIBarButtonItem) { + view.endEditing(true) + } + + func textFieldDidBeginEditing(_ textField: UITextField) { + textField.inputAccessoryView = textToolbar + } + @IBAction func finishSetupButton(_ sender: UIBarButtonItem) { self.prefs.set(self.nameTextField.text, forKey: "username") self.prefs.set(self.gradeTextField.text, forKey: "classes") @@ -41,10 +49,12 @@ class FirstTimeViewController: UIViewController { } } - override func viewDidLoad() { super.viewDidLoad() + self.nameTextField.delegate = self + self.gradeTextField.delegate = self + self.courseTextField.delegate = self self.scrollView.isDirectionalLockEnabled = true } diff --git a/AvH Plan/GeneralPlanViewController.swift b/AvH Plan/GeneralPlanViewController.swift index 1d869f1..bb5e789 100644 --- a/AvH Plan/GeneralPlanViewController.swift +++ b/AvH Plan/GeneralPlanViewController.swift @@ -11,7 +11,7 @@ import UIKit class GeneralViewController: PlanViewController { @IBAction func customize(_ sender: UIBarButtonItem) { - if let s = storyboard?.instantiateViewController(withIdentifier: "Customize") as? CustomizationViewController { + if let s = storyboard?.instantiateViewController(withIdentifier: "CustomizationNavigationController") as? UINavigationController { self.present(s, animated: true) } } diff --git a/AvH Plan/MenuViewController.swift b/AvH Plan/MenuViewController.swift index 1cbf718..a06bf68 100644 --- a/AvH Plan/MenuViewController.swift +++ b/AvH Plan/MenuViewController.swift @@ -58,6 +58,7 @@ class MenuViewController : UICollectionViewController, UICollectionViewDelegateM self.extendedLayoutIncludesOpaqueBars = true self.collectionView.contentInsetAdjustmentBehavior = .always self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("food_menu", comment: "") + self.collectionView.isPrefetchingEnabled = false } @objc private func objDoAsync(_ sender: Any) { diff --git a/AvH Plan/PersonalPlanViewController.swift b/AvH Plan/PersonalPlanViewController.swift index 2a21d01..04f4982 100644 --- a/AvH Plan/PersonalPlanViewController.swift +++ b/AvH Plan/PersonalPlanViewController.swift @@ -11,7 +11,7 @@ import UIKit class PersonalPlanViewController: PlanViewController { @IBAction func customize(_ sender: UIBarButtonItem) { - if let s = storyboard?.instantiateViewController(withIdentifier: "Customize") as? CustomizationViewController { + if let s = storyboard?.instantiateViewController(withIdentifier: "CustomizationNavigationController") as? UINavigationController { self.present(s, animated: true) } } diff --git a/AvH Plan/PlanViewController.swift b/AvH Plan/PlanViewController.swift index 113c909..534c5a7 100644 --- a/AvH Plan/PlanViewController.swift +++ b/AvH Plan/PlanViewController.swift @@ -89,6 +89,7 @@ class PlanViewController : UICollectionViewController, UICollectionViewDelegateM self.collectionView.contentInsetAdjustmentBehavior = .always self.df.setTabBarBadge(for: self.tabBarController?.tabBar.items) + self.collectionView.isPrefetchingEnabled = false } func getViewType() -> String { diff --git a/AvH Plan/de.lproj/Localizable.strings b/AvH Plan/de.lproj/Localizable.strings index 1c3c510..05fd6da 100644 --- a/AvH Plan/de.lproj/Localizable.strings +++ b/AvH Plan/de.lproj/Localizable.strings @@ -82,4 +82,4 @@ "enter_order_title" = "Informationen über Sortierweisen"; "enter_grade_help" = "Trage deine derzeitige Klasse ein, damit sie in deinem persönlichen Plan auftaucht.\n\nAnmerkung:\n\nIn der Mittelstufe müssen Nummer und Buchstabe zusammen geschrieben werden, Beispiel: \"5a\".\n\nIn der E-Phase müssen diese durch ein Leerzeichen getrennt werden, Beispiel: \"18 a\".\n\nIn der Q1/Q2 sollen nur die Nummern eingetragen werden, Beispiel: \"17\".\n\nMehrere Klassen können nur eingetragen werden, wenn keine Kurse eingetragen sind."; "enter_course_help" = "Trag die Kürzel für die Kurse ein, welche in deinem persönlichen Plan auftauchen sollen. Du kannst diese auf deinem Stundenplan finden.\n\nHier sind einige Beispiele:\n\nMathe in der 5. Klasse (Mittelstufe) wäre MAT.\n\nDer Englisch-Profilkurs in der E-Phase könnte ENP1 sein.\n\nDer Bio-Grundkurs in der Q1 ist z.B. bio1.\n\nMeist müssen Kurse für Mittelstufenschüler nicht eingetragen werden.\nTrenne mehrere Kurse mit Leerzeichen, Kommas sind optional.\nGroß- und Kleinschreibung wird beachtet."; -"enter_order_help" = "Du kannst zwischen zwei Sortierweisen auswählen, welche die Reihenfolge der Einträge auf dem Vertretungsplan bestimmen.\n\nStandardmäßig ist \'App-spezifisch\' ausgewählt; dies bietet einen konsistenten Plan sortiert nach Klassen, dann nach Stunden.\n\n\'Website-Original\' bietet die Original-Reihenfolge der Website. Diese ist jedoch nicht konsistent, weswegen \'App-spezifisch\' standardmäßig ausgewählt ist."; +"enter_order_help" = "Du kannst zwischen zwei Sortierweisen auswählen, welche die Reihenfolge der Einträge auf dem Vertretungsplan bestimmen.\n\nStandardmäßig ist \'App-Sortierung\' ausgewählt; dies bietet einen konsistenten Plan sortiert nach Klassen, dann nach Stunden.\n\n\'Website-Sortierung\' bietet die Original-Reihenfolge der Website. Diese ist jedoch nicht konsistent, weswegen \'App-Sortierung\' standardmäßig ausgewählt ist."; diff --git a/AvH Plan/de.lproj/Main.strings b/AvH Plan/de.lproj/Main.strings index 10b6dc2..8d19eaf 100644 --- a/AvH Plan/de.lproj/Main.strings +++ b/AvH Plan/de.lproj/Main.strings @@ -110,11 +110,11 @@ /* Class = "UIBarButtonItem"; title = "Customize"; ObjectID = "zsF-Jh-U3n"; */ "zsF-Jh-U3n.title" = "Anpassen"; -"ZCm-7a-IUx.placeholder" = "Dein Name"; +"A2b-5v-r2j.placeholder" = "Dein Name"; -"gOX-RF-Brg.placeholder" = "Deine Klasse"; +"x8A-kh-LX4.placeholder" = "Deine Klasse"; -"EDB-Mm-gGh.placeholder" = "Deine Kurse"; +"zxv-h1-Q8u.placeholder" = "Deine Kurse"; "JMH-JV-eMe.text" = "Standardplan"; @@ -122,10 +122,26 @@ "DPm-52-1Ww.segmentTitles[1]" = "Persönlich"; -"3iB-va-Cjs.text" = "Sortierweise"; +"1Nm-Wb-8js.segmentTitles[0]" = "App-Sortierung"; -"ol8-tW-I69.segmentTitles[0]" = "App-spezifisch"; +"1Nm-Wb-8js.segmentTitles[1]" = "Website-Sortierung"; -"ol8-tW-I69.segmentTitles[1]" = "Website-Original"; +"Dkg-Jy-5Sf.text" = "Persönlichen Plan bei App-Start öffnen"; -"YlM-R8-zk5.text" = "Aktualisiere Plan automatisch"; +"oiQ-2o-sH8.text" = "Bei App-Start aktualisieren"; + +"jng-S6-ZuJ.normalTitle" = "Stelle Kursfarben ein"; + +"bj2-hB-vVb.title" = "Benutzerdefinierte Farben"; + +"FhN-ih-qVW.title" = "Speichern"; + +"in4-ZK-bqT.title" = "Anpassen"; + +"g4a-cE-7bJ.title" = "Fertig"; + +"whN-45-XN6.headerTitle" = "Personalisieren"; + +"BHV-EE-xi3.headerTitle" = "Filter"; + +"N8h-rV-nYA.headerTitle" = "Diverses"; diff --git a/AvH Plan/en.lproj/Localizable.strings b/AvH Plan/en.lproj/Localizable.strings index d8bdfab..888da95 100644 --- a/AvH Plan/en.lproj/Localizable.strings +++ b/AvH Plan/en.lproj/Localizable.strings @@ -83,4 +83,4 @@ "enter_order_title" = "Information on ordering systems"; "enter_grade_help" = "Enter your current grade to have it appear in your personal plan.\n\nNote:\n\nIn junior phase, put the number and letter together, as in \"5a\".\n\nIn E-Phase, separate them by a space, as in \"18 a\".\n\nIn Q1/Q2, only put in the number, as in \"17\".\n\nMultiple grades can only be entered when no courses have been entered."; "enter_course_help" = "You need to enter the course abbreviation for every course you want in your personal plan. You can find them on your time table.\n\nHere\'s a few examples:\n\nMathematics in 5th grade (juniors) would be MAT.\n\nAdvanced English in E-Phase (seniors) for the English profile may be ENP1.\n\nBasic Biology in Q1 could be bio1.\n\nIn most cases, entering courses while in junior phase is redundant.\nSeparate multiple courses by spaces, commas are optional.\nCapitalisation is required."; -"enter_order_help" = "You may pick between two ordering systems that dictate the order in which the items on the substitution plan will appear in.\n\nThe default \'app-specific\' is an algorithm implemented in this app that provides a consistently-sorted substitution plan ordered just like the substitution plan on the website used to; sorted by classes, then by time.\n\n\'Website original\' offers the items on the substitution plan just like they\'re presented on the school website, but since these are not guaranteed to be consistent, \'app-specific\' is picked by default."; +"enter_order_help" = "You may pick between two ordering systems that dictate the order in which the items on the substitution plan will appear in.\n\nThe default \'app order\' is an algorithm implemented in this app that provides a consistently-sorted substitution plan ordered just like the substitution plan on the website used to; sorted by classes, then by time.\n\n\'Website order\' offers the items on the substitution plan just like they\'re presented on the school website, but since these are not guaranteed to be consistent, \'app order\' is picked by default.";