Skip to content

Commit

Permalink
Add snapToAlignment to ScrollView.js Android implementation
Browse files Browse the repository at this point in the history
Summary:
Update ScrollView.js to support snapToAlignment in RN Android

changelog: [Android][Added] Implement snapToAlignment in ReactHorizontalScrollView

Reviewed By: JoshuaGross

Differential Revision: D31174546

fbshipit-source-id: 480e990793ced74121c6aa1875f2695a70d1f804
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 29, 2021
1 parent b29b05f commit a54cfb9
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,6 @@ type IOSProps = $ReadOnly<{|
* The default value is true.
*/
showsHorizontalScrollIndicator?: ?boolean,
/**
* When `snapToInterval` is set, `snapToAlignment` will define the relationship
* of the snapping to the scroll view.
*
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
* - `'center'` will align the snap in the center
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
*
* @platform ios
*/
snapToAlignment?: ?('start' | 'center' | 'end'),
/**
* The current scale of the scroll view content. The default value is 1.0.
* @platform ios
Expand Down Expand Up @@ -597,6 +586,15 @@ export type Props = $ReadOnly<{|
* for example when you want your list to have an animated hidable header.
*/
StickyHeaderComponent?: StickyHeaderComponentType,
/**
* When `snapToInterval` is set, `snapToAlignment` will define the relationship
* of the snapping to the scroll view.
*
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
* - `'center'` will align the snap in the center
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
*/
snapToAlignment?: ?('start' | 'center' | 'end'),
/**
* When set, causes the scroll view to stop at multiples of the value of
* `snapToInterval`. This can be used for paginating through children
Expand Down

0 comments on commit a54cfb9

Please sign in to comment.