package com.reidzeibel.animatedlistadapter.utils;

import android.content.Context;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;

/**
 * Created by RidwanAditama on 16/01/2017.
 */

public class AnimUtils {

    private AnimUtils() { }

    private static Interpolator fastOutSlowIn;
    private static Interpolator fastOutLinearIn;
    private static Interpolator linearOutSlowIn;
    private static Interpolator linear;

    public static Interpolator getFastOutSlowInInterpolator(Context context) {
        if (fastOutSlowIn == null) {
            fastOutSlowIn = AnimationUtils.loadInterpolator(context,
                    android.R.interpolator.fast_out_slow_in);
        }
        return fastOutSlowIn;
    }

    public static Interpolator getFastOutLinearInInterpolator(Context context) {
        if (fastOutLinearIn == null) {
            fastOutLinearIn = AnimationUtils.loadInterpolator(context,
                    android.R.interpolator.fast_out_linear_in);
        }
        return fastOutLinearIn;
    }

    public static Interpolator getLinearOutSlowInInterpolator(Context context) {
        if (linearOutSlowIn == null) {
            linearOutSlowIn = AnimationUtils.loadInterpolator(context,
                    android.R.interpolator.linear_out_slow_in);
        }
        return linearOutSlowIn;
    }

    public static Interpolator getLinearInterpolator() {
        if (linear == null) {
            linear = new LinearInterpolator();
        }
        return linear;
    }
}

@@ -83,32 +83,43 @@
 %0Aimport android.
+support.v4.
 view.animation.A
@@ -117,30 +117,181 @@
 imation.
-AnimationUtils
+FastOutLinearInInterpolator;%0Aimport android.support.v4.view.animation.FastOutSlowInInterpolator;%0Aimport android.support.v4.view.animation.LinearOutSlowInInterpolator
 ;%0Aimport
@@ -820,108 +820,38 @@
 n = 
-AnimationUtils.loadInterpolator(context,%0A                    android.R.interpolator.fast_out_slow_in
+new FastOutSlowInInterpolator(
 );%0A 
@@ -1050,110 +1050,40 @@
 n = 
-AnimationUtils.loadInterpolator(context,%0A                    android.R.interpolator.fast_out_linear_in
+new FastOutLinearInInterpolator(
 );%0A 
@@ -1284,110 +1284,40 @@
 n = 
-AnimationUtils.loadInterpolator(context,%0A                    android.R.interpolator.linear_out_slow_in
+new LinearOutSlowInInterpolator(
 );%0A 

Fix compatibility with API v19