2016-01-28 05:35:14 -08:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-01-28 05:35:14 -08:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-01-28 05:35:14 -08:00
|
|
|
*
|
2018-05-10 19:06:46 -07:00
|
|
|
* @format
|
2018-08-30 12:59:33 -07:00
|
|
|
* @flow
|
2016-01-28 05:35:14 -08:00
|
|
|
*/
|
2018-05-10 19:06:46 -07:00
|
|
|
|
2016-01-28 05:35:14 -08:00
|
|
|
'use strict';
|
|
|
|
|
2018-08-30 12:59:33 -07:00
|
|
|
const Platform = require('Platform');
|
|
|
|
|
|
|
|
function processDecelerationRate(
|
|
|
|
decelerationRate: number | 'normal' | 'fast',
|
|
|
|
): number {
|
2016-03-10 10:20:53 -08:00
|
|
|
if (decelerationRate === 'normal') {
|
2018-08-30 12:59:33 -07:00
|
|
|
return Platform.select({
|
|
|
|
ios: 0.998,
|
|
|
|
android: 0.985,
|
|
|
|
});
|
2016-03-10 10:20:53 -08:00
|
|
|
} else if (decelerationRate === 'fast') {
|
2018-08-30 12:59:33 -07:00
|
|
|
return Platform.select({
|
|
|
|
ios: 0.99,
|
|
|
|
android: 0.9,
|
|
|
|
});
|
2016-01-28 05:35:14 -08:00
|
|
|
}
|
|
|
|
return decelerationRate;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = processDecelerationRate;
|