mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 11:05:21 +00:00
Add Timer example
Differential Revision: D2433417 committer: Service User <svcscm@fb.com>
This commit is contained in:
parent
b45f89e69f
commit
360d04e9c8
@ -18,7 +18,9 @@
|
||||
var React = require('react-native');
|
||||
var {
|
||||
AlertIOS,
|
||||
Platform,
|
||||
Text,
|
||||
ToastAndroid,
|
||||
TouchableHighlight,
|
||||
View,
|
||||
} = React;
|
||||
@ -73,7 +75,11 @@ var TimerTester = React.createClass({
|
||||
var msg = 'Finished ' + this._ii + ' ' + this.props.type + ' calls.\n' +
|
||||
'Elapsed time: ' + e + ' ms\n' + (e / this._ii) + ' ms / iter';
|
||||
console.log(msg);
|
||||
AlertIOS.alert(msg);
|
||||
if (Platform.OS === 'ios') {
|
||||
AlertIOS.alert(msg);
|
||||
} else if (Platform.OS === 'android') {
|
||||
ToastAndroid.show(msg, ToastAndroid.SHORT);
|
||||
}
|
||||
this._start = 0;
|
||||
this.forceUpdate(() => { this._ii = 0; });
|
||||
return;
|
||||
|
@ -42,14 +42,14 @@ var UIExplorerButton = React.createClass({
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
button: {
|
||||
borderColor: 'dimgray',
|
||||
borderColor: '#696969',
|
||||
borderRadius: 8,
|
||||
borderWidth: 1,
|
||||
padding: 10,
|
||||
margin: 5,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: 'lightgrey',
|
||||
backgroundColor: '#d3d3d3',
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user