2019-01-18 13:16:59 +03:00
|
|
|
/**
|
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*
|
|
|
|
* @format
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2019-06-20 23:58:15 +03:00
|
|
|
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
2019-08-09 20:06:53 +03:00
|
|
|
import {type NativeComponentType} from '../../Utilities/codegenNativeComponent';
|
2019-01-18 13:16:59 +03:00
|
|
|
|
2019-06-20 23:58:15 +03:00
|
|
|
import type {
|
2019-07-01 15:10:20 +03:00
|
|
|
DirectEventHandler,
|
2019-06-20 23:58:15 +03:00
|
|
|
Float,
|
|
|
|
Int32,
|
|
|
|
WithDefault,
|
|
|
|
} from '../../Types/CodegenTypes';
|
2019-05-08 18:44:25 +03:00
|
|
|
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
|
|
import type {ViewProps} from '../View/ViewPropTypes';
|
2019-01-18 13:16:59 +03:00
|
|
|
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
|
|
...ViewProps,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the pull to refresh functionality is enabled.
|
|
|
|
*/
|
2019-07-02 12:59:04 +03:00
|
|
|
enabled?: WithDefault<boolean, false>,
|
2019-01-18 13:16:59 +03:00
|
|
|
/**
|
|
|
|
* The colors (at least one) that will be used to draw the refresh indicator.
|
|
|
|
*/
|
|
|
|
colors?: ?$ReadOnlyArray<ColorValue>,
|
|
|
|
/**
|
|
|
|
* The background color of the refresh indicator.
|
|
|
|
*/
|
|
|
|
progressBackgroundColor?: ?ColorValue,
|
|
|
|
/**
|
|
|
|
* Size of the refresh indicator, see RefreshControl.SIZE.
|
2019-06-20 23:58:15 +03:00
|
|
|
*
|
|
|
|
* This type isn't currently accurate. It really is specific numbers
|
|
|
|
* hard coded in the Android platform.
|
|
|
|
*
|
|
|
|
* Also, 1 isn't actually a safe default. We are able to set this here
|
|
|
|
* because native code isn't currently consuming the generated artifact.
|
|
|
|
* This will end up being
|
2019-07-02 12:59:04 +03:00
|
|
|
* size?: WithDefault<'default' | 'large', 'default'>,
|
2019-01-18 13:16:59 +03:00
|
|
|
*/
|
2019-07-02 12:59:04 +03:00
|
|
|
size?: WithDefault<Int32, 1>,
|
2019-01-18 13:16:59 +03:00
|
|
|
/**
|
|
|
|
* Progress view top offset
|
|
|
|
*/
|
2019-07-02 12:59:04 +03:00
|
|
|
progressViewOffset?: WithDefault<Float, 0>,
|
2019-01-18 13:16:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the view starts refreshing.
|
|
|
|
*/
|
2019-07-01 15:10:20 +03:00
|
|
|
onRefresh?: ?DirectEventHandler<null>,
|
2019-01-18 13:16:59 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the view should be indicating an active refresh.
|
|
|
|
*/
|
2019-07-01 17:47:58 +03:00
|
|
|
refreshing: boolean,
|
2019-01-18 13:16:59 +03:00
|
|
|
|}>;
|
|
|
|
|
2019-08-09 20:06:53 +03:00
|
|
|
export default (codegenNativeComponent<NativeProps>(
|
|
|
|
'AndroidSwipeRefreshLayout',
|
|
|
|
): NativeComponentType<NativeProps>);
|