remove images

splits
Laurent 2 years ago
parent d5ee77128c
commit 63f4327e8c
  1. 24
      LeCountdown/Views/Countdown/CountdownFormView.swift
  2. 4
      LeCountdown/Views/Countdown/NewCountdownView.swift
  3. 14
      LeCountdown/Views/Reusable/SoundFormView.swift
  4. 10
      LeCountdown/Views/Stopwatch/NewStopwatchView.swift
  5. 3
      LeCountdown/Views/Stopwatch/StopwatchFormView.swift

@ -24,7 +24,6 @@ struct CountdownFormView : View {
var nameBinding: Binding<String>
var durationBinding: Binding<TimeInterval>
var imageBinding: Binding<CoolPic>
var hasRanges: Bool
@ -56,15 +55,6 @@ struct CountdownFormView : View {
}
}
Section {
HStack {
Stepper("Repeat Count", value: self.$model.repeatCount, in: 1...100)
Spacer()
Text(self.model.repeatCount.formatted())
.frame(width: 24.0)
}
}
Section {
Button {
self._addInterval()
@ -76,6 +66,15 @@ struct CountdownFormView : View {
}
}
Section {
HStack {
Stepper("Repeat Count", value: self.$model.repeatCount, in: 1...100)
Spacer()
Text(self.model.repeatCount.formatted())
.frame(width: 24.0)
}
}
} else {
Section(header: Text("Name")) {
@ -95,9 +94,7 @@ struct CountdownFormView : View {
}
SoundFormView(
model: self.model,
imageBinding: self.imageBinding)
SoundFormView(model: self.model)
}
.sheet(item: self.$selectedRange) { item in
RangeFormView(timeRange: item,
@ -122,7 +119,6 @@ struct CountdownFormView_Previews: PreviewProvider {
CountdownFormView(
nameBinding: .constant(""),
durationBinding: .constant(0.0),
imageBinding: .constant(.pic3),
hasRanges: true)
.environmentObject(TimerModel())
}

@ -56,7 +56,6 @@ struct CountdownEditView : View {
@State var duration: TimeInterval = 0.0
// @State var soundRepeatCount: Int16 = 0
@State var image: CoolPic = .pic1
@State var deleteConfirmationShown: Bool = false
@State var activityNameConfirmationShown: Bool = false
@ -106,7 +105,6 @@ struct CountdownEditView : View {
focusedField: _focusedField,
nameBinding: $nameString,
durationBinding: $duration,
imageBinding: $image,
hasRanges: self.hasRanges)
.environmentObject(self.model)
@ -223,7 +221,6 @@ struct CountdownEditView : View {
if let image = countdown.image,
let coolpic = CoolPic(rawValue: image) {
self.image = coolpic
}
}
@ -260,7 +257,6 @@ struct CountdownEditView : View {
cd.order = max
}
cd.image = self.image.rawValue
cd.playableIds = self.model.soundModel.playableIds
cd.setConfirmationSounds(self.model.confirmationSoundModel.sounds)
cd.repeatCount = self.model.repeatCount

@ -11,12 +11,10 @@ struct SoundFormView : View {
var model: TimerModel
var imageBinding: Binding<CoolPic>
// var repeatCountBinding: Binding<Int16>? = nil
var optionalSound: Binding<Bool>? = nil
@State var imageSelectionSheetShown: Bool = false
// @State var imageSelectionSheetShown: Bool = false
var body: some View {
@ -41,10 +39,11 @@ struct SoundFormView : View {
catalog: .confirmation,
title: NSLocalizedString("Start Sound", comment: ""))
}.sheet(isPresented: self.$imageSelectionSheetShown) {
ImageSelectionView(showBinding: self.$imageSelectionSheetShown,
imageBinding: self.imageBinding)
}
// .sheet(isPresented: self.$imageSelectionSheetShown) {
// ImageSelectionView(showBinding: self.$imageSelectionSheetShown,
// imageBinding: self.imageBinding)
// }
}
}
@ -72,8 +71,7 @@ struct SoundImageFormView_Previews: PreviewProvider {
static var previews: some View {
Form {
SoundFormView(model: TimerModel(),
imageBinding: .constant(.pic1))
SoundFormView(model: TimerModel())
}
}
}

@ -45,8 +45,6 @@ struct StopwatchEditView: View {
@State var playSound: Bool = false
@State var image: CoolPic = .pic1
@State var deleteConfirmationShown: Bool = false
@State var activityNameConfirmationShown: Bool = false
@State fileprivate var _rename: Bool? = nil
@ -77,7 +75,6 @@ struct StopwatchEditView: View {
}
}
StopwatchFormView(nameBinding: self.$nameString,
imageBinding: self.$image,
playSoundBinding: self.$playSound).environmentObject(self.model)
.onAppear {
self._onAppear()
@ -149,11 +146,7 @@ struct StopwatchEditView: View {
self.model.soundModel.setPlayables(stopwatch.playables)
self.model.confirmationSoundModel.setPlayables(stopwatch.confirmationPlayables)
if let image = stopwatch.image, let coolpic = CoolPic(rawValue: image) {
self.image = coolpic
}
self._hasLoaded = true
}
@ -185,7 +178,6 @@ struct StopwatchEditView: View {
sw.playableIds = self.model.soundModel.playableIds
sw.confirmationSoundList = self.model.confirmationSoundModel.playableIds
sw.image = self.image.rawValue
if !self.nameString.isEmpty {

@ -16,7 +16,6 @@ struct StopwatchFormView: View {
@FocusState private var focusedField: StopwatchField?
var nameBinding: Binding<String>
var imageBinding: Binding<CoolPic>
var playSoundBinding: Binding<Bool>
@EnvironmentObject var model: TimerModel
@ -34,7 +33,6 @@ struct StopwatchFormView: View {
}
SoundFormView(model: self.model,
imageBinding: imageBinding,
optionalSound: playSoundBinding)
}.toolbar {
@ -57,7 +55,6 @@ struct StopwatchFormView_Previews: PreviewProvider {
static var previews: some View {
StopwatchFormView(
nameBinding: .constant(""),
imageBinding: .constant(.pic1),
playSoundBinding: .constant(true))
.environmentObject(TimerModel())
}

Loading…
Cancel
Save