icon + improvements

main
Laurent 3 years ago
parent b4d9bca76b
commit f78c2de4a4
  1. 4
      LeCountdown.xcodeproj/project.pbxproj
  2. BIN
      LeCountdown/Assets.xcassets/AppIcon.appiconset/icon.png
  3. 2
      LeCountdown/Views/ContentView.swift
  4. 68
      LeCountdown/Views/Reusable/MailView.swift
  5. 10
      LeCountdown/Views/SettingsView.swift

@ -29,6 +29,7 @@
C415D3DB29C0B1EA0037B215 /* FF_SH_bowl_drone_tap_hold_E.wav in Resources */ = {isa = PBXBuildFile; fileRef = C415D3DA29C0B1EA0037B215 /* FF_SH_bowl_drone_tap_hold_E.wav */; };
C415D3DE29C0B2230037B215 /* FF_SH_flute_melody_ambient_stacked_profound_Dmin.wav in Resources */ = {isa = PBXBuildFile; fileRef = C415D3DD29C0B2230037B215 /* FF_SH_flute_melody_ambient_stacked_profound_Dmin.wav */; };
C415D3E029C0B22C0037B215 /* FF_SH_bowl_drone_tapping_C.wav in Resources */ = {isa = PBXBuildFile; fileRef = C415D3DF29C0B22C0037B215 /* FF_SH_bowl_drone_tapping_C.wav */; };
C415D3E229C0C0C20037B215 /* MailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C415D3E129C0C0C20037B215 /* MailView.swift */; };
C438C7C12980228B00BF3EF9 /* CountdownScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C438C7C02980228B00BF3EF9 /* CountdownScheduler.swift */; };
C438C7C5298024E900BF3EF9 /* NSManagedContext+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C438C7C4298024E900BF3EF9 /* NSManagedContext+Extensions.swift */; };
C438C7C929803CA000BF3EF9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C438C7C829803CA000BF3EF9 /* AppDelegate.swift */; };
@ -301,6 +302,7 @@
C415D3DA29C0B1EA0037B215 /* FF_SH_bowl_drone_tap_hold_E.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = FF_SH_bowl_drone_tap_hold_E.wav; sourceTree = "<group>"; };
C415D3DD29C0B2230037B215 /* FF_SH_flute_melody_ambient_stacked_profound_Dmin.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = FF_SH_flute_melody_ambient_stacked_profound_Dmin.wav; sourceTree = "<group>"; };
C415D3DF29C0B22C0037B215 /* FF_SH_bowl_drone_tapping_C.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = FF_SH_bowl_drone_tapping_C.wav; sourceTree = "<group>"; };
C415D3E129C0C0C20037B215 /* MailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailView.swift; sourceTree = "<group>"; };
C418A14F298428CB00C22230 /* LeCountdown.0.1.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = LeCountdown.0.1.xcdatamodel; sourceTree = "<group>"; };
C438C7C02980228B00BF3EF9 /* CountdownScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CountdownScheduler.swift; sourceTree = "<group>"; };
C438C7C4298024E900BF3EF9 /* NSManagedContext+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSManagedContext+Extensions.swift"; sourceTree = "<group>"; };
@ -810,6 +812,7 @@
children = (
C498E5A4299152B400E90DE0 /* GreenCheckmarkView.swift */,
C4742B5A298414B000D5D950 /* ImageSelectionView.swift */,
C415D3E129C0C0C20037B215 /* MailView.swift */,
C4F8B1D1298BF646005C86A5 /* PermissionAlertView.swift */,
C4F8B15E298961A7005C86A5 /* ReorderableForEach.swift */,
C4E5D68329BB2425008E7465 /* SeparatorView.swift */,
@ -1047,6 +1050,7 @@
C4BA2B36299F82FB00CB4FBA /* Fakes.swift in Sources */,
C498E5A1298D543900E90DE0 /* LiveTimer.swift in Sources */,
C4BA2B6329A3C34600CB4FBA /* Stat.swift in Sources */,
C415D3E229C0C0C20037B215 /* MailView.swift in Sources */,
C438C80F29828B8600BF3EF9 /* ActivitiesView.swift in Sources */,
C4E5D68029B8FD93008E7465 /* Store.swift in Sources */,
C4F8B187298AC234005C86A5 /* Activity+CoreDataProperties.swift in Sources */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 834 KiB

@ -103,7 +103,7 @@ struct ContentView<T : AbstractTimer>: View {
})
.sheet(isPresented: self.$showSettingsSheet, content: {
SettingsView()
.presentationDetents([.height(100.0)])
.presentationDetents([.height(150.0)])
})
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {

@ -0,0 +1,68 @@
//
// EmailService.swift
// LeCountdown
//
// Created by Laurent Morvillier on 14/03/2023.
//
import Foundation
import MessageUI
import SwiftUI
struct MailView: UIViewControllerRepresentable {
@Binding var isShowing: Bool
// @Binding var result: Result<MFMailComposeResult, Error>?
class Coordinator: NSObject, MFMailComposeViewControllerDelegate {
@Binding var isShowing: Bool
// @Binding var result: Result<MFMailComposeResult, Error>?
init(isShowing: Binding<Bool>) {
_isShowing = isShowing
// _result = result
}
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult,
error: Error?) {
isShowing = false
// guard error == nil else {
// self.result = .failure(error!)
// return
// }
// self.result = .success(result)
}
}
func makeCoordinator() -> Coordinator {
return Coordinator(isShowing: $isShowing)
}
func makeUIViewController(context: UIViewControllerRepresentableContext<MailView>) -> MFMailComposeViewController {
let vc = MFMailComposeViewController()
vc.mailComposeDelegate = context.coordinator
vc.setSubject(Bundle.main.applicationName)
vc.setToRecipients(["laurent@staxriver.com"])
return vc
}
func updateUIViewController(_ uiViewController: MFMailComposeViewController,
context: UIViewControllerRepresentableContext<MailView>) {
}
}
fileprivate extension Bundle {
var applicationName: String {
if let displayName: String = self.infoDictionary?["CFBundleDisplayName"] as? String {
return displayName
} else if let name: String = self.infoDictionary?["CFBundleName"] as? String {
return name
}
return ""
}
}

@ -11,15 +11,25 @@ struct SettingsView: View {
@State var confirmationSound = Preferences.playConfirmationSound
@State var showMailView: Bool = false
var body: some View {
Form {
Toggle("Play confirmation sound", isOn: self.$confirmationSound).onChange(of: self.confirmationSound) { newValue in
Preferences.playConfirmationSound = newValue
}
Button {
self.showMailView = true
} label: {
Text("Contact us")
}
}.sheet(isPresented: $showMailView) {
MailView(isShowing: $showMailView)
}
}
}
struct SettingsView_Previews: PreviewProvider {

Loading…
Cancel
Save