Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfccbbb5

Browse files
committed
Now showing gather data message
Search View now shows appropriate loading message for gathering currentweather data and 10 day forecast data
1 parentc26eec8 commitfccbbb5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎ios/WeatherApp/App/Views/SearchView.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var SearchView = React.createClass({
6060
})).done();
6161
},
6262
handleResponseForForecast:function(forecastData,currentWeatherData){
63-
this.setState({isLoading:false});
63+
this.setState({isLoading:false,message:''});
6464
//once response from both API's come, navigate to TodayView
6565
this.props.navigator.push({
6666
title:"Current",
@@ -106,13 +106,14 @@ var SearchView = React.createClass({
106106
//this.props.navigator.pop()
107107
handleResponseForCurrentWeather:function(currentWeatherData){
108108
//make API call for 10 day Forecast
109+
this.setState({message:'Gathering 10 day forecast data'});
109110
this.fetchApiDataForForecast(this.prepareAPIUrlForForecast(),currentWeatherData);
110111
},
111112
handleTextInputChange:function(event){
112113
this.setState({searchString:event.nativeEvent.text});
113114
},
114-
handleButtonPressed:function(){
115-
this.setState({isLoading:true,message:''});
115+
handleSearchButtonPressed:function(){
116+
this.setState({isLoading:true,message:'Gathering current weather data'});
116117
this.fetchApiDataForCurrentWeather(this.prepareAPIUrlForCurrentWeather());
117118
},
118119
render:function(){
@@ -131,7 +132,7 @@ var SearchView = React.createClass({
131132
value={this.state.searchString}
132133
onChange={this.handleTextInputChange}></TextInput>
133134

134-
<TouchableHighlightstyle={styles.button}underlayColor="#5CBC85"onPress={this.handleButtonPressed}>
135+
<TouchableHighlightstyle={styles.button}underlayColor="#5CBC85"onPress={this.handleSearchButtonPressed}>
135136
<Textstyle={styles.buttonText}>Get Weather</Text>
136137
</TouchableHighlight>
137138
{spinner}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp