Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default class recentChatListScreen extends Component
- {
- constructor(props) {
- super(props);
- this.state = { elevation: 0 };
- }
- onScroll = (e) => {
- const { contentOffset } = e.nativeEvent;
- if (contentOffset.y > 0) {
- this.setState({ elevation: 48 });
- } else {
- this.setState({ elevation: 0 });
- }
- };
- .
- .
- .
- .
- .
- render() {
- return (
- <ThemeProvider uiTheme={uiTheme}>
- <View style={styles.contentWrapper}>
- <View>
- <Toolbar
- .
- .
- .
- style={{container: getPlatformElevation(this.state.elevation)}}
- />
- </View>
- <View style={styles.chatListContainer}>
- <FlatList
- data={[..]}
- renderItem={this._renderItem}
- keyExtractor={item => item.userId}
- onScroll={this.onScroll}
- />
Add Comment
Please, Sign In to add comment