Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 360d04e

Browse files
andreicoman11facebook-github-bot-7
authored and
facebook-github-bot-7
committed
Add Timer example
Differential Revision: D2433417 committer: Service User <[email protected]>
1 parent b45f89e commit 360d04e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Examples/UIExplorer/TimerExample.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
var React = require('react-native');
1919
var {
2020
AlertIOS,
21+
Platform,
2122
Text,
23+
ToastAndroid,
2224
TouchableHighlight,
2325
View,
2426
} = React;
@@ -73,7 +75,11 @@ var TimerTester = React.createClass({
7375
var msg = 'Finished ' + this._ii + ' ' + this.props.type + ' calls.\n' +
7476
'Elapsed time: ' + e + ' ms\n' + (e / this._ii) + ' ms / iter';
7577
console.log(msg);
76-
AlertIOS.alert(msg);
78+
if (Platform.OS === 'ios') {
79+
AlertIOS.alert(msg);
80+
} else if (Platform.OS === 'android') {
81+
ToastAndroid.show(msg, ToastAndroid.SHORT);
82+
}
7783
this._start = 0;
7884
this.forceUpdate(() => { this._ii = 0; });
7985
return;

Examples/UIExplorer/UIExplorerButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ var UIExplorerButton = React.createClass({
4242

4343
var styles = StyleSheet.create({
4444
button: {
45-
borderColor: 'dimgray',
45+
borderColor: '#696969',
4646
borderRadius: 8,
4747
borderWidth: 1,
4848
padding: 10,
4949
margin: 5,
5050
alignItems: 'center',
5151
justifyContent: 'center',
52-
backgroundColor: 'lightgrey',
52+
backgroundColor: '#d3d3d3',
5353
},
5454
});
5555

0 commit comments

Comments
 (0)