Add inverted prop in SectionListExample
Summary: This PR adds an option to pass`inverted` prop to SectionListExample in RNTester. FlatListExample already has this option but it's not available in SectionListExample. Run RNTester app on device or simulator and select SectionListExample. Depending on switching `inverted` option, you can see either inverted list or not. [GENERAL][ENHANCEMENT][RNTeater] - Add inverted prop to SectionListExample Closes https://github.com/facebook/react-native/pull/18370 Differential Revision: D7317168 Pulled By: hramos fbshipit-source-id: c6c212c705e686281f23954775cc3465cce3c8df
This commit is contained in:
parent
6f588b31be
commit
541485c7fe
|
@ -76,6 +76,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
|
||||||
filterText: '',
|
filterText: '',
|
||||||
logViewable: false,
|
logViewable: false,
|
||||||
virtualized: true,
|
virtualized: true,
|
||||||
|
inverted: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
_scrollPos = new Animated.Value(0);
|
_scrollPos = new Animated.Value(0);
|
||||||
|
@ -125,6 +126,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
|
||||||
{renderSmallSwitchOption(this, 'virtualized')}
|
{renderSmallSwitchOption(this, 'virtualized')}
|
||||||
{renderSmallSwitchOption(this, 'logViewable')}
|
{renderSmallSwitchOption(this, 'logViewable')}
|
||||||
{renderSmallSwitchOption(this, 'debug')}
|
{renderSmallSwitchOption(this, 'debug')}
|
||||||
|
{renderSmallSwitchOption(this, 'inverted')}
|
||||||
<Spindicator value={this._scrollPos} />
|
<Spindicator value={this._scrollPos} />
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.scrollToRow}>
|
<View style={styles.scrollToRow}>
|
||||||
|
@ -146,6 +148,7 @@ class SectionListExample extends React.PureComponent<{}, $FlowFixMeState> {
|
||||||
<CustomSeparatorComponent {...info} text="ITEM SEPARATOR" />
|
<CustomSeparatorComponent {...info} text="ITEM SEPARATOR" />
|
||||||
}
|
}
|
||||||
debug={this.state.debug}
|
debug={this.state.debug}
|
||||||
|
inverted={this.state.inverted}
|
||||||
enableVirtualization={this.state.virtualized}
|
enableVirtualization={this.state.virtualized}
|
||||||
onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')}
|
onRefresh={() => Alert.alert('onRefresh: nothing to refresh :P')}
|
||||||
onScroll={this._scrollSinkY}
|
onScroll={this._scrollSinkY}
|
||||||
|
@ -232,6 +235,8 @@ const styles = StyleSheet.create({
|
||||||
},
|
},
|
||||||
optionSection: {
|
optionSection: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
searchRow: {
|
searchRow: {
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
|
|
Loading…
Reference in New Issue