Skip to content

Commit c3822c1

Browse files
committed
Clean up
1 parent d3c953f commit c3822c1

8 files changed

Lines changed: 23 additions & 31 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

InfiniLink/Core/Components/Charts/StepChartView.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,3 @@ struct StepChartView: View {
153153
}
154154
}
155155
}
156-
157-
extension Date {
158-
static func from(year: Int, month: Int, day: Int) -> Date {
159-
let components = DateComponents(year: year, month: month, day: day)
160-
return Calendar.current.date(from: components)!
161-
}
162-
}

InfiniLink/Core/Components/DetailHeaderView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ struct DetailHeaderView<V: View>: View {
9595
Image(systemName: header.icon)
9696
.foregroundStyle(header.accent)
9797
.font(.system(size: min(width / 4.4, 115)))
98-
.shadow(color: header.accent.opacity(0.7), radius: isHeartAnimating ? 20 : 0, x: 0, y: 0)
9998
.scaleEffect(isHeartAnimating ? 0.85 : 1.0)
10099
.animation(
101100
.snappy(duration: 0.9)

InfiniLink/Core/Settings/Notifications/NotificationsSettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct NotificationsSettingsView: View {
6363
Toggle("Stand-up Reminder", isOn: $standUpReminder)
6464
}
6565
*/
66-
Section(footer: Text("Get a notification whenn your heart rate goes above or below the specified range.")) {
66+
Section(footer: Text("Get a notification when your heart rate goes above or below the specified range.")) {
6767
Toggle("Heart Range Notifications", isOn: $heartRangeReminder)
6868
if heartRangeReminder {
6969
HStack {

InfiniLink/Core/StepsView.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ struct StepsView: View {
3030
var body: some View {
3131
GeometryReader { geo in
3232
List {
33-
Section {
34-
DetailHeaderView(Header(title: steps(for: Date()), subtitle: String(deviceManager.settings.stepsGoal), units: "Steps", icon: "figure.walk", accent: .blue), width: geo.size.width) {
35-
HStack {
36-
DetailHeaderSubItemView(title: "Dis",
37-
value: String(format: "%.2f", exerciseCalculator.calculateDistance(steps: bleManager.stepCount)),
38-
unit: personalizationController.units == .imperial ? "mi" : "m")
39-
DetailHeaderSubItemView(title: "Kcal", value: String(format: "%.1f", exerciseCalculator.calculateCaloriesBurned(steps: bleManager.stepCount)))
40-
}
33+
Section {
34+
DetailHeaderView(Header(title: steps(for: Date()), subtitle: String(deviceManager.settings.stepsGoal), units: "Steps", icon: "figure.walk", accent: .blue), width: geo.size.width) {
35+
HStack {
36+
DetailHeaderSubItemView(title: "Dis",
37+
value: String(format: "%.2f", exerciseCalculator.calculateDistance(steps: bleManager.stepCount)),
38+
unit: personalizationController.units == .imperial ? "mi" : "m")
39+
DetailHeaderSubItemView(title: "Kcal", value: String(format: "%.1f", exerciseCalculator.calculateCaloriesBurned(steps: bleManager.stepCount)))
4140
}
42-
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
43-
.listRowBackground(Color.clear)
4441
}
45-
StepChartView()
42+
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
43+
.listRowBackground(Color.clear)
44+
}
45+
StepChartView()
4646
}
4747
}
4848
.navigationTitle("Steps")

InfiniLink/Date+Extension.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ extension Date {
4141

4242
return calendar.date(from: components) ?? Date()
4343
}
44+
45+
static func from(year: Int, month: Int, day: Int) -> Date {
46+
let components = DateComponents(year: year, month: month, day: day)
47+
return Calendar.current.date(from: components)!
48+
}
4449
}
4550

4651
func date(year: Int, month: Int, day: Int = 1, hour: Int = 0, minutes: Int = 0, seconds: Int = 0) -> Date {

InfiniLink/Localizable.xcstrings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
"General" : {
423423

424424
},
425-
"Get a notification whenn your heart rate goes above or below the specified range." : {
425+
"Get a notification when your heart rate goes above or below the specified range." : {
426426

427427
},
428428
"Get notifications on your watch when you reach goals, when it's time to drink water, and more." : {

InfiniLink/Utils/MusicController.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,8 @@ class MusicController {
9292

9393

9494
func getCurrentSongInfo() -> SongInfo {
95-
var currentSongInfo: SongInfo = SongInfo(trackName: "", artistName: "")
96-
97-
DispatchQueue.main.async {
98-
let currentTrack = self.musicPlayer.nowPlayingItem
99-
currentSongInfo = SongInfo(trackName: currentTrack?.title ?? "Not Playing", artistName: currentTrack?.artist ?? "")
100-
}
101-
102-
return currentSongInfo
95+
let currentTrack = self.musicPlayer.nowPlayingItem
96+
return SongInfo(trackName: currentTrack?.title ?? "Not Playing", artistName: currentTrack?.artist ?? "")
10397
}
10498

10599
func updateMusicInformation(songInfo: MusicController.SongInfo) {
@@ -110,7 +104,8 @@ class MusicController {
110104
bleWriteManager.writeToMusicApp(message: songInfo.trackName, characteristic: bleManager.musicChars.track)
111105
bleWriteManager.writeToMusicApp(message: songInfo.artistName, characteristic: bleManager.musicChars.artist)
112106

113-
var playbackTime = musicPlayer.currentPlaybackTime; if playbackTime == musicPlayer.nowPlayingItem?.playbackDuration {playbackTime = 0.0}
107+
var playbackTime = musicPlayer.currentPlaybackTime
108+
114109
bleWriteManager.writeHexToMusicApp(message: convertTime(value: playbackTime), characteristic: bleManager.musicChars.position)
115110
bleWriteManager.writeHexToMusicApp(message: convertTime(value: musicPlayer.nowPlayingItem?.playbackDuration ?? 0.0), characteristic: bleManager.musicChars.length)
116111

@@ -122,7 +117,7 @@ class MusicController {
122117
}
123118

124119
func convertTime(value: Double) -> [UInt8] {
125-
let val32 : UInt32 = UInt32(floor(value))
120+
let val32: UInt32 = UInt32(floor(value))
126121

127122
let byte1 = UInt8(val32 & 0x000000FF)
128123
let byte2 = UInt8((val32 & 0x0000FF00) >> 8)

0 commit comments

Comments
 (0)