diff options
author | Parménides GV <parmegv@sdf.org> | 2013-06-19 19:05:12 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-06-19 19:05:12 +0200 |
commit | d475ae617d8dc0994a1294be7c8cca338a68fd9e (patch) | |
tree | e024cddb5d030ac423f321b8293449afe094e6cb /src/se/leap/leapclient/LogInDialog.java | |
parent | bffd21a326bcb86d814dd3fe2caf5295ea705f2d (diff) |
First round of comments.
This resolves the first step from issue #2908.
Next step: Put user message strings into an appropiate place.
Diffstat (limited to 'src/se/leap/leapclient/LogInDialog.java')
-rw-r--r-- | src/se/leap/leapclient/LogInDialog.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/se/leap/leapclient/LogInDialog.java b/src/se/leap/leapclient/LogInDialog.java index c20413d7..00429d10 100644 --- a/src/se/leap/leapclient/LogInDialog.java +++ b/src/se/leap/leapclient/LogInDialog.java @@ -11,6 +11,16 @@ import android.view.View; import android.widget.EditText; import android.widget.Toast; +/** + * Implements the log in dialog, currently without progress dialog. + * + * It returns to the previous fragment when finished, and sends username and password to the authenticate method. + * + * It also notifies the user if the password is not valid. + * + * @author parmegv + * + */ public class LogInDialog extends DialogFragment { public AlertDialog onCreateDialog(Bundle savedInstanceState) { @@ -43,16 +53,35 @@ public class LogInDialog extends DialogFragment { return builder.create(); } - boolean wellFormedPassword(String entered_password) { + /** + * Validates a password + * @param entered_password + * @return true if the entered password length is greater or equal to eight (8). + */ + private boolean wellFormedPassword(String entered_password) { return entered_password.length() >= 8; } + /** + * Interface used to communicate LogInDialog with Dashboard. + * + * @author parmegv + * + */ public interface LogInDialogInterface { + /** + * Starts authentication process. + * @param username + * @param password + */ public void authenticate(String username, String password); } LogInDialogInterface interface_with_Dashboard; + /** + * @return a new instance of this DialogFragment. + */ public static DialogFragment newInstance() { LogInDialog dialog_fragment = new LogInDialog(); return dialog_fragment; |