Skip to content

Commit

Permalink
Last-minute bug fixes and some clarity improvements for renaming of w…
Browse files Browse the repository at this point in the history
…atches
  • Loading branch information
xan-m committed Sep 28, 2021
1 parent 9918922 commit 2d7137c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 49 deletions.
8 changes: 4 additions & 4 deletions Infini-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
2617EF37270364CE00FE6F48 /* ChartViewSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF36270364CE00FE6F48 /* ChartViewSelector.swift */; };
2617EF3927036C9B00FE6F48 /* WhatsNewSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */; };
2617EF3D27036DC600FE6F48 /* WhatsNewBody090.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */; };
2617EF3D27036DC600FE6F48 /* WhatsNewBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */; };
26318B1626CB27E70036051E /* Infini_iOS.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 26318B1426CB27E70036051E /* Infini_iOS.xcdatamodeld */; };
2632388426F2531C00D72B43 /* DFUWithBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2632388326F2531C00D72B43 /* DFUWithBLE.swift */; };
2632388626F2548600D72B43 /* DFUWithoutBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2632388526F2548600D72B43 /* DFUWithoutBLE.swift */; };
Expand Down Expand Up @@ -85,7 +85,7 @@
/* Begin PBXFileReference section */
2617EF36270364CE00FE6F48 /* ChartViewSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartViewSelector.swift; sourceTree = "<group>"; };
2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewSheet.swift; sourceTree = "<group>"; };
2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewBody090.swift; sourceTree = "<group>"; };
2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewBody.swift; sourceTree = "<group>"; };
26318B1526CB27E70036051E /* Infini_iOS.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Infini_iOS.xcdatamodel; sourceTree = "<group>"; };
2632388326F2531C00D72B43 /* DFUWithBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUWithBLE.swift; sourceTree = "<group>"; };
2632388526F2548600D72B43 /* DFUWithoutBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUWithoutBLE.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -177,7 +177,7 @@
isa = PBXGroup;
children = (
2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */,
2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */,
2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */,
);
path = "What's New";
sourceTree = "<group>";
Expand Down Expand Up @@ -544,7 +544,7 @@
26318B1626CB27E70036051E /* Infini_iOS.xcdatamodeld in Sources */,
266F53EC26FAABE7007481A6 /* TimeRangeTabs.swift in Sources */,
26C5FAD826FC129400921207 /* ArbitraryNotificationView.swift in Sources */,
2617EF3D27036DC600FE6F48 /* WhatsNewBody090.swift in Sources */,
2617EF3D27036DC600FE6F48 /* WhatsNewBody.swift in Sources */,
264BFE7626BC52720050A223 /* HexStringToData.swift in Sources */,
2632388626F2548600D72B43 /* DFUWithoutBLE.swift in Sources */,
26C5FADC26FE7EB000921207 /* SheetCloseButton.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions Infini-iOS/View Components/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import SwiftUI
struct Settings_Page: View {

@ObservedObject var bleManager = BLEManager.shared
@ObservedObject var deviceInfo = BLEDeviceInfo.shared
@Environment(\.colorScheme) var colorScheme

@AppStorage("watchNotifications") var watchNotifications: Bool = true
Expand All @@ -28,6 +29,7 @@ struct Settings_Page: View {
@State private var changedName: String = ""
private var nameManager = DeviceNameManager()
@State private var resultMessage = ""
@State private var deviceName = ""

var body: some View {
VStack {
Expand All @@ -52,6 +54,7 @@ struct Settings_Page: View {
}.disabled(!autoconnect || autoconnectUUID.isEmpty)
}
Section(header: Text("Device Name")) {
Text("Current Device Name: " + deviceInfo.deviceName)
TextField("Enter New Name", text: $changedName)
Button {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
Expand Down
14 changes: 4 additions & 10 deletions Infini-iOS/View Components/Sheets/SheetManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,27 @@ class SheetManager: ObservableObject {
private var whatsNew: Bool = true

let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
var lastVersion = UserDefaults.standard.value(forKey: "lastVersion") as? String ?? ""
var defaults = UserDefaults.standard

func showWhatsNew () -> Bool {
if !whatsNew {
return false
} else {
var showSheet = false

print("before: ", lastVersion, " <last | current> ", currentVersion)
if lastVersion == "" {
lastVersion = "0.0.0"
}

let lastVersion = defaults.value(forKey: "lastVersion") as? String ?? "0.0.0"
let comparison = currentVersion.compare(lastVersion, options: .numeric)
if comparison == .orderedDescending {
showSheet = true
}
lastVersion = currentVersion
defaults.set(currentVersion, forKey: "lastVersion")
whatsNew = false

print(showSheet)
return showSheet
}
}

func setNextSheet() {
let onboarding = UserDefaults.standard.value(forKey: "onboarding")// as? Bool ?? true
let onboarding = defaults.value(forKey: "onboarding")
if onboarding == nil {
SheetManager.shared.sheetSelection = .onboarding
SheetManager.shared.showSheet = true
Expand Down
43 changes: 43 additions & 0 deletions Infini-iOS/View Components/Sheets/What's New/WhatsNewBody.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// WhatsNewBody090.swift
// Infini-iOS
//
// Created by Alex Emry on 9/28/21.
//
//


import SwiftUI

struct WhatsNewBody: View {

var body: some View {
ScrollView{
Text("UI Changes")
.font(.title2)
.padding()
Text("Tons of UI changes: New 'Home' view features some stats about your watch and the connect/disconnect button. DFU page was cleaned up a little. Color scheme changes were made to improve clarity for light mode users.")
.padding()
Text("Chart Persistence")
.font(.title2)
.padding()
Text("Infini-iOS is now capable of saving chart data as it is generated, and chart data can now be filtered by time. I've set the watch to prune data older than a week for now, but am open to suggestions!")
Text("Device Naming")
.font(.title2)
.padding()
Text("Devices can now be named in Infini-iOS! While this name has no effect on the watch, setting a name for the device in Infini-iOS associates the UUID of the watch with the new name. Any time this watch would appear on screen (Home screen, Connect screen, etc), your chosen name will display instead of 'InfiniTime'. Hopefully this will be helpful for those of you that have more than one watch!")
.padding()
Text("Arbitrary Notifications")
.font(.title2)
.padding()
Text("Now you can send arbitrary notifications to your PineTime from the Settings Menu. Have a short list of stuff to get at the store? Send the list as a notification and it will be on your wrist as you shop!")
.padding()
Text("Firmware Updates")
.font(.title2)
.padding()
Text("- Updated DFU process: DFU downloads are now available! Now, when you tap the 'Select Firmware File' button, you're given the option to select a local file or download a firmware file. Tapping the download button uses the GitHub API to bring up a list of firmware files available on GitHub. Selecting a file from that list will download it and prepare it for flashing. After flashing, the file is deleted. Also, when a watch is connected, Infini-iOS will compare the firmware version number on the watch to this list, and notify you of any updates on the Home screen.")
.padding()
}
}
}

33 changes: 0 additions & 33 deletions Infini-iOS/View Components/Sheets/What's New/WhatsNewBody090.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ struct WhatsNew: View {
ScrollView{
VStack {
Text(String("What's New in \(appVersion!)"))
.font(.title2)
.font(.largeTitle)
.padding(.horizontal)
Text("Welcome to the new version of Infini-iOS! I hope you enjoy the features I've added to the app for this version. Please feel free to get in touch with me about any issues you experience or changes you'd like to see!")
.padding()

WhatsNew090()
WhatsNewBody()
OnboardingDismissButton()
}
}
Expand Down

0 comments on commit 2d7137c

Please sign in to comment.