From 3243f2057e1930d26c8af666c09eaa9ad7612c37 Mon Sep 17 00:00:00 2001 From: Igor Ribeiro Barbosa Duarte Date: Sun, 8 May 2016 23:58:50 -0300 Subject: [PATCH] Issue #29: Creating javadoc comments in LoginActivity class --- .../controller/login_user/LoginActivity.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/src/main/java/com/mathheals/euvou/controller/login_user/LoginActivity.java b/app/src/main/java/com/mathheals/euvou/controller/login_user/LoginActivity.java index ac5f813..ab1af40 100644 --- a/app/src/main/java/com/mathheals/euvou/controller/login_user/LoginActivity.java +++ b/app/src/main/java/com/mathheals/euvou/controller/login_user/LoginActivity.java @@ -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; @@ -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. @@ -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 @@ -79,6 +100,9 @@ public boolean onOptionsItemSelected(MenuItem menuItem) { return super.onOptionsItemSelected(menuItem); } + /** + * Set resources of the Action Bar + */ private void onConfigActionBar(){ actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); @@ -86,6 +110,10 @@ private void onConfigActionBar(){ 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;