public class TimelineActivity extends DrawerActivity implements DrawerActivity.WaitForSubscribedList
Post
s and
Event
s for the currently selected
Network
Modifier and Type | Class and Description |
---|---|
static class |
TimelineActivity.FilterDialogFragment
This dialog allows us to filter out native/twitter posts from the feed
|
DrawerActivity.WaitForSubscribedList
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
BUNDLE_NETWORK
The tag for showing that we're passing in the network to a new activity.
|
private android.view.animation.Animation |
close
Handle the animations for expanding the "create" floating action button into buttons to
create
Post s and
Event s (open) and performing the reverse (close) |
private FloatingActionButton |
create
Floating buttons that allow users to create posts and events
|
private FloatingActionButton |
createEvent
Floating buttons that allow users to create posts and events
|
private FloatingActionButton |
createPost
Floating buttons that allow users to create posts and events
|
(package private) static java.lang.String |
FILTER_CHOICE_EVENTS
The key in SharedPreferences for determining whether to display events in the feed.
|
(package private) static java.lang.String |
FILTER_CHOICE_NATIVE
The key in SharedPreferences for determining whether to display posts in the feed.
|
(package private) java.lang.String |
FILTER_LABEL
The tag for FragmentManager to know we're opening the filter dialog.
|
private android.widget.TextView |
fromLocation
Text fields to display information about the displayed
Network |
private boolean |
isFABOpen
Whether or not the floating action button is expanded into separate buttons
|
(package private) android.widget.Button |
joinNetwork
The button that is shown if the user isn't subscribed to thus network.
|
private android.widget.FrameLayout |
loadingOverlay |
private android.widget.RelativeLayout |
loadingPanel |
private android.widget.TextView |
nearLocation
Text fields to display information about the displayed
Network |
private android.view.animation.Animation |
open
Handle the animations for expanding the "create" floating action button into buttons to
create
Post s and
Event s (open) and performing the reverse (close) |
private android.widget.TextView |
population
Text fields to display information about the displayed
Network |
private RecyclerView |
postsRV
Scrollable list of
Post s and
Event s in the feed |
private RequestQueue |
queue
Queue for asynchronous tasks
|
private long |
selectedNetwork
ID of the selected
Network |
(package private) static android.content.SharedPreferences |
settings
The app's preferences
|
private SwipeRefreshLayout |
swipeRefreshLayout
The small circle with the arrow in the center that rotates down from the top of the view
if the user swipes down.
|
currentUser, frameLayout, fullLayout, mDrawerLayout, mDrawerToggle, mToolbar, navView, subscribedNetworkIds, subscribedNetworks, thisActivity
Constructor and Description |
---|
TimelineActivity() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
animateFAB()
This function controls the animation for the FloatingActionButtons.
|
protected void |
createDefaultNetwork()
Use API methods to fetch details of the user's selected network.
|
protected void |
createNoNetwork()
If the user has no selected network, direct them to
ExploreBubblesOpenGLActivity |
void |
onBackPressed()
Handle the back button being pressed.
|
protected void |
onCreate(android.os.Bundle savedInstanceState)
Setup user interface using layout defined in
R.layout#activity_timeline and
initialize instance fields with that layout's fields (elements) |
boolean |
onCreateOptionsMenu(android.view.Menu menu)
Inflate
menu from R.menu#timeline |
boolean |
onOptionsItemSelected(android.view.MenuItem item) |
protected void |
onStart()
Check if user has selected a network to view, regardless of whether the user is subscribed
to any networks yet.
|
void |
onSubscribeListFinish()
If the user is subscribed to the network, they are able to write posts and events.
|
void |
onSwipeRefresh()
Restart activity to refresh the feed
|
fetchNetworks, onConfigurationChanged, onNavigationItemSelected, onPostCreate, onStop, setContentView
final java.lang.String FILTER_LABEL
static final java.lang.String FILTER_CHOICE_NATIVE
static final java.lang.String FILTER_CHOICE_EVENTS
static final java.lang.String BUNDLE_NETWORK
static android.content.SharedPreferences settings
private FloatingActionButton create
private FloatingActionButton createPost
private FloatingActionButton createEvent
private SwipeRefreshLayout swipeRefreshLayout
private RecyclerView postsRV
Post
s and
Event
s in the feedprivate android.view.animation.Animation open
Post
s and
Event
s (open) and performing the reverse (close)private android.view.animation.Animation close
Post
s and
Event
s (open) and performing the reverse (close)private boolean isFABOpen
private android.widget.TextView population
Network
private android.widget.TextView fromLocation
Network
private android.widget.TextView nearLocation
Network
private RequestQueue queue
android.widget.Button joinNetwork
private long selectedNetwork
Network
private android.widget.RelativeLayout loadingPanel
private android.widget.FrameLayout loadingOverlay
protected void onCreate(android.os.Bundle savedInstanceState)
R.layout#activity_timeline
and
initialize instance fields with that layout's fields (elements)savedInstanceState
- protected void createNoNetwork()
ExploreBubblesOpenGLActivity
protected void createDefaultNetwork()
public void onSwipeRefresh()
protected void onStart()
DrawerActivity#onStart()
public void onBackPressed()
public boolean onCreateOptionsMenu(android.view.Menu menu)
menu
from R.menu#timeline
menu
- Menu
to inflatetrue
public boolean onOptionsItemSelected(android.view.MenuItem item)
item
- item
is selected or if it has the same ID as R.id#action_settings
,
return true
. Otherwise, return the result of
DrawerActivity#onOptionsItemSelected(MenuItem)
with parameter item
public void onSubscribeListFinish()
onSubscribeListFinish
in interface DrawerActivity.WaitForSubscribedList
void animateFAB()