main
Laurent 3 years ago
parent 32bd299739
commit b42e494ac5
  1. 98
      LeCountdown/Views/ContentView.swift
  2. 1
      LeCountdown/fr.lproj/Localizable.strings

@ -65,60 +65,68 @@ struct ContentView<T : AbstractTimer>: View {
var body: some View { var body: some View {
let columns: [GridItem] = self._columns() let columns: [GridItem] = self._columns()
let timers: [AbstractTimer] = Array(self.timers)
GeometryReader { reader in Group {
let width: CGFloat = reader.size.width / CGFloat(columns.count) - 15.0 if timers.count > 0 {
VStack { GeometryReader { reader in
let width: CGFloat = reader.size.width / CGFloat(columns.count) - 15.0
ScrollView { VStack {
LazyVGrid( ScrollView {
columns: columns,
spacing: itemSpacing
) {
ReorderableForEach(items: Array(self.timers)) { timer in LazyVGrid(
columns: columns,
spacing: itemSpacing
) {
DialView(timer: timer, isEditingBinding: self.$isEditing, frameSize: width, handler: { id in ReorderableForEach(items: timers) { timer in
self._handleSiriTips(timerId: id)
})
.environment(\.managedObjectContext, viewContext)
.environmentObject(Conductor.maestro)
.environmentObject(boringContext)
} moveAction: { from, to in
self._reorder(from: from, to: to)
}
} DialView(timer: timer, isEditingBinding: self.$isEditing, frameSize: width, handler: { id in
}.padding(.horizontal, itemSpacing) self._handleSiriTips(timerId: id)
})
.environment(\.managedObjectContext, viewContext)
.environmentObject(Conductor.maestro)
.environmentObject(boringContext)
} moveAction: { from, to in
self._reorder(from: from, to: to)
}
}
}.padding(.horizontal, itemSpacing)
// if !self.tipsShown, let tip = Preferences.tipToShow { // if !self.tipsShown, let tip = Preferences.tipToShow {
// TipView(tip: tip) { // TipView(tip: tip) {
// self._hideTip(tip) // self._hideTip(tip)
// }.padding() // }.padding()
// } // }
Spacer() Spacer()
SiriTipView(intent: StartTimerIntent(), isVisible: self.$siriTipShown) SiriTipView(intent: StartTimerIntent(), isVisible: self.$siriTipShown)
.siriTipViewStyle(SiriTipViewStyle.dark).padding() .siriTipViewStyle(SiriTipViewStyle.dark).padding()
if !conductor.liveTimers.isEmpty { if !conductor.liveTimers.isEmpty {
HStack(alignment: .center) { HStack(alignment: .center) {
VolumeView().padding(12.0) VolumeView().padding(12.0)
}.frame(width: 300.0, height: 40.0) }.frame(width: 300.0, height: 40.0)
.background(Color(white: 0.9)) .background(Color(white: 0.9))
.cornerRadius(16.0) .cornerRadius(16.0)
LiveTimerListView() LiveTimerListView()
.environment(\.managedObjectContext, viewContext) .environment(\.managedObjectContext, viewContext)
.environmentObject(conductor) .environmentObject(conductor)
.foregroundColor(.white) .foregroundColor(.white)
.background(Color(white: 0.1)) .background(Color(white: 0.1))
.cornerRadius(32.0, corners: [.topRight, .topLeft]) .cornerRadius(32.0, corners: [.topRight, .topLeft])
}
}
} }
} else {
Text("You'll find your timers here. Start by creating them on the left screen")
} }
} }
.navigationTitle("Home") .navigationTitle("Home")
@ -133,15 +141,6 @@ struct ContentView<T : AbstractTimer>: View {
// .environment(\.managedObjectContext, viewContext) // .environment(\.managedObjectContext, viewContext)
}) })
.toolbar { .toolbar {
// ToolbarItem(placement: .navigationBarTrailing) {
// Button {
// self.boringContext.isShowingNewData = true
// } label: {
// HStack {
// Image(systemName: "plus")
// }
// }
// }
ToolbarItem(placement: .navigationBarTrailing) { ToolbarItem(placement: .navigationBarTrailing) {
Button { Button {
withAnimation { withAnimation {
@ -154,7 +153,6 @@ struct ContentView<T : AbstractTimer>: View {
} }
.onAppear { .onAppear {
self._askPermissions() self._askPermissions()
// self.showLiveTimersSheet = !conductor.liveTimers.isEmpty
} }
.onOpenURL { url in .onOpenURL { url in
self._performActionIfPossible(url: url) self._performActionIfPossible(url: url)

@ -247,3 +247,4 @@
"Timer %@ started" = "Le minuteur %@ a démarré"; "Timer %@ started" = "Le minuteur %@ a démarré";
"The timer has not been found in the app" = "Le minuteur n'a pas été trouvé dans l'app"; "The timer has not been found in the app" = "Le minuteur n'a pas été trouvé dans l'app";
"In-app purchase disabled" = "Les achats in-app sont désactivés. Veuillez les activer si vous souhaitez vous abonner"; "In-app purchase disabled" = "Les achats in-app sont désactivés. Veuillez les activer si vous souhaitez vous abonner";
"You'll find your timers here. Start by creating them on the left screen" = "Vous retrouverez vos minuteurs ici. Commencez par en créer dans l'écran de gauche";

Loading…
Cancel
Save