Android Open Source - spots User Detail Activity






From Project

Back to project page spots.

License

The source code is released under:

MIT License

If you think the Android project spots listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.dcc.matc89.spots.activity;
/*w w w.  j  av a2  s  . com*/
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.dcc.matc89.spots.R;
import com.dcc.matc89.spots.model.User;

public class UserDetailActivity extends ActionBarActivity {

  public static final String USER_KEY = "userkey";
  
  private ImageView mProfilePicture;
  private TextView mName;
  private TextView mLocation;
  private TextView mGroupsAmount;
  private User mUser;
  private View mGroupsButton;
  
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile_main);
    setupActionBar();
    
    mProfilePicture = (ImageView) findViewById(R.id.profile_picture);
    mName = (TextView) findViewById(R.id.name);
    mLocation = (TextView) findViewById(R.id.location);
    mGroupsAmount = (TextView) findViewById(R.id.groups_text);
    mGroupsButton = findViewById(R.id.groups_button);
    
    mUser = (User) getIntent().getSerializableExtra(USER_KEY);
    
    // TODO Grab Profile pic from facebook or Google Plus
    mProfilePicture.setImageDrawable(getResources().getDrawable(R.drawable.ic_contact_picture_2));
    mName.setText(mUser.getName());
    mLocation.setText(mUser.getLocation());
    mGroupsAmount.setText(String.valueOf(mUser.getGroups().size()));
    mGroupsButton.setOnClickListener(onGroupClicked);
  }
  
  private OnClickListener onGroupClicked = new OnClickListener() {

    @Override
    public void onClick(View v) {
      Intent i = new Intent(UserDetailActivity.this, GroupListActivity.class);
      i.putExtra(GroupListActivity.USER_KEY, mUser);
      startActivity(i);
    }
    
  };
  
  /**
   * Set up the {@link android.app.ActionBar}.
   */
  private void setupActionBar() {
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }

}




Java Source Code List

com.dcc.matc89.spots.activity.GroupDetailActivity.java
com.dcc.matc89.spots.activity.GroupEditActivity.java
com.dcc.matc89.spots.activity.GroupListActivity.java
com.dcc.matc89.spots.activity.LoginActionBarActivity.java
com.dcc.matc89.spots.activity.LoginActivity.java
com.dcc.matc89.spots.activity.MainActivity.java
com.dcc.matc89.spots.activity.MyGroupsListActivity.java
com.dcc.matc89.spots.activity.SpotDetailActivity.java
com.dcc.matc89.spots.activity.SpotEditActivity.java
com.dcc.matc89.spots.activity.SpotListActivity.java
com.dcc.matc89.spots.activity.UserDetailActivity.java
com.dcc.matc89.spots.activity.UserListActivity.java
com.dcc.matc89.spots.model.Group.java
com.dcc.matc89.spots.model.Sport.java
com.dcc.matc89.spots.model.Spot.java
com.dcc.matc89.spots.model.StaticDatabase.java
com.dcc.matc89.spots.model.User.java
com.dcc.matc89.spots.network.FetchGroupsAsyncTask.java
com.dcc.matc89.spots.network.FetchGroups.java
com.dcc.matc89.spots.network.FetchSportsAsyncTask.java
com.dcc.matc89.spots.network.FetchSports.java
com.dcc.matc89.spots.network.FetchSpotsAsyncTask.java
com.dcc.matc89.spots.network.FetchSpots.java
com.dcc.matc89.spots.network.FetchUsersAsyncTask.java
com.dcc.matc89.spots.network.FetchUsers.java
com.dcc.matc89.spots.network.OnResultReceiver.java
com.dcc.matc89.spots.network.PostGroupsAsyncTask.java
com.dcc.matc89.spots.network.PostGroups.java
com.dcc.matc89.spots.network.PostLinkSpotGroupAsyncTask.java
com.dcc.matc89.spots.network.PostLinkSpotGroup.java
com.dcc.matc89.spots.network.PostSpotsAsyncTask.java
com.dcc.matc89.spots.network.PostSpots.java
com.dcc.matc89.spots.network.PostUsersAsyncTask.java
com.dcc.matc89.spots.network.PostUsers.java
com.dcc.matc89.spots.network.Utils.java
com.dcc.matc89.spots.social.FacebookFragment.java
com.dcc.matc89.spots.social.LoginFragment.java
com.dcc.matc89.spots.social.OnUserLoginListener.java
com.dcc.matc89.spots.view.CheckboxesDropdownView.java
com.dcc.matc89.spots.view.DropdownView.java