updated UI

This commit is contained in:
SebasKoedam
2024-06-04 15:16:21 +02:00
parent 79a96bc193
commit 62c97c3475
10 changed files with 120 additions and 143 deletions

View File

@@ -22,6 +22,7 @@
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.25" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/big_red_button_gradient.xml" value="0.2555" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/border_background.xml" value="0.2475" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/border_background_2.xml" value="0.2475" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/border_background_3.xml" value="0.2475" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/box_background.xml" value="0.2555" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/drawable/darkred_button_gradient.xml" value="0.346" />

View File

@@ -13,6 +13,8 @@ public class EndScreenActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_end_screen);
NavigationManager.hideSystemUI(this);
NavigationManager.setupButtonNavigation(this, R.id.homeButtonEndScreen, MainActivity.class);
NavigationManager.setupButtonNavigation(this, R.id.startButtonEndScreen, FitnessActivity.class);
}

View File

@@ -56,7 +56,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
private static final float SENSOR_SAMPLE_RATE = 10.0f;
private static final int EXERCISE_COUNT = 5;
private static int EXERCISE_REP = 10;
private static int EXERCISE_REP = 1;
private static final float EXERCISE_SPEED_MULTIPLIER = 1.0f;
@Override
@@ -145,16 +145,15 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
VideoView videoView = findViewById(R.id.videoView);
playVideo(videoView, this);
// Set a listener to repeat the video
while (EXERCISE_REP > 1) {
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
if (EXERCISE_REP < EXERCISE_COUNT) {
videoView.start(); // start the video again
EXERCISE_REP++;
}
});
EXERCISE_REP--;
}
}
});
});
}
})).start();

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/lightBlue" />
<stroke android:width="2dp" android:color="#FF0000" />
<stroke android:width="2dp" android:color="#FFFFFF" />
<corners android:radius="20dp" />
</shape>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/midBlue" />
<stroke android:width="2dp" android:color="#FF0000" />
<stroke android:width="2dp" android:color="#FFFFFF" />
<corners android:radius="10dp" />
</shape>

View File

@@ -12,7 +12,7 @@
android:layout_height="450dp"
android:layout_marginStart="80dp"
android:layout_marginTop="24dp"
android:background="@drawable/border_background_2"
android:background="@drawable/border_background"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"
@@ -24,7 +24,7 @@
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="40dp"
android:background="@drawable/border_background"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:paddingVertical="15dp"
android:paddingHorizontal="20dp"
@@ -40,11 +40,11 @@
</LinearLayout>
<LinearLayout
android:layout_width="700dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/border_background"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"
@@ -60,11 +60,11 @@
</LinearLayout>
<LinearLayout
android:layout_width="700dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/border_background"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -11,140 +11,124 @@
tools:openDrawer="start">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="450dp"
android:layout_height="450dp"
android:layout_gravity="center"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/border_background_2"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.505"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="410dp"
android:layout_height="410dp"
android:layout_marginVertical="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="15dp"
android:background="@drawable/border_background"
android:layout_gravity="center">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
app:cardCornerRadius="20dp">
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<Button
android:id="@+id/infoButtonFitness"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/red_button_gradient"
android:drawableTop="@drawable/ic_baseline_info_40"
android:drawableTint="@color/white"
android:padding="2.5dp"
android:layout_margin="10dp"
android:padding="5dp"
tools:ignore="SpeakableTextPresentCheck" />
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerInParent="true"
android:layout_marginStart="50dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="50dp"
card_view:cardCornerRadius="30dp">
</android.support.v7.widget.CardView>
<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="450dp"
android:layout_height="450dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/border_background"
android:orientation="vertical"
android:padding="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
</RelativeLayout>
<TextView
android:id="@+id/textViewFitnessTitle"
style="@style/TextStyleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/title"
android:textAlignment="center" />
<LinearLayout
android:layout_width="410dp"
android:layout_height="410dp"
android:layout_gravity="center"
android:layout_marginVertical="20dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="30dp"
android:padding="10dp"
android:background="@drawable/border_background"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:background="@drawable/border_background_3"
android:padding="5dp">
<TextView
android:id="@+id/textViewFitnessTitle"
style="@style/TextStyleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title"
android:textAlignment="center"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/border_background_3"
android:padding="5dp"
android:layout_margin="5dp"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textViewFitnessShortDescription"
style="@style/TextStyleDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/border_background_3"
android:padding="5dp"
android:layout_margin="5dp"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textViewFitnessBar"
style="@style/TextStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/border_background_3"
android:padding="5dp"
android:layout_margin="5dp"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/textViewFitnessScore"
style="@style/TextStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
android:id="@+id/textViewFitnessShortDescription"
style="@style/TextStyleDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:background="@drawable/border_background_3"
android:padding="5dp">
<TextView
android:id="@+id/textViewFitnessReps"
style="@style/TextStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:background="@drawable/border_background_3"
android:padding="5dp">
<TextView
android:id="@+id/textViewFitnessScore"
style="@style/TextStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/context"
android:textAlignment="center" />
</LinearLayout>
<com.example.fitbot.ui.components.ExerciseStatusElement
android:id="@+id/personalMotionPreviewElement"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<Button
android:id="@+id/homeButtonFitness"
android:layout_width="150dp"
android:layout_height="75dp"
android:layout_marginStart="200dp"
android:layout_marginStart="175dp"
android:layout_marginBottom="30dp"
android:background="@drawable/red_button_gradient"
android:drawableTop="@drawable/ic_baseline_home_48"
@@ -158,7 +142,7 @@
android:id="@+id/skipButtonFitness"
android:layout_width="150dp"
android:layout_height="75dp"
android:layout_marginEnd="200dp"
android:layout_marginEnd="175dp"
android:layout_marginBottom="30dp"
android:background="@drawable/red_button_gradient"
android:drawableTop="@drawable/ic_baseline_skip_next_48"
@@ -168,13 +152,4 @@
app:layout_constraintEnd_toEndOf="parent"
tools:ignore="SpeakableTextPresentCheck" />
<com.example.fitbot.ui.components.ExerciseStatusElement
android:id="@+id/personalMotionPreviewElement"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@@ -28,7 +28,7 @@
android:layout_height="450dp"
android:layout_marginStart="80dp"
android:layout_marginTop="24dp"
android:background="@drawable/border_background_2"
android:background="@drawable/border_background"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"
@@ -40,10 +40,9 @@
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="40dp"
android:background="@drawable/border_background"
android:padding="16dp"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:paddingVertical="15dp"
android:paddingHorizontal="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
@@ -56,11 +55,11 @@
</LinearLayout>
<LinearLayout
android:layout_width="700dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/border_background"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"
@@ -76,11 +75,11 @@
</LinearLayout>
<LinearLayout
android:layout_width="700dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/border_background"
android:background="@drawable/border_background_3"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -15,6 +15,7 @@
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:src="@drawable/robot_logo"
android:tint="@color/white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -24,7 +25,7 @@
android:layout_marginTop="60dp"
android:text="FitBot"
android:textSize="48sp"
android:textColor="@color/darkBlue"
android:textColor="@color/white"
app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -26,7 +26,7 @@
</style>
<style name="TextStyleDesc">
<item name="android:textSize">14sp</item>
<item name="android:textSize">20sp</item>
<item name="android:textColor">#FFFFFF</item>
<item name= "android:textStyle">bold</item>
<item name="android:padding">6dp</item>