This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
2.07 build url with params #310
Open
danieltsoy
wants to merge
15
commits into
1.01_hello_world
Choose a base branch
from
2.07_build_url_with_params
base: 1.01_hello_world
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e9f367e
1.02 Add list item forecast layout
fab554b
1.03 Update fragment layout
de032c1
1.04 Add dummy data
0281f77
1.05 Create ArrayAdapter to eventually use to populate the ListView
1d42493
1.06 Hook the adapter up to the ListView
ea6e195
2.01 Add the network call code
370d9bf
2.02 rename Placeholder -> Forecast
27e83bd
2.02 refactor ForecastFragment into to separate file
1e4314f
2.02 Refactor logging string into constant
sdspikes fa5e923
2.03 Add xml for refresh menu item
sdspikes f7f49a8
2.04 Inflate menu
sdspikes f18784f
2.05 Execute FetchWeatherTask
sdspikes d1579a4
2.06 Add Internet permission
sdspikes 30afc9f
2.07 Build URL with params
sdspikes affe306
Add API Key Parameter to OpenWeatherMap API Call
cdlei File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,11 @@ | |
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import android.widget.ArrayAdapter; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
|
||
|
||
public class MainActivity extends ActionBarActivity { | ||
|
||
@Override | ||
|
@@ -70,6 +68,8 @@ public boolean onOptionsItemSelected(MenuItem item) { | |
*/ | ||
public static class PlaceholderFragment extends Fragment { | ||
|
||
ArrayAdapter<String> mForecastAdapter; | ||
|
||
public PlaceholderFragment() { | ||
} | ||
|
||
|
@@ -88,6 +88,18 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
"Sun 6/29 - Sunny - 20/7" | ||
}; | ||
List<String> weekForecast = new ArrayList<String>(Arrays.asList(data)); | ||
|
||
|
||
// Now that we have some dummy forecast data, create an ArrayAdapter. | ||
// The ArrayAdapter will take data from a source (like our dummy forecast) and | ||
// use it to populate the ListView it's attached to. | ||
mForecastAdapter = | ||
new ArrayAdapter<String>( | ||
getActivity(), // The current context (this activity) | ||
R.layout.list_item_forecast, // The name of the layout ID. | ||
R.id.list_item_forecast_textview, // The ID of the textview to populate. | ||
weekForecast); | ||
|
||
View rootView = inflater.inflate(R.layout.fragment_main, container, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello |
||
return rootView; | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the layout should be more meaningful.