Skip to content

Commit

Permalink
Fix pull to refresh refresh component clipping on Android
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andy Huang authored and facebook-github-bot committed Oct 15, 2018
1 parent b0d68c0 commit 8a3a0ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (Platform.OS === 'android') {
} else {
var RefreshLayoutConsts = {SIZE: {}};
}
type NativeRefreshControlType = Class<NativeComponent<Props>>;
type NativeRefreshControlType = Class<NativeComponent<RefreshControlProps>>;

const NativeRefreshControl: NativeRefreshControlType =
Platform.OS === 'ios'
Expand Down Expand Up @@ -78,7 +78,7 @@ type AndroidProps = $ReadOnly<{|
progressViewOffset?: ?number,
|}>;

type Props = $ReadOnly<{|
export type RefreshControlProps = $ReadOnly<{|
...ViewProps,
...IOSProps,
...AndroidProps,
Expand Down Expand Up @@ -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<Props> {
class RefreshControl extends React.Component<RefreshControlProps> {
static SIZE = RefreshLayoutConsts.SIZE;

_nativeRef: ?React.ElementRef<NativeRefreshControlType> = null;
Expand All @@ -149,7 +149,7 @@ class RefreshControl extends React.Component<Props> {
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.
Expand Down

0 comments on commit 8a3a0ad

Please sign in to comment.