public class FindNetworkActivity extends DrawerActivity
Modifier and Type | Class and Description |
---|---|
static class |
FindNetworkActivity.FindLanguageFragment
The fragment for finding language networks.
|
static class |
FindNetworkActivity.FindLocationFragment
The fragment for finding the from location.
|
class |
FindNetworkActivity.SectionsPagerAdapter
A
FragmentPagerAdapter that returns a fragment corresponding to
one of the two available tabs: From , for location-based networks, and Speaks ,
for language-based networks. |
DrawerActivity.WaitForSubscribedList
Modifier and Type | Field and Description |
---|---|
private static android.app.SearchManager |
mSearchManager
The
SearchManager that will associate the SearchView with our search config. |
private FindNetworkActivity.SectionsPagerAdapter |
mSectionsPagerAdapter
The
android.support.v4.view.PagerAdapter that will provide
fragments for each of the sections. |
private ViewPager |
mViewPager
The
ViewPager that will host the section contents. |
(package private) static org.codethechange.culturemesh.models.Location |
near
The user's chosen
Location they are near |
private android.widget.Button |
nearButton
Button that leads to the
ChooseNearLocationActivity |
(package private) static RequestQueue |
queue
Queue to hold asynchronous tasks
|
int |
REQUEST_NEW_NEAR_LOCATION |
currentUser, frameLayout, fullLayout, mDrawerLayout, mDrawerToggle, mToolbar, navView, subscribedNetworkIds, subscribedNetworks, thisActivity
Constructor and Description |
---|
FindNetworkActivity() |
Modifier and Type | Method and Description |
---|---|
protected void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
When the user has chosen a near location using
ChooseNearLocationActivity , this
method is called by the Intent that launched the near location chooser with the
result of the user's selection. |
protected void |
onCreate(android.os.Bundle savedInstanceState)
Setup the activity based on content specified in
R.layout#activity_find_network . |
boolean |
onCreateOptionsMenu(android.view.Menu menu)
Inflate the menu; this adds items to the action bar if it is present.
|
boolean |
onOptionsItemSelected(android.view.MenuItem item)
Handles clicks to the action bar.
|
protected void |
onResume() |
void |
onStop()
This ensures that we are canceling all network requests if the user is leaving this activity.
|
fetchNetworks, onConfigurationChanged, onNavigationItemSelected, onPostCreate, setContentView
static org.codethechange.culturemesh.models.Location near
Location
they are nearpublic final int REQUEST_NEW_NEAR_LOCATION
static RequestQueue queue
private FindNetworkActivity.SectionsPagerAdapter mSectionsPagerAdapter
android.support.v4.view.PagerAdapter
that will provide
fragments for each of the sections. We use a
FragmentPagerAdapter
derivative, which will keep every
loaded fragment in memory. If this becomes too memory intensive, it
may be best to switch to a
android.support.v4.app.FragmentStatePagerAdapter
.private ViewPager mViewPager
ViewPager
that will host the section contents.private static android.app.SearchManager mSearchManager
SearchManager
that will associate the SearchView with our search config.private android.widget.Button nearButton
ChooseNearLocationActivity
protected void onCreate(android.os.Bundle savedInstanceState)
R.layout#activity_find_network
. See
code comments for details on implementation.savedInstanceState
- Previous state that is passed to superclass.protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data)
ChooseNearLocationActivity
, this
method is called by the Intent
that launched the near location chooser with the
result of the user's selection. If they did indeed choose a location, that location is saved
and the button text is updated to reflect the location's name.requestCode
- Status code that indicates a location was chosen if it equals
ChooseNearLocationActivity.RESULT_OK
resultCode
- data
- Passed to superclass, but the value associated with
ChooseNearLocationActivity.CHOSEN_PLACE
, which should be the location
the user chose, is extracted if requestCode
indicates they made a choiceprotected void onResume()
public boolean onCreateOptionsMenu(android.view.Menu menu)
menu
- Menu to createtrue
public boolean onOptionsItemSelected(android.view.MenuItem item)
item
- true
if the item ID is that of R.id#action_settings
. Otherwise,
superclass onOptionsItemSelected
is called and the resulting value is returned.public void onStop()
onStop
in class DrawerActivity