From 8a3a0ad2d0f894a3d8c1e403a9336dab17c2dde8 Mon Sep 17 00:00:00 2001 From: Andy Huang Date: Mon, 15 Oct 2018 12:38:42 -0700 Subject: [PATCH] Fix pull to refresh refresh component clipping on Android Summary: Currently the pull to refresh icon on browse feed is super cut off on Android. Expose the progressViewOffset prop from FBPullToRefresh to support offsetting the PTR component to make the component more visible. Reviewed By: yungsters Differential Revision: D10274679 fbshipit-source-id: 1735c4d2d98523ccc3d1ec3733465028ae33df7b --- Libraries/Components/RefreshControl/RefreshControl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/Components/RefreshControl/RefreshControl.js b/Libraries/Components/RefreshControl/RefreshControl.js index 1ebd30dbd..0f3f4c857 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -30,7 +30,7 @@ if (Platform.OS === 'android') { } else { var RefreshLayoutConsts = {SIZE: {}}; } -type NativeRefreshControlType = Class>; +type NativeRefreshControlType = Class>; const NativeRefreshControl: NativeRefreshControlType = Platform.OS === 'ios' @@ -78,7 +78,7 @@ type AndroidProps = $ReadOnly<{| progressViewOffset?: ?number, |}>; -type Props = $ReadOnly<{| +export type RefreshControlProps = $ReadOnly<{| ...ViewProps, ...IOSProps, ...AndroidProps, @@ -139,7 +139,7 @@ type Props = $ReadOnly<{| * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true * in the `onRefresh` function otherwise the refresh indicator will stop immediately. */ -class RefreshControl extends React.Component { +class RefreshControl extends React.Component { static SIZE = RefreshLayoutConsts.SIZE; _nativeRef: ?React.ElementRef = null; @@ -149,7 +149,7 @@ class RefreshControl extends React.Component { this._lastNativeRefreshing = this.props.refreshing; } - componentDidUpdate(prevProps: Props) { + componentDidUpdate(prevProps: RefreshControlProps) { // RefreshControl is a controlled component so if the native refreshing // value doesn't match the current js refreshing prop update it to // the js value.