Skip to content

Commit

Permalink
Minor UI enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcharger committed Mar 5, 2024
1 parent a04fef0 commit abc1168
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 48 deletions.
4 changes: 3 additions & 1 deletion InfiniLink/Core/Home/DFU/DFUWithBLE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ struct DFURefreshButton: View {
NavigationView {
DFUWithBLE()
.onAppear {
BLEDeviceInfo.shared.firmware = "1.14.0"
BLEDeviceInfo.shared.firmware = "1.13.0"
BLEManager.shared.isConnectedToPinetime = true
BLEManager.shared.batteryLevel = 40
}
}
}
2 changes: 1 addition & 1 deletion InfiniLink/Core/Home/Heart/HeartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct HeartView: View {
Spacer()
Image(systemName: "heart")
.imageScale(.large)
.font(.system(size: 30).weight(.semibold))
.font(.system(size: 40).weight(.semibold))
.foregroundColor(.red)
VStack(spacing: 8) {
Text(NSLocalizedString("oops", comment: ""))
Expand Down
42 changes: 16 additions & 26 deletions InfiniLink/Core/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,6 @@ struct Settings_Page: View {
weatherController.tryRefreshingWeatherData()
}
}
if locationManager.authorizationStatus == .authorizedWhenInUse && useCurrentLocation{
Button {
locationManager.requestAlwaysAuthorization()
} label: {
Text(NSLocalizedString("always_allow_location_services", comment: ""))
.modifier(NeumorphicButtonModifer(bgColor: colorScheme == .dark ? Color.darkGray : Color.lightGray))
}
.frame(maxWidth: .infinity, alignment: .center)
}
NavigationLink(destination: WeatherSetLocationView()) {
HStack {
Text(NSLocalizedString("set_location", comment: ""))
Expand All @@ -178,27 +169,26 @@ struct Settings_Page: View {
}
.opacity(!useCurrentLocation ? 1.0 : 0.5)
.disabled(useCurrentLocation)
if locationManager.authorizationStatus == .authorizedWhenInUse && useCurrentLocation {
Group {
Text("To allow InfiniLink to update your device's weather in the background, please allow background location use in ") + Text("Settings").foregroundColor(.blue) + Text(".")
}
.onTapGesture {
guard let settingsURL = URL(string: UIApplication.openSettingsURLString) else { return }
if UIApplication.shared.canOpenURL(settingsURL) {
UIApplication.shared.open(settingsURL)
}
}
.font(.system(size: 14))
.foregroundColor(.gray)
.frame(maxWidth: .infinity, alignment: .center)
.padding(3)
.lineSpacing(1.1)
}
}
}
Spacer()
.frame(height: 6)
if autoconnectUUID != "" {
VStack {
Button {
autoconnectUUID = ""
bleManager.autoconnectToDevice = false
DebugLogManager.shared.debug(error: NSLocalizedString("autoconnect_device_cleared", comment: ""), log: .app, date: Date())
} label: {
Text(NSLocalizedString("clear_autoconnect_device", comment: ""))
.frame(maxWidth: .infinity, alignment: .leading)
.modifier(RowModifier(style: .capsule))
}
.opacity(!autoconnect || autoconnectUUID.isEmpty ? 0.5 : 1.0)
.disabled(!autoconnect || autoconnectUUID.isEmpty)
}
Spacer()
.frame(height: 6)
}
VStack {
Button(action: {
showClearHRMChartConf = true
Expand Down
12 changes: 0 additions & 12 deletions InfiniLink/Core/Weather/Views/WeatherDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,6 @@ struct WeatherDetailView: View {
.padding(.horizontal, -16)
}
Spacer()
Divider()
.padding(.horizontal, -16)
Group {
if !WeatherController.shared.nwsapiFailed {
Text("Data from NWS")
} else if !WeatherController.shared.weatherapiFailed {
Text("Data from WeatherAPI")
}
}
.padding(8)
.font(.system(size: 14).weight(.medium))
.foregroundColor(.gray)
}
}
.padding()
Expand Down
8 changes: 0 additions & 8 deletions InfiniLink/Core/Welcome/WelcomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,16 @@ struct WelcomeView: View {
}
.fullBackground(imageName: "LaunchScreen")
}

} else {
DeviceView()
}
}
.onAppear {
if bleManager.isSwitchedOn {
bleManager.startScanning()
}
}
.onDisappear {
if bleManager.isScanning {
bleManager.stopScanning()
}
}

}

}

struct NeumorphicButtonModifer: ViewModifier {
Expand Down

0 comments on commit abc1168

Please sign in to comment.