florent37 / ViewAnimator

A fluent Android animation library
Apache License 2.0
2.71k stars 423 forks source link

Very important functionality Pause and Resume animation are missing. #35

Open ashishkumawat opened 6 years ago

ashishkumawat commented 6 years ago

Please add pause and resume functions I customize library in my project to add functionality but ViewanimatorSet require api 19 for pause and resume. Hence please add your inbuilt functionality. My project supports minimum api 17.

florent37 commented 6 years ago

an you share the code to pause / resume please ? or make a pull request

ashishkumawat commented 6 years ago

I just simply called android inbuilt functions inside ViewAnimator class.

public ViewAnimator pause() {
        if (animatorSet != null){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                animatorSet.pause();
            }
        }
        return this;
    }

    public ViewAnimator resume() {
        if (animatorSet != null){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                animatorSet.resume();
            }
        }
        return this;
    }