From 360d04e9c86cf7af7d946331dba91adcdc845ad6 Mon Sep 17 00:00:00 2001 From: Andrei Coman Date: Fri, 11 Sep 2015 01:56:51 -0700 Subject: [PATCH] Add Timer example Differential Revision: D2433417 committer: Service User --- Examples/UIExplorer/TimerExample.js | 8 +++++++- Examples/UIExplorer/UIExplorerButton.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Examples/UIExplorer/TimerExample.js b/Examples/UIExplorer/TimerExample.js index 8ef94cafe..8d28e18ae 100644 --- a/Examples/UIExplorer/TimerExample.js +++ b/Examples/UIExplorer/TimerExample.js @@ -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; diff --git a/Examples/UIExplorer/UIExplorerButton.js b/Examples/UIExplorer/UIExplorerButton.js index 082fe86ba..21f8efc8c 100644 --- a/Examples/UIExplorer/UIExplorerButton.js +++ b/Examples/UIExplorer/UIExplorerButton.js @@ -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', }, });