diff --git a/app/src/main/java/de/tadris/fitness/data/WorkoutDao.java b/app/src/main/java/de/tadris/fitness/data/WorkoutDao.java index ba84deb..092c285 100644 --- a/app/src/main/java/de/tadris/fitness/data/WorkoutDao.java +++ b/app/src/main/java/de/tadris/fitness/data/WorkoutDao.java @@ -34,6 +34,9 @@ public interface WorkoutDao { @Query("SELECT * FROM workout ORDER BY start DESC") Workout[] getWorkouts(); + @Query("SELECT * FROM workout_sample") + WorkoutSample[] getSamples(); + @Insert void insertWorkoutAndSamples(Workout workout, WorkoutSample[] samples); @@ -46,7 +49,7 @@ public interface WorkoutDao { @Update void updateWorkout(Workout workout); - @Update + @Insert void insertSample(WorkoutSample sample); diff --git a/app/src/main/java/de/tadris/fitness/data/WorkoutSample.java b/app/src/main/java/de/tadris/fitness/data/WorkoutSample.java index 5736058..79ae50a 100644 --- a/app/src/main/java/de/tadris/fitness/data/WorkoutSample.java +++ b/app/src/main/java/de/tadris/fitness/data/WorkoutSample.java @@ -25,6 +25,7 @@ import androidx.room.ForeignKey; import androidx.room.Ignore; import androidx.room.PrimaryKey; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.github.mikephil.charting.data.Entry; import org.mapsforge.core.model.LatLong; @@ -59,9 +60,11 @@ public class WorkoutSample{ public double speed; + @JsonIgnore @Ignore public Entry tmpEntry; + @JsonIgnore @Ignore public double tmpRoundedSpeed; diff --git a/app/src/main/java/de/tadris/fitness/util/export/Exporter.java b/app/src/main/java/de/tadris/fitness/util/export/Exporter.java index d7c6df8..ab887ac 100644 --- a/app/src/main/java/de/tadris/fitness/util/export/Exporter.java +++ b/app/src/main/java/de/tadris/fitness/util/export/Exporter.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2019 Jannis Scheibe + * + * This file is part of FitoTrack + * + * FitoTrack is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FitoTrack is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package de.tadris.fitness.util.export; import android.annotation.SuppressLint; @@ -45,7 +64,7 @@ public class Exporter { listener.onStatusChanged(20, context.getString(R.string.workouts)); container.workouts.addAll(Arrays.asList(database.workoutDao().getWorkouts())); listener.onStatusChanged(40, context.getString(R.string.locationData)); - container.workouts.addAll(Arrays.asList(database.workoutDao().getWorkouts())); + container.samples.addAll(Arrays.asList(database.workoutDao().getSamples())); listener.onStatusChanged(60, context.getString(R.string.converting)); diff --git a/app/src/main/java/de/tadris/fitness/view/ProgressDialogController.java b/app/src/main/java/de/tadris/fitness/view/ProgressDialogController.java index f418c3f..d54c887 100644 --- a/app/src/main/java/de/tadris/fitness/view/ProgressDialogController.java +++ b/app/src/main/java/de/tadris/fitness/view/ProgressDialogController.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2019 Jannis Scheibe + * + * This file is part of FitoTrack + * + * FitoTrack is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * FitoTrack is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package de.tadris.fitness.view; import android.app.Activity; @@ -27,6 +46,7 @@ public class ProgressDialogController { private void initDialog(){ dialog.setContentView(R.layout.dialog_progress); + dialog.setCancelable(false); infoView= dialog.findViewById(R.id.dialogProgressInfo); progressBar= dialog.findViewById(R.id.dialogProgressBar); }