|
|
@@ -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;
|
|
|
@@ -30,6 +31,7 @@ public class Tutorial {
|
|
|
private FragmentActivity activity;
|
|
|
private FrameLayout frameLayout;
|
|
|
private LayoutInflater inflater;
|
|
|
+ private ObjectAnimator fadeOut;
|
|
|
|
|
|
public final static int TUTORIAL_LISTICLE_COVER = 0;
|
|
|
public final static int TUTORIAL_LISTICLE_DETAIL = 1;
|
|
|
@@ -60,6 +62,12 @@ public class Tutorial {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void cancel(){
|
|
|
+ if(fadeOut != null){
|
|
|
+ fadeOut.cancel();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 공통으로 사용되는 ObjectAnimator 객체 반환
|
|
|
*
|
|
|
@@ -68,8 +76,7 @@ public class Tutorial {
|
|
|
*/
|
|
|
private ObjectAnimator fadeOut(View target) {
|
|
|
target.clearAnimation();
|
|
|
- ObjectAnimator fadeOut;
|
|
|
- fadeOut = ObjectAnimator.ofFloat(
|
|
|
+ this.fadeOut = ObjectAnimator.ofFloat(
|
|
|
target,
|
|
|
View.ALPHA,
|
|
|
1.0f,
|
|
|
@@ -78,6 +85,7 @@ public class Tutorial {
|
|
|
return fadeOut;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void showTutorialListicleCover(IEventListener listener) {
|
|
|
View view = inflater.inflate(R.layout.tutorial_listicle_cover, null);
|
|
|
frameLayout.addView(view);
|
|
|
@@ -128,7 +136,9 @@ public class Tutorial {
|
|
|
@Override
|
|
|
public void onAnimationEnd(Animator animator) {
|
|
|
frameLayout.removeView(view);
|
|
|
- listener.onEvent(new Event.Builder(Event.NEXT).build());
|
|
|
+ if(null != listener){
|
|
|
+ listener.onEvent(new Event.Builder(Event.NEXT).build());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|