public class DrawerActivity
extends AppCompatActivity
Modifier and Type | Class and Description |
---|---|
static interface |
DrawerActivity.WaitForSubscribedList
Interface for classes that have actions that must wait until after the list of subscribed
Network s has been populated. |
Modifier and Type | Field and Description |
---|---|
protected long |
currentUser
ID of the current
User |
protected android.widget.FrameLayout |
frameLayout
Parent for the drawer activity
|
protected DrawerLayout |
fullLayout
The inflated user interface for the activity with the drawer
|
protected DrawerLayout |
mDrawerLayout
User interface for the drawer itself
|
protected ActionBarDrawerToggle |
mDrawerToggle
Toggles whether the drawer is visible
|
protected Toolbar |
mToolbar |
(package private) NavigationView |
navView
The navigation view
|
(package private) RequestQueue |
queue
Queue for asynchronous tasks
|
protected java.util.Set<java.lang.Long> |
subscribedNetworkIds
IDs of the
Network s the current User is subscribed to |
protected android.util.SparseArray<com.culturemesh.android.models.Network> |
subscribedNetworks
The
User 's current Network s |
(package private) android.app.Activity |
thisActivity
Reference to the current activity
|
Constructor and Description |
---|
DrawerActivity() |
Modifier and Type | Method and Description |
---|---|
void |
fetchNetworks()
This fetches the users subscribed networks and displays them in the navigation drawer.
|
void |
onConfigurationChanged(android.content.res.Configuration newConfig)
Also updates the configuration of the drawer toggle by calling
DrawerActivity#mDrawerToggle#onConfigurationChanged(Configuration) with the provided
parameter. |
boolean |
onNavigationItemSelected(android.view.MenuItem item)
Handle navigation items the user selects.
|
protected void |
onPostCreate(android.os.Bundle savedInstanceState)
Also syncs the state of
mDrawerToggle |
void |
onStop()
This ensures that we are canceling all network requests if the user is leaving this activity.
|
void |
setContentView(int layoutResID)
Create the drawer from
R.layout#activity_drawer , which has parent with ID
R.id#drawer_frame . |
protected DrawerLayout fullLayout
protected android.widget.FrameLayout frameLayout
protected DrawerLayout mDrawerLayout
protected ActionBarDrawerToggle mDrawerToggle
protected android.util.SparseArray<com.culturemesh.android.models.Network> subscribedNetworks
User
's current Network
sprotected java.util.Set<java.lang.Long> subscribedNetworkIds
Network
s the current User
is subscribed toNavigationView navView
protected long currentUser
User
protected Toolbar mToolbar
android.app.Activity thisActivity
RequestQueue queue
public void setContentView(int layoutResID)
R.layout#activity_drawer
, which has parent with ID
R.id#drawer_frame
. Populate the drawer with data from the current User
and their Network
s.layoutResID
- ID for the layout file to inflateprotected void onPostCreate(android.os.Bundle savedInstanceState)
mDrawerToggle
savedInstanceState
- public void onConfigurationChanged(android.content.res.Configuration newConfig)
DrawerActivity#mDrawerToggle#onConfigurationChanged(Configuration)
with the provided
parameter.newConfig
- public boolean onNavigationItemSelected(android.view.MenuItem item)
Network
, they are sent
to TimelineActivity
after the selected network is set as their chosen one. Otherwise,
the appropriate activity is launched based on the option they select.item
- Item the user selected.true
public void onStop()
public void fetchNetworks()