Added new XML file for rectangle drawable and renamed activity_completion_screen.xml to activity_end_screen.xml

This commit is contained in:
Niels Gras
2024-05-15 14:54:06 +02:00
parent 490a97ae78
commit c8d90c0992
10 changed files with 10 additions and 326 deletions

View File

@@ -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);
});
}
}

View File

@@ -1,13 +1,13 @@
package com.example.fitbot;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Completion_Screen extends AppCompatActivity {
public class EndScreenActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_completion_screen);
setContentView(R.layout.activity_end_screen);
}
}

View File

@@ -1,55 +0,0 @@
package com.example.fitbot;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
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 {
//Variables
DrawerLayout drawerLayout;
NavigationView navigationView;
Toolbar toolbar;
@SuppressLint("WrongViewCast")
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*---Hooks---*/
drawerLayout = findViewById(R.id.drawer_layout);
navigationView = findViewById(R.id.nav_view);
toolbar = findViewById(R.id.toolbar);
/*---Tool Bar---*/
// setSupportActionBar(toolbar);
/*---Navigation Drawer Menu---*/
navigationView.bringToFront();
ActionBarDrawerToggle toggle=new
ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close);
drawerLayout.addDrawerListener(toggle);
toggle.syncState();
}
@Override
public void onBackPressed(){
if(drawerLayout.isDrawerOpen(GravityCompat.START)){
drawerLayout.closeDrawer(GravityCompat.START);
}
else
{super.onBackPressed();
}
}
}

View File

@@ -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);
});
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>

View File

@@ -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>

View File

@@ -1,8 +1,9 @@
<?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=".Completion_Screen">
tools:context=".EndScreenActivity">
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>