optimized file structure
This commit is contained in:
@@ -11,24 +11,12 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Fitbot" >
|
||||
<activity
|
||||
android:name=".Completion_Screen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.SportMenuActivity"
|
||||
android:exported="true">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".BicepVideo"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".PowerScreen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true" />
|
||||
<activity
|
||||
android:name=".MainScreen"
|
||||
android:name=".ui.activities.MainActivity"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@@ -1,59 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.Button;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
public class BicepVideo extends AppCompatActivity {
|
||||
|
||||
// private QiContext qiContext;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_bicepvideo);
|
||||
setupButtons();
|
||||
}
|
||||
|
||||
public void Video(QiContext qiContext) {
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo));
|
||||
|
||||
MediaController mediaController = new MediaController(this);
|
||||
videoView.setMediaController(mediaController);
|
||||
videoView.setOnCompletionListener(mp -> videoView.start());
|
||||
videoView.start();
|
||||
|
||||
Animation animation = AnimationBuilder.with(qiContext)
|
||||
.withResources(R.raw.bicepcurl)
|
||||
.build();
|
||||
|
||||
Animate animate = AnimateBuilder.with(qiContext)
|
||||
.withAnimation(animation)
|
||||
.build();
|
||||
|
||||
|
||||
animate.async().run();
|
||||
|
||||
}
|
||||
private void setupButtons() {
|
||||
Button backButton = findViewById(R.id.buttonback);
|
||||
backButton.setOnClickListener(v -> finish());
|
||||
|
||||
Button completeButton = findViewById(R.id.buttoncomplete);
|
||||
completeButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(BicepVideo.this, Completion_Screen.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
public class Completion_Screen extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_completion_screen);
|
||||
}
|
||||
}
|
@@ -1,44 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.QiSDK;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
|
||||
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Register the RobotLifecycleCallbacks to this Activity.
|
||||
|
||||
QiSDK.register(this, this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// Unregister the RobotLifecycleCallbacks for this Activity.
|
||||
QiSDK.unregister(this, this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
// TODO:
|
||||
// Add start screen.
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// Nothing here.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
// The robot focus is refused.
|
||||
}
|
||||
}
|
@@ -1,43 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
public class PowerScreen extends AppCompatActivity {
|
||||
ImageButton openBicepVideo;
|
||||
ImageButton openSquatVideo;
|
||||
ImageButton openTricepVideo;
|
||||
ImageButton goToHome;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_power_screen);
|
||||
|
||||
openBicepVideo = findViewById(R.id.open_BicepVideo);
|
||||
openSquatVideo = findViewById(R.id.open_SquatVideo);
|
||||
openTricepVideo = findViewById(R.id.open_TricepVideo);
|
||||
goToHome = findViewById(R.id.GoToHome);
|
||||
|
||||
openBicepVideo.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, BicepVideo.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
// openSquatVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, SquatVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
//
|
||||
// openTricepVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, TricepVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
|
||||
goToHome.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
public class CompletionActivity {
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.example.fitbot;
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
@@ -9,11 +9,12 @@ import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.util.processing.GesturePath;
|
||||
import com.example.fitbot.util.processing.MotionProcessor;
|
||||
import com.example.fitbot.util.processing.Vector3;
|
||||
|
||||
public class MainScreen extends AppCompatActivity {
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
//Variables
|
||||
DrawerLayout drawerLayout;
|
@@ -1,4 +1,4 @@
|
||||
package com.example.fitbot.ui;
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".BicepVideo">
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
android:layout_width="1142dp"
|
||||
android:layout_height="515dp"
|
||||
android:layout_marginTop="64dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonback"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttoncomplete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="complete"
|
||||
app:layout_constraintBottom_toTopOf="@+id/videoView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.093" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="1074dp"
|
||||
android:layout_height="197dp"
|
||||
android:layout_marginStart="122dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginEnd="122dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Uitleg text"
|
||||
android:textSize="32sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/videoView" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Completion_Screen">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -6,7 +6,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="#232323"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".MainActivity"
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<LinearLayout
|
||||
|
@@ -1,84 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PowerScreen">
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/open_BicepVideo"-->
|
||||
<!-- android:layout_width="215dp"-->
|
||||
<!-- android:layout_height="64dp"-->
|
||||
<!-- android:layout_marginStart="108dp"-->
|
||||
<!-- android:layout_marginTop="341dp"-->
|
||||
<!-- android:layout_marginEnd="108dp"-->
|
||||
<!-- android:layout_marginBottom="342dp"-->
|
||||
<!-- android:text="Bicep Oefening"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="1.0" />-->
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_BicepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintEnd_toStartOf="@+id/open_TricepVideo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/noun_bicep_499185"
|
||||
android:contentDescription="Open bicep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_SquatVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/GoToHome"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_BicepVideo"
|
||||
app:srcCompat="@drawable/squatlogo"
|
||||
android:contentDescription="Open squad exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_TricepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/GoToHome"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_BicepVideo"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/triceplogo"
|
||||
android:contentDescription="Open tricep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/GoToHome"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_TricepVideo"
|
||||
app:srcCompat="@drawable/house_3"
|
||||
android:contentDescription="Go to Home Screen" />
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context=".ui.SportMenuActivity">
|
||||
|
||||
<com.example.fitbot.ui.SportMenuItem
|
||||
android:id="@+id/sportMenuItem1"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
Reference in New Issue
Block a user