Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -59,6 +59,8 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
private VideoView videoView;
|
||||
private QiContext qiContext;
|
||||
|
||||
private ObjectAnimator shimmerAnimator;
|
||||
|
||||
private final Object lock = new Object();
|
||||
|
||||
// Some nice little messages for the user
|
||||
@@ -99,9 +101,11 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
ProgressBar loadingCircle = findViewById(R.id.loadingCircle);
|
||||
loadingCircle.setIndeterminateTintList(ColorStateList.valueOf(Color.RED));
|
||||
|
||||
// Shimmer animation for loading elements
|
||||
// Start shimmer animation for loading elements
|
||||
View shimmerProgressCircle = findViewById(R.id.progressCircle);
|
||||
View shimmerFitnessTitle = findViewById(R.id.textViewFitnessTitle);
|
||||
View shimmerFitnessText = findViewById(R.id.textViewFitnessShortDescription);
|
||||
shimmerAnimation(shimmerProgressCircle);
|
||||
shimmerAnimation(shimmerFitnessTitle);
|
||||
shimmerAnimation(shimmerFitnessText);
|
||||
|
||||
@@ -174,6 +178,9 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
ProgressBar loadingCircle = findViewById(R.id.loadingCircle);
|
||||
loadingCircle.setVisibility(View.GONE);
|
||||
|
||||
// Stop shimmer animation
|
||||
stopShimmerAnimation();
|
||||
|
||||
if ( videoView.isPlaying() )
|
||||
{
|
||||
QiContext qiContext = null;
|
||||
@@ -297,7 +304,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
MediaPlayer.create(this, soundId).start();
|
||||
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(progressCircle, "alpha", 1f, 0f, 1f);
|
||||
animator.setDuration(500); // Burst duration
|
||||
animator.setDuration(700); // Burst duration
|
||||
animator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
@@ -315,10 +322,15 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
|
||||
ContextCompat.getColor(view.getContext(), R.color.shimmerStartColor),
|
||||
ContextCompat.getColor(view.getContext(), R.color.shimmerEndColor)
|
||||
);
|
||||
animator.setDuration(1000);
|
||||
animator.setDuration(1200);
|
||||
animator.setRepeatCount(ValueAnimator.INFINITE);
|
||||
animator.setRepeatMode(ValueAnimator.REVERSE);
|
||||
animator.start();
|
||||
}
|
||||
|
||||
public void stopShimmerAnimation() {
|
||||
if (shimmerAnimator != null && shimmerAnimator.isRunning()) {
|
||||
shimmerAnimator.cancel();
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,6 +16,6 @@
|
||||
<color name="invertedIconTint">#000000</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="shimmerStartColor">#EFEFEF</color>
|
||||
<color name="shimmerEndColor">#DDDDDD</color>
|
||||
<color name="shimmerEndColor">#ADADAD</color>
|
||||
</resources>
|
||||
|
||||
|
Reference in New Issue
Block a user