2015-09-14 14:35:58 +00:00
|
|
|
/**
|
|
|
|
* The examples provided by Facebook are for non-commercial testing and
|
|
|
|
* evaluation purposes only.
|
|
|
|
*
|
|
|
|
* Facebook reserves all rights not expressly granted.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var React = require('react-native');
|
|
|
|
var {
|
|
|
|
StyleSheet,
|
|
|
|
View,
|
|
|
|
} = React;
|
|
|
|
var UIExplorerListBase = require('./UIExplorerListBase');
|
|
|
|
|
|
|
|
var COMPONENTS = [
|
|
|
|
require('./ImageExample'),
|
2015-12-22 17:02:12 +00:00
|
|
|
require('./ListViewExample'),
|
2016-01-27 18:49:31 +00:00
|
|
|
require('./PickerAndroidExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./ProgressBarAndroidExample'),
|
2016-01-27 18:49:31 +00:00
|
|
|
require('./RefreshControlExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./ScrollViewSimpleExample'),
|
2016-02-03 14:40:39 +00:00
|
|
|
require('./StatusBarExample'),
|
2016-01-11 20:45:17 +00:00
|
|
|
require('./SwitchExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./TextExample.android'),
|
|
|
|
require('./TextInputExample.android'),
|
|
|
|
require('./ToolbarAndroidExample'),
|
|
|
|
require('./TouchableExample'),
|
|
|
|
require('./ViewExample'),
|
2015-10-07 02:43:31 +00:00
|
|
|
require('./ViewPagerAndroidExample.android'),
|
2015-12-17 19:47:37 +00:00
|
|
|
require('./WebViewExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
var APIS = [
|
|
|
|
require('./AccessibilityAndroidExample.android'),
|
2015-12-17 19:09:22 +00:00
|
|
|
require('./AlertExample').AlertExample,
|
2016-01-21 19:43:51 +00:00
|
|
|
require('./AppStateExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./BorderExample'),
|
2016-01-14 12:31:51 +00:00
|
|
|
require('./CameraRollExample'),
|
2015-12-09 18:00:19 +00:00
|
|
|
require('./ClipboardExample'),
|
2016-01-26 18:29:47 +00:00
|
|
|
require('./DatePickerAndroidExample'),
|
2015-11-18 17:03:51 +00:00
|
|
|
require('./GeolocationExample'),
|
2016-01-27 18:49:31 +00:00
|
|
|
require('./ImageEditingExample'),
|
2015-11-12 20:35:44 +00:00
|
|
|
require('./IntentAndroidExample.android'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./LayoutEventsExample'),
|
|
|
|
require('./LayoutExample'),
|
2016-02-09 04:02:45 +00:00
|
|
|
require('./NavigationExperimental/NavigationExperimentalExample'),
|
2015-12-08 17:30:07 +00:00
|
|
|
require('./NetInfoExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./PanResponderExample'),
|
|
|
|
require('./PointerEventsExample'),
|
2016-01-26 18:29:47 +00:00
|
|
|
require('./TimePickerAndroidExample'),
|
2015-09-14 14:35:58 +00:00
|
|
|
require('./TimerExample'),
|
|
|
|
require('./ToastAndroidExample.android'),
|
|
|
|
require('./XHRExample'),
|
|
|
|
];
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
onSelectExample: Function,
|
|
|
|
isInDrawer: bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
class UIExplorerList extends React.Component {
|
|
|
|
props: Props;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<UIExplorerListBase
|
|
|
|
components={COMPONENTS}
|
|
|
|
apis={APIS}
|
|
|
|
searchText=""
|
|
|
|
renderAdditionalView={this.renderAdditionalView.bind(this)}
|
|
|
|
onPressRow={this.onPressRow.bind(this)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
renderAdditionalView(renderRow, renderTextInput): React.Component {
|
|
|
|
if (this.props.isInDrawer) {
|
|
|
|
var homePage = renderRow({
|
|
|
|
title: 'UIExplorer',
|
|
|
|
description: 'List of examples',
|
|
|
|
}, -1);
|
|
|
|
return (
|
|
|
|
<View>
|
|
|
|
{homePage}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return renderTextInput(styles.searchTextInput);
|
|
|
|
}
|
|
|
|
|
|
|
|
onPressRow(example: any) {
|
|
|
|
var Component = UIExplorerListBase.makeRenderable(example);
|
|
|
|
this.props.onSelectExample({
|
|
|
|
title: Component.title,
|
|
|
|
component: Component,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
searchTextInput: {
|
|
|
|
padding: 2,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = UIExplorerList;
|