Merge remote-tracking branch 'origin/main'

This commit is contained in:
Luca Warmenhoven
2024-06-05 14:23:33 +02:00
10 changed files with 109 additions and 26 deletions

View File

@@ -2,7 +2,9 @@ package com.example.fitbot.ui.activities;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -97,6 +99,12 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
ProgressBar loadingCircle = findViewById(R.id.loadingCircle);
loadingCircle.setIndeterminateTintList(ColorStateList.valueOf(Color.RED));
// Shimmer animation for loading elements
View shimmerFitnessTitle = findViewById(R.id.textViewFitnessTitle);
View shimmerFitnessText = findViewById(R.id.textViewFitnessShortDescription);
shimmerAnimation(shimmerFitnessTitle);
shimmerAnimation(shimmerFitnessText);
// Navigation Buttons
NavigationManager.setupButtonNavigation(this, R.id.homeButtonFitness, MainActivity.class);
NavigationManager.setupButtonNavigation(this, R.id.skipButtonFitness, MainActivity.class); //Needs to skip exercises once those are implemented
@@ -298,4 +306,19 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
});
animator.start();
}
public void shimmerAnimation(View view) {
ObjectAnimator animator = ObjectAnimator.ofObject(
view,
"backgroundColor",
new ArgbEvaluator(),
ContextCompat.getColor(view.getContext(), R.color.shimmerStartColor),
ContextCompat.getColor(view.getContext(), R.color.shimmerEndColor)
);
animator.setDuration(1000);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.REVERSE);
animator.start();
}
}

View File

@@ -97,7 +97,6 @@
android:textAlignment="center" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -15,5 +15,7 @@
<color name="invertedTextColor">#000000</color>
<color name="invertedIconTint">#000000</color>
<color name="transparent">#00000000</color>
<color name="shimmerStartColor">#EFEFEF</color>
<color name="shimmerEndColor">#DDDDDD</color>
</resources>

View File

@@ -25,7 +25,9 @@
<string name="title">Title</string>
<string name="exerciseDesc">Exercise description</string>
<string name="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</string>
<string name="descriptionTitle">Description</string>
<string name="exerciseDesc">Exercise description</string>
<string name="exerciseTitle">Exercise title</string>
</resources>

View File

@@ -15,4 +15,3 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
#android.enableJetifier=true