From e4f2c6accab79f97a76d016985c3aed7fcce06f8 Mon Sep 17 00:00:00 2001 From: Jannis Scheibe Date: Sun, 18 Aug 2019 16:26:52 +0000 Subject: [PATCH 1/8] Roadmap.md created online with Bitbucket --- Roadmap.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Roadmap.md diff --git a/Roadmap.md b/Roadmap.md new file mode 100644 index 0000000..c1db673 --- /dev/null +++ b/Roadmap.md @@ -0,0 +1,20 @@ +# Roadmap + +## First release + +- set title in ActionBar according to activity +- choose workout type +- user defined workout titles, description +- rating of workout +- change units +- change weight of user +- export to gpx file + +## Planned features + +- measurement of height using pressure data +- height data in diagram +- measurement of steps using sensor data +- upload workouts to dropbox +- offline maps? + From 7a6bd5737100a6b35af858ffefe8f9976b10027c Mon Sep 17 00:00:00 2001 From: Jannis Scheibe Date: Sun, 18 Aug 2019 16:51:05 +0000 Subject: [PATCH 2/8] README.md edited online with Bitbucket --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 3f652c8..3f9f912 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ +# FitoTrack + +FitoTrack is a mobile app for logging and viewing your workouts. Whether you're running, cycling or hiking FitoTrack will show you give you the most important information with detailed charts and statistics. +It is open-source and completely ad-free. + +(download links) + +## Screenshots + +... + +## Implemented Features + +- **Track workouts.** Choose your sports type and just start running/cycling/hiking/etc. You can see general information right below the map on the track screen. +- **View your workouts.** View general information like date, time, duration, distance, speed, pace. See your route on a map. Investigate how you performed in the speed diagram. +- **Open-Source.** There is no advertivesment, no tracking and the source code is open and licensed under the GPLv3 . + +see (Roadmap)[https://bitbucket.org/jannis3/fitotrack/src/master/Roadmap.md] for more planned features + + +## Installing + +... + +## License + Copyright (C) 2019 Jannis Scheibe FitoTrack is free software: you can redistribute it and/or modify From 1d703ddae13785eb2997de8ccd9e803b3537621a Mon Sep 17 00:00:00 2001 From: Jannis Scheibe Date: Sun, 18 Aug 2019 16:51:59 +0000 Subject: [PATCH 3/8] README.md edited online with Bitbucket --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f9f912..09945a1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It is open-source and completely ad-free. - **View your workouts.** View general information like date, time, duration, distance, speed, pace. See your route on a map. Investigate how you performed in the speed diagram. - **Open-Source.** There is no advertivesment, no tracking and the source code is open and licensed under the GPLv3 . -see (Roadmap)[https://bitbucket.org/jannis3/fitotrack/src/master/Roadmap.md] for more planned features +see [Roadmap](https://bitbucket.org/jannis3/fitotrack/src/master/Roadmap.md) for more planned features ## Installing From 3bd733113fb1c35f8ffaa92cb638a0c8a6013465 Mon Sep 17 00:00:00 2001 From: Jannis Scheibe Date: Sun, 18 Aug 2019 17:57:43 +0000 Subject: [PATCH 4/8] Roadmap.md edited online with Bitbucket --- Roadmap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap.md b/Roadmap.md index c1db673..ff34390 100644 --- a/Roadmap.md +++ b/Roadmap.md @@ -2,6 +2,7 @@ ## First release +- design of ListWorkoutActivty - set title in ActionBar according to activity - choose workout type - user defined workout titles, description From 34a6dd36479626c22d0b6bd061f20d7cfda2e5d4 Mon Sep 17 00:00:00 2001 From: jannis Date: Sun, 18 Aug 2019 20:03:40 +0200 Subject: [PATCH 5/8] Update Copyright notices --- NOTICE.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/NOTICE.md b/NOTICE.md index b272c77..20dfe00 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -16,6 +16,21 @@ See the License for the specific language governing permissions and limitations under the License. + + + Mapsforge library is under LGPL v3 license, with an important simplification: the constraints mentioned in sections LGPL v3 §4(d) and §4(e) are waived. + + The Mapsforge project was jointly founded by Thilo Mühlberg and Jürgen Broß. Both remain owners of the project but have retired as active developers. + Current owners and lead developers are: Ludwig Brinckmann, devemux86 + + + Copyright 2019 Philipp Jahoda + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. From ac9af3a03b9474a734b9a7e6050f57a441fbee4d Mon Sep 17 00:00:00 2001 From: jannis Date: Sun, 18 Aug 2019 20:13:29 +0200 Subject: [PATCH 6/8] set title in ActionBar according to activity --- .../fitness/activity/FitoTrackActivity.java | 2 +- .../fitness/activity/RecordWorkoutActivity.java | 5 ++++- .../fitness/activity/ShowWorkoutActivity.java | 2 ++ .../fitness/util/WorkoutTypeCalculator.java | 16 ++++++++-------- app/src/main/res/values/strings.xml | 9 +++++++++ 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/de/tadris/fitness/activity/FitoTrackActivity.java b/app/src/main/java/de/tadris/fitness/activity/FitoTrackActivity.java index 74d22bc..a781812 100644 --- a/app/src/main/java/de/tadris/fitness/activity/FitoTrackActivity.java +++ b/app/src/main/java/de/tadris/fitness/activity/FitoTrackActivity.java @@ -22,7 +22,7 @@ package de.tadris.fitness.activity; import android.app.Activity; import android.util.TypedValue; -public class FitoTrackActivity extends Activity { +abstract public class FitoTrackActivity extends Activity { diff --git a/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java b/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java index 84a160c..d385a86 100644 --- a/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java +++ b/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java @@ -51,6 +51,7 @@ import de.tadris.fitness.location.WorkoutRecorder; import de.tadris.fitness.map.MapManager; import de.tadris.fitness.util.ThemeManager; import de.tadris.fitness.util.UnitUtils; +import de.tadris.fitness.util.WorkoutTypeCalculator; public class RecordWorkoutActivity extends FitoTrackActivity implements LocationListener.LocationChangeListener { @@ -73,6 +74,8 @@ public class RecordWorkoutActivity extends FitoTrackActivity implements Location setTheme(ThemeManager.getThemeByWorkoutType(ACTIVITY)); setContentView(R.layout.activity_record_workout); + setTitle(R.string.recordWorkout); + setupMap(); ((ViewGroup)findViewById(R.id.recordMapViewrRoot)).addView(mapView); @@ -124,7 +127,7 @@ public class RecordWorkoutActivity extends FitoTrackActivity implements Location while (recorder.isActive()){ Thread.sleep(1000); if(isResumed){ - mHandler.post(() -> updateDescription()); + mHandler.post(this::updateDescription); } } }catch (InterruptedException e){ diff --git a/app/src/main/java/de/tadris/fitness/activity/ShowWorkoutActivity.java b/app/src/main/java/de/tadris/fitness/activity/ShowWorkoutActivity.java index c89a494..2721da2 100644 --- a/app/src/main/java/de/tadris/fitness/activity/ShowWorkoutActivity.java +++ b/app/src/main/java/de/tadris/fitness/activity/ShowWorkoutActivity.java @@ -64,6 +64,7 @@ import de.tadris.fitness.map.MapManager; import de.tadris.fitness.map.WorkoutLayer; import de.tadris.fitness.util.ThemeManager; import de.tadris.fitness.util.UnitUtils; +import de.tadris.fitness.util.WorkoutTypeCalculator; public class ShowWorkoutActivity extends FitoTrackActivity { static Workout selectedWorkout; @@ -86,6 +87,7 @@ public class ShowWorkoutActivity extends FitoTrackActivity { setContentView(R.layout.activity_show_workout); getActionBar().setDisplayHomeAsUpEnabled(true); + setTitle(WorkoutTypeCalculator.getType(workout)); theme= getTheme(); diff --git a/app/src/main/java/de/tadris/fitness/util/WorkoutTypeCalculator.java b/app/src/main/java/de/tadris/fitness/util/WorkoutTypeCalculator.java index 5382925..2cf7ab7 100644 --- a/app/src/main/java/de/tadris/fitness/util/WorkoutTypeCalculator.java +++ b/app/src/main/java/de/tadris/fitness/util/WorkoutTypeCalculator.java @@ -19,28 +19,28 @@ package de.tadris.fitness.util; +import de.tadris.fitness.R; import de.tadris.fitness.data.Workout; public class WorkoutTypeCalculator { - public static String getType(Workout workout){ - // TODO: use localisation + public static int getType(Workout workout){ if(workout.workoutType.equals(Workout.WORKOUT_TYPE_RUNNING)){ if(workout.avgSpeed < 7){ - return "Walking"; + return R.string.workoutTypeWalking; }else if(workout.avgSpeed < 9.6){ - return "Jogging"; + return R.string.workoutTypeJogging; }else{ - return "Running"; + return R.string.workoutTypeRunning; } } if(workout.workoutType.equals(Workout.WORKOUT_TYPE_CYCLING)){ - return "Cycling"; + return R.string.workoutTypeCycling; } if(workout.workoutType.equals(Workout.WORKOUT_TYPE_HIKING)){ - return "Hiking"; + return R.string.workoutTypeHiking; } - return "Unknown"; + return R.string.workoutTypeUnknown; } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ad9eef..dd0b5a5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -39,6 +39,15 @@ Total Energy Energy Consumption + Running + Walking + Jogging + Cycling + Hiking + Unknown + + Record Workout + Delete Workout Do you really want to delete the workout? From ac223e762a93317721c1ef9e6299b043b52bc88a Mon Sep 17 00:00:00 2001 From: jannis Date: Sun, 18 Aug 2019 20:54:30 +0200 Subject: [PATCH 7/8] choose workout type --- NOTICE.md | 15 ++++ app/build.gradle | 1 + .../activity/ListWorkoutsActivity.java | 21 ++++-- .../de/tadris/fitness/util/ThemeManager.java | 1 + .../main/res/drawable-anydpi/ic_add_white.xml | 10 +++ .../main/res/drawable-hdpi/ic_add_white.png | Bin 0 -> 144 bytes .../main/res/drawable-mdpi/ic_add_white.png | Bin 0 -> 97 bytes .../main/res/drawable-xhdpi/ic_add_white.png | Bin 0 -> 120 bytes .../main/res/drawable-xxhdpi/ic_add_white.png | Bin 0 -> 156 bytes .../res/layout/activity_list_workouts.xml | 64 ++++++++++++++++-- app/src/main/res/menu/list_workout_menu.xml | 8 +-- app/src/main/res/values/colors.xml | 5 ++ app/src/main/res/values/styles.xml | 10 ++- 13 files changed, 117 insertions(+), 18 deletions(-) create mode 100644 app/src/main/res/drawable-anydpi/ic_add_white.xml create mode 100644 app/src/main/res/drawable-hdpi/ic_add_white.png create mode 100644 app/src/main/res/drawable-mdpi/ic_add_white.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_add_white.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_add_white.png diff --git a/NOTICE.md b/NOTICE.md index 20dfe00..2d26e07 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -32,6 +32,21 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + Copyright 2015 Dmytro Tarianyk + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + Copyright 2016-2019 Franz Wilhelmstötter diff --git a/app/build.gradle b/app/build.gradle index b6f37d6..3801110 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,6 +65,7 @@ dependencies { implementation 'com.caverock:androidsvg:1.3' implementation 'net.sf.kxml:kxml2:2.3.0' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' + implementation 'com.github.clans:fab:1.6.4' annotationProcessor "androidx.room:room-compiler:$room_version" implementation 'androidx.recyclerview:recyclerview:1.0.0' testImplementation 'junit:junit:4.12' diff --git a/app/src/main/java/de/tadris/fitness/activity/ListWorkoutsActivity.java b/app/src/main/java/de/tadris/fitness/activity/ListWorkoutsActivity.java index dd39942..cde5791 100644 --- a/app/src/main/java/de/tadris/fitness/activity/ListWorkoutsActivity.java +++ b/app/src/main/java/de/tadris/fitness/activity/ListWorkoutsActivity.java @@ -24,10 +24,14 @@ import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; +import android.view.View; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.github.clans.fab.FloatingActionButton; +import com.github.clans.fab.FloatingActionMenu; + import de.tadris.fitness.Instance; import de.tadris.fitness.R; import de.tadris.fitness.WorkoutAdapter; @@ -38,6 +42,7 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor private RecyclerView listView; private RecyclerView.Adapter adapter; private RecyclerView.LayoutManager layoutManager; + private FloatingActionMenu menu; Workout[] workouts; @@ -52,6 +57,17 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor layoutManager= new LinearLayoutManager(this); listView.setLayoutManager(layoutManager); + menu= findViewById(R.id.workoutListMenu); + + findViewById(R.id.workoutListRecordRunning).setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_RUNNING)); + findViewById(R.id.workoutListRecordHiking) .setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_HIKING)); + findViewById(R.id.workoutListRecordCycling).setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_CYCLING)); + + } + + public void startRecording(String activity){ + RecordWorkoutActivity.ACTIVITY= activity; + startActivity(new Intent(this, RecordWorkoutActivity.class)); } @Override @@ -79,10 +95,7 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); - if(id == R.id.action_workout_add){ - startActivity(new Intent(this, RecordWorkoutActivity.class)); - return true; - } + return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/de/tadris/fitness/util/ThemeManager.java b/app/src/main/java/de/tadris/fitness/util/ThemeManager.java index 82e8188..19f00bf 100644 --- a/app/src/main/java/de/tadris/fitness/util/ThemeManager.java +++ b/app/src/main/java/de/tadris/fitness/util/ThemeManager.java @@ -28,6 +28,7 @@ public class ThemeManager { switch (type){ case Workout.WORKOUT_TYPE_RUNNING: return R.style.Running; case Workout.WORKOUT_TYPE_CYCLING: return R.style.Bicycling; + case Workout.WORKOUT_TYPE_HIKING: return R.style.Hiking; default: return R.style.AppTheme; } } diff --git a/app/src/main/res/drawable-anydpi/ic_add_white.xml b/app/src/main/res/drawable-anydpi/ic_add_white.xml new file mode 100644 index 0000000..89208a9 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_add_white.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable-hdpi/ic_add_white.png b/app/src/main/res/drawable-hdpi/ic_add_white.png new file mode 100644 index 0000000000000000000000000000000000000000..d702a21d2cdbcdf13a6cdda9318fe432317a00ac GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbB!aZFaLn>~)z2?ZpARyon=stV) z*^4r{0aJPxt&sd1zj8(! literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/activity_list_workouts.xml b/app/src/main/res/layout/activity_list_workouts.xml index ce1cc41..40bed42 100644 --- a/app/src/main/res/layout/activity_list_workouts.xml +++ b/app/src/main/res/layout/activity_list_workouts.xml @@ -18,15 +18,67 @@ ~ along with this program. If not, see . --> - - - - \ No newline at end of file + android:layout_height="match_parent"> + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/list_workout_menu.xml b/app/src/main/res/menu/list_workout_menu.xml index 39c66ac..da3e740 100644 --- a/app/src/main/res/menu/list_workout_menu.xml +++ b/app/src/main/res/menu/list_workout_menu.xml @@ -18,10 +18,4 @@ ~ along with this program. If not, see . --> - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 2df259c..391beba 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -29,6 +29,11 @@ #462A1D #4CAF50 + #2E7D32 + + #009688 + #007267 + #C8000000 #C8414141 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index a56d984..1e81eef 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -29,7 +29,8 @@ + + + From 3d69d03d8919c763fbfed0a2ea2fde2d536004a3 Mon Sep 17 00:00:00 2001 From: Jannis Scheibe Date: Sun, 18 Aug 2019 19:05:05 +0000 Subject: [PATCH 8/8] Roadmap.md edited online with Bitbucket --- Roadmap.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Roadmap.md b/Roadmap.md index ff34390..b25d1f3 100644 --- a/Roadmap.md +++ b/Roadmap.md @@ -1,21 +1,19 @@ # Roadmap -## First release - -- design of ListWorkoutActivty -- set title in ActionBar according to activity -- choose workout type -- user defined workout titles, description -- rating of workout -- change units -- change weight of user -- export to gpx file - -## Planned features +## Coming features - measurement of height using pressure data - height data in diagram - measurement of steps using sensor data -- upload workouts to dropbox -- offline maps? +## Planned features + +- upload workouts as GPX to dropbox +- upload workouts as GPS trace to OpenStreetMap + +## Considered features + +- voice feedback e.g. speaking every 5/10 minutes the general data +- running "against" other workouts +- offline maps +- something like a comparision to your friends (would be really cool from my pov) \ No newline at end of file