Skip to content

Commit

Permalink
Issue #29: Creating javadoc comments in LoginActivity class
Browse files Browse the repository at this point in the history
  • Loading branch information
igorribeiroduarte committed May 9, 2016
1 parent 1c687a6 commit 3243f20
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
private boolean isPasswordValid;
private ActionBar actionBar;

/**
* Calls the parent onCreate to setup the activity view that contains this fragment and
* loads the XML layouts used in the activity
* @param savedInstanceState - If the activity is being re-initialized after previously being
* shut down then this Bundle contains the data it most recently
* supplied in
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
assert savedInstanceState != null;
Expand All @@ -44,11 +51,20 @@ protected void onCreate(Bundle savedInstanceState) {
onConfigActionBar();
}

/**
* Initialize the ActionBar used in the activity
*/
private void initViews(){
actionBar = getSupportActionBar();
}


/**
* Initialize the contents of the Activity's standard options menu
* @param menu - The options menu in which the items will be placed
* @return boolean - You must return true for the menu to be displayed;
* if you return false it will not be shown
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand All @@ -59,6 +75,11 @@ public boolean onCreateOptionsMenu(Menu menu) {
return true;
}

/**
* This method is called whenever an item in the options menu is selected
* @param menuItem - The menu item that was selected
* @return boolean - Return false to allow normal menu processing to proceed, true to consume it here
*/
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
// Handle action bar menuItem clicks here. The action bar will
Expand All @@ -79,13 +100,20 @@ public boolean onOptionsItemSelected(MenuItem menuItem) {
return super.onOptionsItemSelected(menuItem);
}

/**
* Set resources of the Action Bar
*/
private void onConfigActionBar(){
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.ic_drawer);
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#008B8B")));
}

/**
* Do the login of the user when the login button has been clicked
* @param v - The view of the button that was clicked
*/
@Override
public void onClick(View v) {
assert v != null;
Expand Down

0 comments on commit 3243f20

Please sign in to comment.