@@ -279,12 +279,12 @@ float getDestinationPosition(float currentPosition, float velocity, float durati
279
279
return Float .NaN ;
280
280
case ON_UP_DECELERATE :
281
281
return Math .max (0 , Math .min (1 , rest ));
282
- case ON_UP_DECELERATE_AND_COMPLETE :
283
- if (rest > 0.2f && rest < 0.8f ){
284
- return rest ;
285
- } else {
286
- return rest > .5 ? 1 : 0 ;
287
- }
282
+ case ON_UP_DECELERATE_AND_COMPLETE : // complete if within 20% of edge #todo improve
283
+ if (rest > 0.2f && rest < 0.8f ) {
284
+ return rest ;
285
+ } else {
286
+ return rest > .5f ? 1 : 0 ;
287
+ }
288
288
case ON_UP_AUTOCOMPLETE :
289
289
}
290
290
@@ -300,19 +300,19 @@ float getDestinationPosition(float currentPosition, float velocity, float durati
300
300
void config (float position , float velocity , long start , float duration ) {
301
301
mStart = start ;
302
302
mDestination = getDestinationPosition (position , velocity , duration );
303
- if (mOnTouchUp == ON_UP_DECELERATE ) {
304
- if (mAutoCompleteMode == MODE_CONTINUOUS_VELOCITY ) {
305
- StopLogicEngine .Decelerate sld ;
306
- if (mEngine instanceof StopLogicEngine .Decelerate ) {
307
- sld = (StopLogicEngine .Decelerate ) mEngine ;
308
- } else {
309
- mEngine = sld = new StopLogicEngine .Decelerate ();
310
- }
311
- sld .config (position , mDestination , velocity );
312
- return ;
303
+ if ((mOnTouchUp == ON_UP_DECELERATE )
304
+ && (mAutoCompleteMode == MODE_CONTINUOUS_VELOCITY )) {
305
+ StopLogicEngine .Decelerate sld ;
306
+ if (mEngine instanceof StopLogicEngine .Decelerate ) {
307
+ sld = (StopLogicEngine .Decelerate ) mEngine ;
308
+ } else {
309
+ mEngine = sld = new StopLogicEngine .Decelerate ();
313
310
}
311
+ sld .config (position , mDestination , velocity );
312
+ return ;
314
313
}
315
314
315
+
316
316
if (mAutoCompleteMode == MODE_CONTINUOUS_VELOCITY ) {
317
317
StopLogicEngine sl ;
318
318
if (mEngine instanceof StopLogicEngine ) {
0 commit comments