diff --git a/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java b/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java index be0198c19d..b4028c18c6 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/DynamicListView.java @@ -455,6 +455,24 @@ public class DynamicListView extends ObservableListView { if (android.os.Build.VERSION.SDK_INT < 12) { finishTouch(); } else { + /** + * This TypeEvaluator is used to animate the BitmapDrawable back to its + * final location when the user lifts his finger by modifying the + * BitmapDrawable's bounds. + */ + TypeEvaluator sBoundEvaluator = new TypeEvaluator() { + public Rect evaluate(float fraction, Rect startValue, Rect endValue) { + return new Rect(interpolate(startValue.left, endValue.left, fraction), + interpolate(startValue.top, endValue.top, fraction), + interpolate(startValue.right, endValue.right, fraction), + interpolate(startValue.bottom, endValue.bottom, fraction)); + } + + public int interpolate(int start, int end, float fraction) { + return (int) (start + fraction * (end - start)); + } + }; + ObjectAnimator hoverViewAnimator = ObjectAnimator.ofObject(mHoverCell, "bounds", sBoundEvaluator, mHoverCellCurrentBounds); hoverViewAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @@ -514,24 +532,6 @@ public class DynamicListView extends ObservableListView { } } - /** - * This TypeEvaluator is used to animate the BitmapDrawable back to its - * final location when the user lifts his finger by modifying the - * BitmapDrawable's bounds. - */ - private final static TypeEvaluator sBoundEvaluator = new TypeEvaluator() { - public Rect evaluate(float fraction, Rect startValue, Rect endValue) { - return new Rect(interpolate(startValue.left, endValue.left, fraction), - interpolate(startValue.top, endValue.top, fraction), - interpolate(startValue.right, endValue.right, fraction), - interpolate(startValue.bottom, endValue.bottom, fraction)); - } - - public int interpolate(int start, int end, float fraction) { - return (int) (start + fraction * (end - start)); - } - }; - /** * Determines whether this listview is in a scrolling state invoked * by the fact that the hover cell is out of the bounds of the listview;