Skip to content

Commit 8a3a0ad

Browse files
Andy Huangfacebook-github-bot
Andy Huang
authored andcommitted
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
1 parent b0d68c0 commit 8a3a0ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Libraries/Components/RefreshControl/RefreshControl.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (Platform.OS === 'android') {
3030
} else {
3131
var RefreshLayoutConsts = {SIZE: {}};
3232
}
33-
type NativeRefreshControlType = Class<NativeComponent<Props>>;
33+
type NativeRefreshControlType = Class<NativeComponent<RefreshControlProps>>;
3434

3535
const NativeRefreshControl: NativeRefreshControlType =
3636
Platform.OS === 'ios'
@@ -78,7 +78,7 @@ type AndroidProps = $ReadOnly<{|
7878
progressViewOffset?: ?number,
7979
|}>;
8080

81-
type Props = $ReadOnly<{|
81+
export type RefreshControlProps = $ReadOnly<{|
8282
...ViewProps,
8383
...IOSProps,
8484
...AndroidProps,
@@ -139,7 +139,7 @@ type Props = $ReadOnly<{|
139139
* __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true
140140
* in the `onRefresh` function otherwise the refresh indicator will stop immediately.
141141
*/
142-
class RefreshControl extends React.Component<Props> {
142+
class RefreshControl extends React.Component<RefreshControlProps> {
143143
static SIZE = RefreshLayoutConsts.SIZE;
144144

145145
_nativeRef: ?React.ElementRef<NativeRefreshControlType> = null;
@@ -149,7 +149,7 @@ class RefreshControl extends React.Component<Props> {
149149
this._lastNativeRefreshing = this.props.refreshing;
150150
}
151151

152-
componentDidUpdate(prevProps: Props) {
152+
componentDidUpdate(prevProps: RefreshControlProps) {
153153
// RefreshControl is a controlled component so if the native refreshing
154154
// value doesn't match the current js refreshing prop update it to
155155
// the js value.

0 commit comments

Comments
 (0)