Couple of fixes

main
Laurent 3 years ago
parent 1739393345
commit 6b7416fb66
  1. 7
      LaunchWidget/SingleTimerView.swift
  2. 12
      LeCountdown.xcodeproj/project.pbxproj
  3. 57
      LeCountdown/Views/ContentView.swift
  4. 3
      LeCountdown/Views/TimersView.swift
  5. 2
      LeCountdown/en.lproj/Localizable.strings
  6. 2
      LeCountdown/fr.lproj/Localizable.strings

@ -170,7 +170,7 @@ struct MultiCountdownView: View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Spacer() Spacer()
Text(timer.displayName.uppercased()) Text(timer.displayName.uppercased()).lineLimit(1)
if let countdown = timer as? Countdown { if let countdown = timer as? Countdown {
Text(countdown.duration.minuteSecond) Text(countdown.duration.minuteSecond)
} }
@ -178,7 +178,7 @@ struct MultiCountdownView: View {
} }
Spacer() Spacer()
} }
.padding(.horizontal, 8.0) .padding(.horizontal, 12.0)
.font(.callout) .font(.callout)
.background(Color.white.opacity(0.2)) .background(Color.white.opacity(0.2))
// .background(Image(timer.imageName)) // .background(Image(timer.imageName))
@ -189,7 +189,8 @@ struct MultiCountdownView: View {
} }
} }
.padding() .padding(.horizontal, 12.0)
.padding(.vertical, 16.0)
.background(GradientView()) .background(GradientView())
} }

@ -1640,7 +1640,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = LeCountdown/LeCountdown.entitlements; CODE_SIGN_ENTITLEMENTS = LeCountdown/LeCountdown.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"LeCountdown/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"LeCountdown/Preview Content\"";
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
@ -1677,7 +1677,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = LeCountdown/LeCountdown.entitlements; CODE_SIGN_ENTITLEMENTS = LeCountdown/LeCountdown.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_ASSET_PATHS = "\"LeCountdown/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"LeCountdown/Preview Content\"";
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
@ -1789,7 +1789,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = LaunchWidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = LaunchWidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LaunchWidget/Info.plist; INFOPLIST_FILE = LaunchWidget/Info.plist;
@ -1817,7 +1817,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = LaunchWidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = LaunchWidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LaunchWidget/Info.plist; INFOPLIST_FILE = LaunchWidget/Info.plist;
@ -1843,7 +1843,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = LaunchIntents/LaunchIntents.entitlements; CODE_SIGN_ENTITLEMENTS = LaunchIntents/LaunchIntents.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LaunchIntents/Info.plist; INFOPLIST_FILE = LaunchIntents/Info.plist;
@ -1870,7 +1870,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = LaunchIntents/LaunchIntents.entitlements; CODE_SIGN_ENTITLEMENTS = LaunchIntents/LaunchIntents.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LaunchIntents/Info.plist; INFOPLIST_FILE = LaunchIntents/Info.plist;

@ -76,11 +76,6 @@ struct ContentView<T : AbstractTimer>: View {
.sheet(isPresented: self.$boringContext.isShowingNewData, content: { .sheet(isPresented: self.$boringContext.isShowingNewData, content: {
}) })
.toolbar { .toolbar {
// if Conductor.maestro.memoryWarningReceived {
// ToolbarItemGroup(placement: .navigationBarTrailing) {
// Image(systemName: "circle.fill").font(.caption2).foregroundColor(.orange)
// }
// }
MainToolbarView(isEditing: self.$isEditing) MainToolbarView(isEditing: self.$isEditing)
} }
.onAppear { .onAppear {
@ -147,8 +142,6 @@ struct ContentView<T : AbstractTimer>: View {
} }
// print("Start countdown: \(countdown.name ?? ""), \(countdown.duration)")
// self._launchCountdown(countdown)
} else { } else {
print("timer not found with id = \(urlString)") print("timer not found with id = \(urlString)")
} }
@ -159,7 +152,7 @@ struct ContentView<T : AbstractTimer>: View {
struct MainToolbarView: ToolbarContent { struct MainToolbarView: ToolbarContent {
@Environment(\.managedObjectContext) private var viewContext // @Environment(\.managedObjectContext) private var viewContext
@Binding var isEditing: Bool @Binding var isEditing: Bool
@ -169,14 +162,24 @@ struct MainToolbarView: ToolbarContent {
@State var showTimerSheet: Bool = false @State var showTimerSheet: Bool = false
@State var showStopwatchSheet: Bool = false @State var showStopwatchSheet: Bool = false
@FetchRequest(
sortDescriptors: [NSSortDescriptor(keyPath: \AbstractTimer.order, ascending: true)],
animation: .default)
private var timers: FetchedResults<AbstractTimer>
@FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Record.start, ascending: true)])
private var records: FetchedResults<Record>
var body: some ToolbarContent { var body: some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) { if !self.timers.isEmpty {
Button { ToolbarItem(placement: .navigationBarLeading) {
withAnimation { Button {
self.isEditing.toggle() withAnimation {
self.isEditing.toggle()
}
} label: {
Text(self.isEditing ? "Done" : "Edit")
} }
} label: {
Text(self.isEditing ? "Done" : "Edit")
} }
} }
ToolbarItemGroup(placement: .navigationBarTrailing) { ToolbarItemGroup(placement: .navigationBarTrailing) {
@ -192,7 +195,7 @@ struct MainToolbarView: ToolbarContent {
// LogsView().navigationTitle("Logs") // LogsView().navigationTitle("Logs")
// } // }
// }) // })
if self.haveRecords() { if !self.records.isEmpty {
Button { Button {
withAnimation { withAnimation {
self.showStatsSheet.toggle() self.showStatsSheet.toggle()
@ -209,17 +212,19 @@ struct MainToolbarView: ToolbarContent {
} }
}) })
} }
Button { if !self.timers.isEmpty {
withAnimation { Button {
self.showSettingsSheet.toggle() withAnimation {
self.showSettingsSheet.toggle()
}
} label: {
Image(systemName: "gearshape.fill")
} }
} label: { .sheet(isPresented: self.$showSettingsSheet, content: {
Image(systemName: "gearshape.fill") SettingsView()
.presentationDetents([.height(280.0)])
})
} }
.sheet(isPresented: self.$showSettingsSheet, content: {
SettingsView()
.presentationDetents([.height(280.0)])
})
Button { Button {
withAnimation { withAnimation {
self.showAddSheet.toggle() self.showAddSheet.toggle()
@ -247,10 +252,6 @@ struct MainToolbarView: ToolbarContent {
} }
func haveRecords() -> Bool {
return self.viewContext.count(entityName: "Record") > 0
}
} }
fileprivate extension Countdown { fileprivate extension Countdown {

@ -69,7 +69,8 @@ struct TimersView: View {
.padding(.horizontal, itemSpacing) .padding(.horizontal, itemSpacing)
} else { } else {
Text("Disclaimer") Text("Disclaimer")
.padding() .monospaced()
.padding(32.0)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
} }

@ -1,2 +1,2 @@
"You'll find your timers here. Start by creating them on the left screen" = "You'll find your timers here.\nStart by creating using the top right button!"; "You'll find your timers here. Start by creating them on the left screen" = "You'll find your timers here.\nStart by creating using the top right button!";
"Disclaimer" = "This is a beta version of Enchant.\n\nPlease don't depend on the app for critical events :)\n\n If you ever encounter an issue, please let me know about it by going in the settings."; "Disclaimer" = "This is a beta version of Enchant.\n\nPlease don't depend on the app for critical events :)\n\n If you have some feedback or an issue, please tell me about it through the settings or within Testflight!";

@ -265,4 +265,4 @@
"Default Volume" = "Volume par défaut"; "Default Volume" = "Volume par défaut";
"Cancel %@" = "Annuler %@"; "Cancel %@" = "Annuler %@";
"Calendar" = "Calendrier"; "Calendar" = "Calendrier";
"Disclaimer" = "Ceci est une version beta d'Enchante.\n\nVeillez à ne dépendre de l'app pour des évènements trop critiques :)\n\n Si jamais vous rencontrez un problème, merci de me contacter en allant dans les réglages."; "Disclaimer" = "Ceci est une version beta d'Enchante.\n\nPour l'instant, veillez à ne pas dépendre de l'app pour des évènements trop critiques, on ne sait jamais :)\n\nSi vous avez des remarques ou un problème, merci de me contacter en allant dans les réglages.";

Loading…
Cancel
Save