Skip to content

Commit

Permalink
Reorganize file structure and cleanup project
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcharger committed Mar 5, 2024
1 parent 914f760 commit 7b29ba2
Show file tree
Hide file tree
Showing 74 changed files with 292 additions and 387 deletions.
Binary file modified .DS_Store
Binary file not shown.
272 changes: 168 additions & 104 deletions InfiniLink.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file modified InfiniLink/.DS_Store
Binary file not shown.
21 changes: 0 additions & 21 deletions InfiniLink/Assets.xcassets/WatchHomePage.imageset/Contents.json

This file was deleted.

Binary file not shown.
6 changes: 0 additions & 6 deletions InfiniLink/Assets.xcassets/watchface/Contents.json

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
21 changes: 0 additions & 21 deletions InfiniLink/Assets.xcassets/watchface/analog.imageset/Contents.json

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import SwiftUI

struct BarView: View {

var value: CGFloat
var cornerRadius: CGFloat
var width: CGFloat
Expand All @@ -24,11 +23,9 @@ struct BarView: View {
.frame(width: width, height: value * (height / valueHeight)).foregroundColor(value > 20 ? .green : .red)
Rectangle()
.frame(width: width, height: (value * (height / valueHeight)) / 2).foregroundColor(value > 20 ? .green : .red)

}
Spacer()
}

}
}

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
//
// SettingsFunctions.swift
// BatteryNotifications.swift
// InfiniLink
//
// Created by Alex Emry on 8/15/21.
//
// Created by Liam Willey on 3/4/24.
//


import Foundation
import SwiftUI

class BatteryNotifications: ObservableObject {
@ObservedObject var notificationManager = NotificationManager()
@Published var twenty: Bool = false
@Published var ten: Bool = false
@Published var twenty: Bool = false
@Published var ten: Bool = false

func notify(bat: Int, bleManager: BLEManager) {
let bleWriteManger = BLEWriteManager()
if UserDefaults.standard.object(forKey: "batteryNotification") as! Bool? == true{
if bat > 20 {
twenty = false
ten = false
func notify(bat: Int, bleManager: BLEManager) {
let bleWriteManger = BLEWriteManager()
if UserDefaults.standard.object(forKey: "batteryNotification") as! Bool? == true{
if bat > 20 {
twenty = false
ten = false
} else if (bat <= 20 && bat > 10) && twenty == false {
notificationManager.sendLowBatteryNotification(bat: bat)
bleWriteManger.sendNotification(title: NSLocalizedString("battery_low", comment: ""), body: "\(bat)% " + NSLocalizedString("battery_low_message", comment: ""))
twenty = true
} else if (bat <= 10 && bat > 5) && ten == false {
twenty = true
} else if (bat <= 10 && bat > 5) && ten == false {
notificationManager.sendLowBatteryNotification(bat: bat)
bleWriteManger.sendNotification(title: NSLocalizedString("battery_low", comment: ""), body: "\(bat)% " + NSLocalizedString("battery_low_message", comment: ""))
ten = true
}
}
}
ten = true
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions InfiniLink/Core/Home/Heart/Chart/HeartChartView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// HeartChartView.swift
// InfiniLink
//
// Created by Liam Willey on 3/4/24.
//

import SwiftUI

struct HeartChartView: View {
@ObservedObject var bleManagerVal = BLEManagerVal.shared
@Environment(\.colorScheme) var scheme
var body: some View {
NavigationLink(destination: HeartView()) {
VStack {
HStack {
Image(systemName: "heart.fill")
.foregroundColor(.red)
Text(NSLocalizedString("heart_rate", comment: ""))
.foregroundColor(.red)
.frame(maxWidth: .infinity, alignment: .leading)
}
Spacer(minLength: 24)
HStack(alignment: .bottom) {
Text(String(Int(bleManagerVal.heartBPM)))
.foregroundColor(scheme == .dark ? .white : .black)
.font(.system(size: 28))
.bold()
Text(NSLocalizedString("bpm", comment: ""))
.foregroundColor(.gray)
.bold()
.font(.system(size: 14))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.padding(5)
}
}
}

#Preview {
HeartChartView()
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//
// BLEStatusView.swift
// StepsChartView.swift
// InfiniLink
//
// Created by Alex Emry on 8/13/21.
// Created by Liam Willey on 3/4/24.
//

import Foundation
import SwiftUI

struct StepsChartView: View {
Expand Down Expand Up @@ -40,35 +39,6 @@ struct StepsChartView: View {
}
}


struct HeartChartView: View {
@ObservedObject var bleManagerVal = BLEManagerVal.shared
@Environment(\.colorScheme) var scheme
var body: some View {
NavigationLink(destination: HeartView()) {
VStack {
HStack {
Image(systemName: "heart.fill")
.foregroundColor(.red)
Text(NSLocalizedString("heart_rate", comment: ""))
.foregroundColor(.red)
.frame(maxWidth: .infinity, alignment: .leading)
}
Spacer(minLength: 24)
HStack(alignment: .bottom) {
Text(String(Int(bleManagerVal.heartBPM)))
.foregroundColor(scheme == .dark ? .white : .black)
.font(.system(size: 28))
.bold()
Text(NSLocalizedString("bpm", comment: ""))
.foregroundColor(.gray)
.bold()
.font(.system(size: 14))
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.padding(5)
}
}
#Preview {
StepsChartView()
}

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7b29ba2

Please sign in to comment.