|
|
@@ -5,6 +5,7 @@ import android.animation.ObjectAnimator;
|
|
|
import android.content.Context;
|
|
|
import android.support.constraint.ConstraintLayout;
|
|
|
import android.support.v4.app.FragmentActivity;
|
|
|
+import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.FrameLayout;
|
|
|
@@ -28,6 +29,8 @@ public class Tutorial {
|
|
|
private FrameLayout frameLayout;
|
|
|
private LayoutInflater inflater;
|
|
|
private ObjectAnimator animator;
|
|
|
+ private View bucketFirstView;
|
|
|
+ private View bucketSecondView;
|
|
|
|
|
|
private int screenWidth;
|
|
|
|
|
|
@@ -72,11 +75,20 @@ public class Tutorial {
|
|
|
* 튜토리얼 취소
|
|
|
*/
|
|
|
public void cancel() {
|
|
|
- if (animator != null) {
|
|
|
+ Log.e("APP# Tutorial | cancel", "|" + "Tutorial Cancel ====> ");
|
|
|
+ if (null != animator) {
|
|
|
animator.removeAllListeners();
|
|
|
animator.cancel();
|
|
|
animator = null;
|
|
|
}
|
|
|
+ if (null != frameLayout) {
|
|
|
+ if (bucketFirstView != null || bucketSecondView != null) {
|
|
|
+ frameLayout.removeView(bucketFirstView);
|
|
|
+ frameLayout.removeView(bucketSecondView);
|
|
|
+ }
|
|
|
+
|
|
|
+ frameLayout = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -200,14 +212,14 @@ public class Tutorial {
|
|
|
}
|
|
|
|
|
|
private void showTutorialBucketTag() {
|
|
|
- View firstView = inflater.inflate(R.layout.tutorial_bucket_list_tag, null);
|
|
|
- ConstraintLayout bubble1 = firstView.findViewById(R.id.tutorial_bucket_list_tag1);
|
|
|
- ConstraintLayout bubble2 = firstView.findViewById(R.id.tutorial_bucket_list_tag2);
|
|
|
+ bucketFirstView = inflater.inflate(R.layout.tutorial_bucket_list_tag, null);
|
|
|
+ ConstraintLayout bubble1 = bucketFirstView.findViewById(R.id.tutorial_bucket_list_tag1);
|
|
|
+ ConstraintLayout bubble2 = bucketFirstView.findViewById(R.id.tutorial_bucket_list_tag2);
|
|
|
//ImageView trashIcon1 = firstView.findViewById(R.id.image_trash);
|
|
|
|
|
|
- View secondView = inflater.inflate(R.layout.tutorial_bucket_list_update, null);
|
|
|
- ConstraintLayout bubble3 = secondView.findViewById(R.id.tutorial_bucket_list_success);
|
|
|
- // ImageView trashIcon2 = secondView.findViewById(R.id.imageView7);
|
|
|
+ bucketSecondView = inflater.inflate(R.layout.tutorial_bucket_list_update, null);
|
|
|
+ ConstraintLayout bubble3 = bucketSecondView.findViewById(R.id.tutorial_bucket_list_success);
|
|
|
+ // ImageView trashIcon2 = secondView.findViewById(R.id.imageView7);
|
|
|
/**
|
|
|
* API 23이하 버전 실행시 레이아웃 조정
|
|
|
* API 19 기기 테스트 결과 레이아웃에 잘 반영되지않아 주석처리
|
|
|
@@ -220,8 +232,8 @@ public class Tutorial {
|
|
|
// params2.setMargins(params2.leftMargin, params2.topMargin - ResourceUtil.getStatusBarHeight(), params2.rightMargin, params2.bottomMargin);
|
|
|
// }
|
|
|
|
|
|
- frameLayout.addView(firstView);
|
|
|
- firstView.setClickable(true);
|
|
|
+ frameLayout.addView(bucketFirstView);
|
|
|
+ bucketFirstView.setClickable(true);
|
|
|
bubble1.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
|
|
|
ObjectAnimator first = fadeOut(bubble1);
|
|
|
@@ -241,12 +253,12 @@ public class Tutorial {
|
|
|
third.setDuration(1000);
|
|
|
third.setStartDelay(1000);
|
|
|
|
|
|
- secondView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
+ bucketSecondView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
ObjectAnimator translateAnimator1 =
|
|
|
- ObjectAnimator.ofFloat(secondView, View.TRANSLATION_X, screenWidth, 0f);
|
|
|
+ ObjectAnimator.ofFloat(bucketSecondView, View.TRANSLATION_X, screenWidth, 0f);
|
|
|
translateAnimator1.setDuration(500);
|
|
|
|
|
|
- ObjectAnimator fourth = fadeOut(secondView);
|
|
|
+ ObjectAnimator fourth = fadeOut(bucketSecondView);
|
|
|
fourth.setDuration(1000);
|
|
|
fourth.setStartDelay(1000);
|
|
|
|
|
|
@@ -267,8 +279,8 @@ public class Tutorial {
|
|
|
public void onAnimationEnd(Animator animator) {
|
|
|
bubble2.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
// frameLayout.removeView(firstView);
|
|
|
- frameLayout.addView(secondView);
|
|
|
- secondView.setTranslationX(screenWidth);
|
|
|
+ frameLayout.addView(bucketSecondView);
|
|
|
+ bucketSecondView.setTranslationX(screenWidth);
|
|
|
Tutorial.this.animator = translateAnimator1;
|
|
|
translateAnimator1.start();
|
|
|
}
|
|
|
@@ -277,7 +289,7 @@ public class Tutorial {
|
|
|
translateAnimator1.addListener(new SimpleAnimatorListener() {
|
|
|
@Override
|
|
|
public void onAnimationEnd(Animator animator) {
|
|
|
- secondView.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
+ bucketSecondView.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
Tutorial.this.animator = third;
|
|
|
third.start();
|
|
|
}
|
|
|
@@ -288,9 +300,9 @@ public class Tutorial {
|
|
|
@Override
|
|
|
public void onAnimationEnd(Animator animator) {
|
|
|
bubble3.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
- frameLayout.removeView(firstView);
|
|
|
+ frameLayout.removeView(bucketFirstView);
|
|
|
Tutorial.this.animator = fourth;
|
|
|
- secondView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
+ bucketSecondView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
fourth.start();
|
|
|
}
|
|
|
});
|
|
|
@@ -299,7 +311,7 @@ public class Tutorial {
|
|
|
fourth.addListener(new SimpleAnimatorListener() {
|
|
|
@Override
|
|
|
public void onAnimationEnd(Animator animator) {
|
|
|
- secondView.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
+ bucketSecondView.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
}
|
|
|
});
|
|
|
|