Skip to content

Commit

Permalink
Fix crash in Sapienz bot for Interpolator type
Browse files Browse the repository at this point in the history
Reviewed By: mdvacca

Differential Revision: D7252818

fbshipit-source-id: 30c585a2e6f6c2d7a7e7013c26c6228d8ef29aa6
  • Loading branch information
axe-fb authored and facebook-github-bot committed Mar 14, 2018
1 parent 41acb0a commit 9737774
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -99,14 +98,11 @@ public void initializeFromConfig(ReadableMap data, int globalDuration) {
}

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);
Expand Down

0 comments on commit 9737774

Please sign in to comment.