Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
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;
|
||||
import com.example.fitbot.ui.activities.EndScreenActivity;
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.sports.Animations;
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.exercise.Exercise;
|
||||
import com.example.fitbot.exercise.EMuscleGroup;
|
||||
import com.example.fitbot.ui.components.PersonalMotionPreviewElement;
|
||||
import com.example.fitbot.util.path.GesturePath;
|
||||
|
||||
@@ -23,13 +19,29 @@ import org.joml.Vector3f;
|
||||
|
||||
public class FitnessActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
PersonalMotionPreviewElement personalMotionPreviewElement;
|
||||
// PersonalMotionPreviewElement personalMotionPreviewElement;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Set the content view to the appropriate layout
|
||||
setContentView(R.layout.activity_fitness);
|
||||
|
||||
// Find the VideoView by its ID
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
|
||||
if (videoView != null) {
|
||||
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo);
|
||||
videoView.setVideoURI(videoUri);
|
||||
videoView.start();
|
||||
} else {
|
||||
Log.e("FitnessActivity", "VideoView is null. Check your layout XML.");
|
||||
}
|
||||
|
||||
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class);
|
||||
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.buttonComplete, EndScreenActivity.class);
|
||||
|
||||
GesturePath.Builder gesturePathBuilder = new GesturePath.Builder();
|
||||
|
||||
gesturePathBuilder.addVector(new Vector3f(-.5f, -.5f, -.5f));
|
||||
@@ -44,22 +56,21 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
gesturePathBuilder.addVector(new Vector3f(-.5f, .5f, .5f));
|
||||
gesturePathBuilder.addVector(new Vector3f(-.5f, .5f, -.5f));
|
||||
|
||||
|
||||
personalMotionPreviewElement = findViewById(R.id.personalMotionPreviewElement);
|
||||
personalMotionPreviewElement.post(() -> {
|
||||
Log.i("FitnessActivity", "PersonalMotionPreviewElement.post()");
|
||||
|
||||
Exercise exercise = new Exercise(EMuscleGroup.ARMS, "Bicep Curls", "Oefening voor de biceps.", gesturePathBuilder.build(), 1);
|
||||
|
||||
personalMotionPreviewElement.initialize(exercise);
|
||||
});
|
||||
// Uncomment and fix if needed for personalMotionPreviewElement
|
||||
// personalMotionPreviewElement = findViewById(R.id.personalMotionPreviewElement);
|
||||
// personalMotionPreviewElement.post(() -> {
|
||||
// Log.i("FitnessActivity", "PersonalMotionPreviewElement.post()");
|
||||
//
|
||||
// Exercise exercise = new Exercise(EMuscleGroup.ARMS, "Bicep Curls", "Oefening voor de biceps.", gesturePathBuilder.build(), 1);
|
||||
//
|
||||
// personalMotionPreviewElement.initialize(exercise);
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
// Implement your logic when the robot focus is gained
|
||||
Animations.Animate("bicepcurl", qiContext);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +86,6 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
QiSDK.unregister(this, this);
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +1,73 @@
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<?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:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#232323"
|
||||
android:background="@color/red"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ui.activities.FitnessActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<com.example.fitbot.ui.components.PersonalMotionPreviewElement
|
||||
android:id="@+id/personalMotionPreviewElement"
|
||||
android:layout_width="356dp"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible" />
|
||||
<!-- <com.example.fitbot.ui.components.PersonalMotionPreviewElement-->
|
||||
<!-- android:id="@+id/personalMotionPreviewElement"-->
|
||||
<!-- android:layout_width="600dp"-->
|
||||
<!-- android:layout_height="550dp"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintHorizontal_bias="0.976"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="0.064" />-->
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
android:layout_width="600dp"
|
||||
android:layout_height="550dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.023"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.064" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/homeButton"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="120dp"
|
||||
android:text="HOME"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.014"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.976" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/skipButton"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="120dp"
|
||||
android:text="SKIP"
|
||||
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.976" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonComplete"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="120dp"
|
||||
android:text="Complete"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.985"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.976" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -9,66 +9,76 @@
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<LinearLayout
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar" />
|
||||
layout="@layout/toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="524dp"
|
||||
android:layout_height="77dp"
|
||||
android:layout_marginStart="378dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="300dp"
|
||||
android:text="@string/welkom_bij_fitbot"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="64sp" />
|
||||
android:textSize="64sp"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="510dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginStart="385dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="300dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:text="@string/robot_helpt"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="32sp" />
|
||||
android:textSize="32sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/startButton"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="490dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="400dp"
|
||||
android:layout_marginTop="350dp"
|
||||
android:background="@drawable/red_button_gradient"
|
||||
android:text="@string/start"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="80sp"
|
||||
android:textAllCaps="false"
|
||||
android:background="@drawable/red_button_gradient"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/helpButton"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="560dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="450dp"
|
||||
android:layout_marginTop="500dp"
|
||||
android:background="@drawable/darkred_button_gradient"
|
||||
android:text="@string/help"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="40sp"
|
||||
android:textAllCaps="false"
|
||||
android:background="@drawable/darkred_button_gradient"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="375dp"
|
||||
android:layout_height="375dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="-180dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="260dp"
|
||||
android:contentDescription="@string/todo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/robot_logo_inverted" />
|
||||
|
||||
<!-- <Button-->
|
||||
@@ -81,7 +91,7 @@
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- android:focusable="true" />-->
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user