Couple of fixes

main
Laurent 3 years ago
parent 1739393345
commit 6b7416fb66
  1. 7
      LaunchWidget/SingleTimerView.swift
  2. 12
      LeCountdown.xcodeproj/project.pbxproj
  3. 59
      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) {
Spacer()
Text(timer.displayName.uppercased())
Text(timer.displayName.uppercased()).lineLimit(1)
if let countdown = timer as? Countdown {
Text(countdown.duration.minuteSecond)
}
@ -178,7 +178,7 @@ struct MultiCountdownView: View {
}
Spacer()
}
.padding(.horizontal, 8.0)
.padding(.horizontal, 12.0)
.font(.callout)
.background(Color.white.opacity(0.2))
// .background(Image(timer.imageName))
@ -189,7 +189,8 @@ struct MultiCountdownView: View {
}
}
.padding()
.padding(.horizontal, 12.0)
.padding(.vertical, 16.0)
.background(GradientView())
}

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

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

@ -69,7 +69,8 @@ struct TimersView: View {
.padding(.horizontal, itemSpacing)
} else {
Text("Disclaimer")
.padding()
.monospaced()
.padding(32.0)
.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!";
"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";
"Cancel %@" = "Annuler %@";
"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