package app.ctrlyati.android.lazyquickreturn.listener;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

import com.superscores.soccer.R;
import com.superscores.soccer.quickreturn.QuickReturnHelper;

/**
 * Created by Yati on 05/14/2015.
 */
public class SimpleTopElementQuickReturnListener extends SimpleQuickReturnListener {

    public static final float SCROLL_THRESHOLD = 100f;

    private View mTarget;

    private Animation mEnterAnimation;
    private Animation mExitAnimation;

    public SimpleTopElementQuickReturnListener(@NonNull final View target, Context context) {
        super(SCROLL_THRESHOLD, QuickReturnHelper.Direction.UP);

        mTarget = target;


        mExitAnimation = AnimationUtils.loadAnimation(context.getApplicationContext(), R.anim.abc_slide_out_top);
        mExitAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                mTarget.setVisibility(View.GONE);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });

        mEnterAnimation = AnimationUtils.loadAnimation(context.getApplicationContext(),
                R.anim.abc_slide_in_top);
        mEnterAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
                mTarget.setVisibility(View.VISIBLE);
            }

            @Override
            public void onAnimationEnd(Animation animation) {

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });

    }

    @Override
    public void onShow() {
        mTarget.startAnimation(mEnterAnimation);
    }

    @Override
    public void onHide() {
        mTarget.startAnimation(mExitAnimation);
    }
}

@@ -249,93 +249,109 @@
 ort 
-com.superscores.soccer.R;%0Aimport com.superscores.soccer.quickreturn.QuickReturnHelper
+app.ctrlyati.android.lazyquickreturn.QuickReturnHelper;%0Aimport app.ctrlyati.android.lazyquickreturn.R
 ;%0A%0A/

fix bugs