diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 969aebe..222390b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ { workoutArgument.exerciseTime = exerciseTime; workoutArgument.restTime = restTime; workoutArgument.halfTime = halfTime; - workoutArgument.halfwayMark = halfwayMark == false ? 0 : 1; + + if (exerciseTime > 6) { + workoutArgument.halfwayMark = halfwayMark == false ? 0 : 1; + } else { + workoutArgument.halfwayMark = false; + } if (workoutArgument.id == "") { // Set the workout ID @@ -150,18 +155,22 @@ class _SetTimingsState extends State { ), ), ), - Center( - child: CheckboxListTile( - title: Text("Play sound at half time:"), - value: halfwayMark, - onChanged: (newValue) { - setState(() { - halfwayMark = newValue!; - }); - }, - // controlAffinity: - // ListTileControlAffinity.leading, // <-- leading Checkbox - )), + Visibility( + visible: exerciseTime > 6 ? true : false, + child: Center( + child: CheckboxListTile( + title: const Text("Play sound at half time:"), + value: halfwayMark, + onChanged: (newValue) { + setState(() { + halfwayMark = newValue!; + }); + }, + // controlAffinity: + // ListTileControlAffinity.leading, // <-- leading Checkbox + )), + ), + // Center( // child: Padding( // padding: const EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 0.0), diff --git a/lib/start_workout/workout.dart b/lib/start_workout/workout.dart index cd0396a..b10ec2e 100644 --- a/lib/start_workout/workout.dart +++ b/lib/start_workout/workout.dart @@ -217,7 +217,10 @@ class CountDownTimerState extends State ), interval: const Duration(milliseconds: 100), endSound: endSound, - halfwayMark: workoutArgument.halfwayMark == 0 ? false : true, + halfwayMark: (workoutArgument.halfwayMark == 1 && + currentInterval == "workout") + ? true + : false, onFinished: () async { if (currentInterval == "start") { startOnFinished();