react-native-ui-lib
Version:
<p align="center"> <img src="https://user-images.githubusercontent.com/1780255/105469025-56759000-5ca0-11eb-993d-3568c1fd54f4.png" height="250px" style="display:block"/> </p> <p align="center">UI Toolset & Components Library for React Native</p> <p a
44 lines (38 loc) • 1.18 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import {ScrollView} from 'react-native';
import KeyboardAwareBase from './KeyboardAwareBase';
import {LogService} from '../../services';
export default class KeyboardAwareListView extends KeyboardAwareBase {
static displayName = 'IGNORE';
static propTypes = {
onScroll: PropTypes.func
};
static defaultProps = {
...KeyboardAwareBase.defaultProps
};
constructor(props) {
super(props);
LogService.warn(
'RNUILib: Please stop Using KeyboardAwareListView, use either KeyboardAwareScrollView or KeyboardAwareFlatList'
);
}
render() {
const initialOpacity = this.props.startScrolledToBottom ? 0 : 1;
return (
<ScrollView
scrollEventThrottle={200}
{...this.props}
{...this.style}
opacity={initialOpacity}
contentInset={{bottom: this.state.keyboardHeight}}
ref={r => {
this._keyboardAwareView = r;
}}
onLayout={this._onKeyboardAwareViewLayout}
onScroll={this._onKeyboardAwareViewScroll}
onContentSizeChange={this._updateKeyboardAwareViewContentSize}
/>
);
}
}