diff --git a/NOTICE.md b/NOTICE.md index b272c77..2d26e07 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -16,6 +16,36 @@ 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. + + + 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. diff --git a/README.md b/README.md index 3f652c8..09945a1 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 diff --git a/Roadmap.md b/Roadmap.md new file mode 100644 index 0000000..b25d1f3 --- /dev/null +++ b/Roadmap.md @@ -0,0 +1,19 @@ +# Roadmap + +## Coming features + +- measurement of height using pressure data +- height data in diagram +- measurement of steps using sensor data + +## 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 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/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/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/activity/RecordWorkoutActivity.java b/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java index 09e3728..3d56221 100644 --- a/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java +++ b/app/src/main/java/de/tadris/fitness/activity/RecordWorkoutActivity.java @@ -53,6 +53,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 { @@ -76,6 +77,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); @@ -132,7 +135,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/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/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/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 0000000..d702a21 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_add_white.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_add_white.png b/app/src/main/res/drawable-mdpi/ic_add_white.png new file mode 100644 index 0000000..b2d14f3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_add_white.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_add_white.png b/app/src/main/res/drawable-xhdpi/ic_add_white.png new file mode 100644 index 0000000..bcd24f2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_add_white.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_add_white.png b/app/src/main/res/drawable-xxhdpi/ic_add_white.png new file mode 100644 index 0000000..9478911 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_add_white.png differ 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/strings.xml b/app/src/main/res/values/strings.xml index 2734a6f..596eda0 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? 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 @@ + + +