Fix crash in Sapienz bot for Interpolator type

Reviewed By: mdvacca

Differential Revision: D7252818

fbshipit-source-id: 30c585a2e6f6c2d7a7e7013c26c6228d8ef29aa6
This commit is contained in:
Ram N 2018-03-13 17:56:33 -07:00 committed by Facebook Github Bot
parent 41acb0a75b
commit 9737774b96

View File

@ -2,7 +2,6 @@
package com.facebook.react.uimanager.layoutanimation;
import android.os.Build;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
@ -99,14 +98,11 @@ import javax.annotation.Nullable;
}
private static Interpolator getInterpolator(InterpolatorType type, ReadableMap params) {
Interpolator interpolator = null;
Interpolator interpolator;
if (type.equals(InterpolatorType.SPRING)) {
interpolator = new SimpleSpringInterpolator(SimpleSpringInterpolator.getSpringDamping(params));
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
// Conversion from BaseInterpolator to Interpolator is only possible on this Android versions
interpolator = INTERPOLATOR.get(type);
}
interpolator = INTERPOLATOR.get(type);
}
if (interpolator == null) {
throw new IllegalArgumentException("Missing interpolator for type : " + type);