Merge remote-tracking branch 'origin/main'
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1 +1,8 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
/.idea/.gitignore
|
||||||
|
/.idea/dictionaries/lucawarm.xml
|
||||||
|
/.idea/material_theme_project_new.xml
|
||||||
|
/docs/documentation/assets/math-expression-location-calculation.png
|
||||||
|
/.idea/modules.xml
|
||||||
|
/.idea/muupooviixee66.iml
|
||||||
|
/.idea/vcs.xml
|
||||||
|
2
code/src/Fitbot/.gitignore
vendored
2
code/src/Fitbot/.gitignore
vendored
@@ -13,3 +13,5 @@
|
|||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
|
.idea
|
||||||
|
.vscode
|
@@ -15,12 +15,14 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Fitbot" >
|
android:theme="@style/Theme.Fitbot" >
|
||||||
<!--android:name=".ui.activities.MainActivity"-->
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".EndScreenActivity"
|
android:name=".EndScreenActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.activities.FitnessActivity"
|
android:name=".ui.activities.FitnessActivity"
|
||||||
|
android:exported="true" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.activities.MainActivity"
|
||||||
android:exported="true" >
|
android:exported="true" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.example.fitbot.ui.activities;
|
package com.example.fitbot.ui.activities;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
@@ -8,6 +9,8 @@ import android.support.v4.widget.DrawerLayout;
|
|||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
import com.example.fitbot.R;
|
import com.example.fitbot.R;
|
||||||
|
|
||||||
@@ -17,17 +20,26 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
DrawerLayout drawerLayout;
|
DrawerLayout drawerLayout;
|
||||||
NavigationView navigationView;
|
NavigationView navigationView;
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
Button startButton;
|
||||||
|
|
||||||
@SuppressLint("WrongViewCast")
|
@SuppressLint("WrongViewCast")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate (Bundle savedInstanceState) {
|
protected void onCreate (Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main );
|
||||||
|
|
||||||
/*---Hooks---*/
|
/*---Hooks---*/
|
||||||
drawerLayout = findViewById(R.id.drawer_layout);
|
drawerLayout = findViewById(R.id.drawer_layout);
|
||||||
navigationView = findViewById(R.id.nav_view);
|
navigationView = findViewById(R.id.nav_view);
|
||||||
toolbar = findViewById(R.id.toolbar);
|
toolbar = findViewById(R.id.toolbar);
|
||||||
|
startButton = findViewById(R.id.startButton);
|
||||||
|
|
||||||
|
startButton.setOnClickListener(v -> {
|
||||||
|
// Switch to fitness activity
|
||||||
|
Log.i("MainActivity", "Switching to FitnessActivity");
|
||||||
|
Intent intent = new Intent(MainActivity.this, FitnessActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
|
||||||
/*---Tool Bar---*/
|
/*---Tool Bar---*/
|
||||||
// setSupportActionBar(toolbar);
|
// setSupportActionBar(toolbar);
|
||||||
|
@@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Path;
|
import android.graphics.Path;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.example.fitbot.util.path.GesturePath;
|
import com.example.fitbot.util.path.GesturePath;
|
||||||
@@ -24,6 +25,8 @@ public class PersonalMotionPreviewElement extends View {
|
|||||||
private Path referencePath, performingPath;
|
private Path referencePath, performingPath;
|
||||||
private Paint referencePaint, performingPaint;
|
private Paint referencePaint, performingPaint;
|
||||||
|
|
||||||
|
private Paint backgroundColor = new Paint();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for the preview path projection.
|
* Constants for the preview path projection.
|
||||||
*/
|
*/
|
||||||
@@ -42,6 +45,9 @@ public class PersonalMotionPreviewElement extends View {
|
|||||||
*/
|
*/
|
||||||
public PersonalMotionPreviewElement(Context context, GesturePath path) {
|
public PersonalMotionPreviewElement(Context context, GesturePath path) {
|
||||||
super(context);
|
super(context);
|
||||||
|
Log.i("PersonalMotionPreviewElement", "Creating new PersonalMotionPreviewElement.");
|
||||||
|
this.backgroundColor = new Paint();
|
||||||
|
this.backgroundColor.setColor(0xFF000000); // Black
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.motionProcessor = new MotionProcessor();
|
this.motionProcessor = new MotionProcessor();
|
||||||
this.motionProcessor.startListening();
|
this.motionProcessor.startListening();
|
||||||
@@ -158,6 +164,7 @@ public class PersonalMotionPreviewElement extends View {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDraw(Canvas canvas) {
|
public void onDraw(Canvas canvas) {
|
||||||
|
canvas.drawRect(0, 0, getWidth(), getHeight(), backgroundColor);
|
||||||
// Draw the sport preview canvas
|
// Draw the sport preview canvas
|
||||||
canvas.drawPath(referencePath, referencePaint);
|
canvas.drawPath(referencePath, referencePaint);
|
||||||
canvas.drawPath(performingPath, performingPaint);
|
canvas.drawPath(performingPath, performingPaint);
|
||||||
|
@@ -1,10 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/drawer_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#232323"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context=".ui.activities.FitnessActivity"
|
||||||
|
tools:openDrawer="start">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.example.fitbot.ui.components.PersonalMotionPreviewElement
|
<com.example.fitbot.ui.components.PersonalMotionPreviewElement
|
||||||
|
android:id="@+id/personalMotionPreviewElement"
|
||||||
|
android:visibility="visible"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
@@ -1,9 +1,12 @@
|
|||||||
package com.example.fitbot;
|
package com.example.fitbot;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import com.example.fitbot.util.path.GesturePath;
|
import com.example.fitbot.util.path.GesturePath;
|
||||||
import com.example.fitbot.util.path.PathSegment;
|
import com.example.fitbot.util.path.PathSegment;
|
||||||
|
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class PathSegmentTest {
|
public class PathSegmentTest {
|
||||||
|
|
||||||
@@ -23,7 +26,6 @@ public class PathSegmentTest {
|
|||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("Test Path Segment Interpolation")
|
|
||||||
public void test_pathSegmentInterpolation() {
|
public void test_pathSegmentInterpolation() {
|
||||||
Vector3f start = new Vector3f(0, 0, 0);
|
Vector3f start = new Vector3f(0, 0, 0);
|
||||||
Vector3f end = new Vector3f(1, 1, 1);
|
Vector3f end = new Vector3f(1, 1, 1);
|
||||||
|
Reference in New Issue
Block a user