From ee2067aa5cfa3fc2eeef42d17d4006b468c88b13 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 9b287cc4a18..366b1d917b1 100644 --- a/Libraries/Components/RefreshControl/RefreshControl.js +++ b/Libraries/Components/RefreshControl/RefreshControl.js @@ -29,7 +29,7 @@ if (Platform.OS === 'android') { } else { var RefreshLayoutConsts = {SIZE: {}}; } -type NativeRefreshControlType = Class>; +type NativeRefreshControlType = Class>; const NativeRefreshControl: NativeRefreshControlType = Platform.OS === 'ios' @@ -77,7 +77,7 @@ type AndroidProps = $ReadOnly<{| progressViewOffset?: ?number, |}>; -type Props = $ReadOnly<{| +export type RefreshControlProps = $ReadOnly<{| ...ViewProps, ...IOSProps, ...AndroidProps, @@ -138,7 +138,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; @@ -148,7 +148,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.