|
|
@@ -5,6 +5,7 @@ import android.animation.AnimatorSet;
|
|
|
import android.animation.ObjectAnimator;
|
|
|
import android.content.Context;
|
|
|
import android.support.constraint.ConstraintLayout;
|
|
|
+import android.util.Log;
|
|
|
import android.view.View;
|
|
|
import android.view.animation.DecelerateInterpolator;
|
|
|
import android.widget.ImageView;
|
|
|
@@ -101,7 +102,7 @@ public class GuideLastViewHolder extends GuideView {
|
|
|
@Override
|
|
|
public void startAnimation() {
|
|
|
layoutHeader.animate().withLayer().setDuration(800).translationY(0f).start();
|
|
|
- imageViewObject.animate().withLayer().setDuration(120).translationY(0f).setInterpolator(new DecelerateInterpolator()).start();
|
|
|
+ imageViewObject.animate().withLayer().setDuration(1200).translationY(0f).setInterpolator(new DecelerateInterpolator(1.5f)).start();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -121,20 +122,12 @@ public class GuideLastViewHolder extends GuideView {
|
|
|
|
|
|
private void startPaperAnimation(ImageView imageViewPaper) {
|
|
|
|
|
|
- int randomX = (int) (Math.random() * 200 - 100);
|
|
|
- if (randomX > 0) {
|
|
|
- randomX = randomX + 100;
|
|
|
- }
|
|
|
- else {
|
|
|
- randomX = randomX - 100;
|
|
|
- }
|
|
|
- int randomY = (int) (Math.random() * 200 - 100);
|
|
|
- if (randomY > 0) {
|
|
|
- randomY = randomY + 100;
|
|
|
- }
|
|
|
- else {
|
|
|
- randomY = randomY - 100;
|
|
|
- }
|
|
|
+ double theta = Math.random() * (Math.PI * 2);
|
|
|
+ int radius = (int) (Math.random() * 300 + 100);
|
|
|
+ int randomX = (int) (Math.sin(theta) * radius);
|
|
|
+ int randomY = (int) (Math.cos(theta) * radius);
|
|
|
+
|
|
|
+ Log.d("APP# GuideLastViewHolder | startPaperAnimation", "|" + "th: " + theta + "x: " + randomX + ", y: " + randomY);
|
|
|
|
|
|
imageViewPaper.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
|
|
|
@@ -146,7 +139,7 @@ public class GuideLastViewHolder extends GuideView {
|
|
|
|
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
|
animatorSet.playTogether(paperAlphaAnimation, paperAnimationScaleX, paperAnimationScaleY, paperAnimationTranslationX, paperAnimationTranslationY);
|
|
|
- animatorSet.setInterpolator(new DecelerateInterpolator());
|
|
|
+ animatorSet.setInterpolator(new DecelerateInterpolator(1.5f));
|
|
|
animatorSet.setStartDelay(1000);
|
|
|
animatorSet.setDuration(1500);
|
|
|
animatorSet.addListener(new AnimatorManager.SimpleListener() {
|