Archived
Added empty food menu notice, code for checking the app version, possible fix for jumpy CollectionView behaviour, TODO: check on real device
This commit is contained in:
@@ -722,7 +722,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.denizd.substitutionplan;
|
PRODUCT_BUNDLE_IDENTIFIER = "denizd.AvH-Plan";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
@@ -742,7 +742,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.denizd.substitutionplan;
|
PRODUCT_BUNDLE_IDENTIFIER = "denizd.AvH-Plan";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
|||||||
@@ -119,6 +119,13 @@ class CustomizationViewController: UITableViewController, UITextFieldDelegate, U
|
|||||||
self.prefs.set(newValue, forKey: "use_test_urls")
|
self.prefs.set(newValue, forKey: "use_test_urls")
|
||||||
toastMessage = "Test URLs set to \(newValue)"
|
toastMessage = "Test URLs set to \(newValue)"
|
||||||
break
|
break
|
||||||
|
case "_version":
|
||||||
|
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
|
||||||
|
toastMessage = "App version: \(version)"
|
||||||
|
} else {
|
||||||
|
toastMessage = "Version couldn't be resolved"
|
||||||
|
}
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
toastMessage = NSLocalizedString("invalid_code", comment: "")
|
toastMessage = NSLocalizedString("invalid_code", comment: "")
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ class DataFetcher {
|
|||||||
|
|
||||||
var isPlanEmpty = true
|
var isPlanEmpty = true
|
||||||
var isPersonalEmpty = true
|
var isPersonalEmpty = true
|
||||||
|
var isFoodMenuEmpty = true
|
||||||
var personalPlanCount = 0
|
var personalPlanCount = 0
|
||||||
var mWebsitePriority = 0
|
var mWebsitePriority = 0
|
||||||
|
|
||||||
@@ -267,6 +268,7 @@ class DataFetcher {
|
|||||||
indices.append(foodItems.size())
|
indices.append(foodItems.size())
|
||||||
|
|
||||||
for l in 0..<indices.count - 1 {
|
for l in 0..<indices.count - 1 {
|
||||||
|
isFoodMenuEmpty = false
|
||||||
var s = ""
|
var s = ""
|
||||||
for i2 in indices[l]..<indices[l + 1] {
|
for i2 in indices[l]..<indices[l + 1] {
|
||||||
if (s.isEmpty) {
|
if (s.isEmpty) {
|
||||||
@@ -290,8 +292,12 @@ class DataFetcher {
|
|||||||
|
|
||||||
prefs.set(infoString.trimmingCharacters(in: .whitespacesAndNewlines), forKey: "information")
|
prefs.set(infoString.trimmingCharacters(in: .whitespacesAndNewlines), forKey: "information")
|
||||||
|
|
||||||
for food in foodmenuList {
|
if isFoodMenuEmpty {
|
||||||
try db.run(foodmenu.insert(text <- food))
|
try db.run(foodmenu.insert(text <- NSLocalizedString("food_menu_empty", comment: "")))
|
||||||
|
} else {
|
||||||
|
for food in foodmenuList {
|
||||||
|
try db.run(foodmenu.insert(text <- food))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ class MenuViewController : UICollectionViewController, UICollectionViewDelegateM
|
|||||||
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func loadView() {
|
||||||
|
super.loadView()
|
||||||
|
self.collectionView.isPrefetchingEnabled = false
|
||||||
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
|
|
||||||
@@ -58,7 +63,6 @@ class MenuViewController : UICollectionViewController, UICollectionViewDelegateM
|
|||||||
self.extendedLayoutIncludesOpaqueBars = true
|
self.extendedLayoutIncludesOpaqueBars = true
|
||||||
self.collectionView.contentInsetAdjustmentBehavior = .always
|
self.collectionView.contentInsetAdjustmentBehavior = .always
|
||||||
self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("food_menu", comment: "")
|
self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("food_menu", comment: "")
|
||||||
self.collectionView.isPrefetchingEnabled = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func objDoAsync(_ sender: Any) {
|
@objc private func objDoAsync(_ sender: Any) {
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ class PlanViewController : UICollectionViewController, UICollectionViewDelegateM
|
|||||||
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func loadView() {
|
||||||
|
super.loadView()
|
||||||
|
self.collectionView.isPrefetchingEnabled = false
|
||||||
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
|
|
||||||
if !self.prefs.bool(forKey: "logged_in") {
|
if !self.prefs.bool(forKey: "logged_in") {
|
||||||
@@ -96,7 +101,6 @@ class PlanViewController : UICollectionViewController, UICollectionViewDelegateM
|
|||||||
|
|
||||||
self.collectionView.contentInsetAdjustmentBehavior = .always
|
self.collectionView.contentInsetAdjustmentBehavior = .always
|
||||||
self.df.setTabBarBadge(for: self.tabBarController?.tabBar.items)
|
self.df.setTabBarBadge(for: self.tabBarController?.tabBar.items)
|
||||||
self.collectionView.isPrefetchingEnabled = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getViewType() -> String {
|
func getViewType() -> String {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
|
|
||||||
"plan_empty" = "Der Vertretungsplan ist leer";
|
"plan_empty" = "Der Vertretungsplan ist leer";
|
||||||
"personal_plan_empty" = "Dein Plan ist leer :(";
|
"personal_plan_empty" = "Dein Plan ist leer :(";
|
||||||
|
"food_menu_empty" = "Der Speiseplan ist leer";
|
||||||
|
|
||||||
// titles
|
// titles
|
||||||
"avh_plan" = "AvH-Plan";
|
"avh_plan" = "AvH-Plan";
|
||||||
|
|||||||
@@ -68,6 +68,7 @@
|
|||||||
|
|
||||||
"plan_empty" = "The substitution plan is empty";
|
"plan_empty" = "The substitution plan is empty";
|
||||||
"personal_plan_empty" = "Your plan is empty :(";
|
"personal_plan_empty" = "Your plan is empty :(";
|
||||||
|
"food_menu_empty" = "The food menu is empty";
|
||||||
|
|
||||||
// titles
|
// titles
|
||||||
"avh_plan" = "AvH Plan";
|
"avh_plan" = "AvH Plan";
|
||||||
|
|||||||
Reference in New Issue
Block a user