ViewProfileActivity

public class ViewProfileActivity extends AppCompatActivity

Displays the profile of a user other than the currently-logged-in one

Fields

SELECTED_USER

public static final String SELECTED_USER

Key for extra in android.content.Intents that specifies the user whose profile is to be displayed. This should be included in the intent that launches this activity.

loadingOverlay

FrameLayout loadingOverlay

mTabLayout

TabLayout mTabLayout

Handles the tabs available in the interface and serves as the framework on which the rest of the UI elements are arranged.

mViewPager

ViewPager mViewPager

Manages the variety of lists that could be displayed: networks, posts, and events

profilePic

ImageView profilePic

Field for the displayed profile’s photo

queue

RequestQueue queue

Queue for asynchronous tasks

selUser

long selUser

ID of the User whose profile to display

userName

TextView userName

Text fields for the displayed profile’s display name, bio, and name

Methods

onCreate

protected void onCreate(Bundle savedInstanceState)

Setup the user interface using the layout defined in R.layout.activity_view_profile and configure the various tabs. Initialize instance fields with the elements of the android.view.View created from the layout and fill the UI fields with the content of the profile using API.Get.user(RequestQueue,long,Response.Listener)

Parameters:

onStop

public void onStop()

This ensures that we are canceling all network requests if the user is leaving this activity. We use a RequestFilter that accepts all requests (meaning it cancels all requests)

onSupportNavigateUp

public boolean onSupportNavigateUp()

This allows the user to hit the back button on the toolbar to go to the previous activity.

Returns:Always true