Skip to content

Instantly share code, notes, and snippets.

/**
* Perform the login, provided {@link #hasErrors()} returns false
*/
private void doLogin() {
if (!hasErrors()) {
listener.onFinishLoginDialog(username.getText().toString(),
password.getText().toString());
this.dismiss();
}
/**
* Returns true if the username and password pass validation.
*
* @return False if the username or password is blank
*/
private boolean hasErrors() {
boolean hasErrors = false;
Drawable errorIcon = getErrorDrawable();
String errorText = null;
if (username.getText().length() == 0) {
@antew
antew / LoginDialogFragment.java
Created February 17, 2013 20:36
getErrorDrawable
/**
* Returns an error icon for use with
* {@link EditText#setError(CharSequence)}
*
* @return A {@link Drawable} of the error icon
*/
public Drawable getErrorDrawable() {
Resources r = getActivity().getResources();
Drawable drawable
= r.getDrawable(R.drawable.custom_indicator_input_error);
benchmark_1 | Cloning into './test'...
benchmark_1 | Branch getting-running set up to track remote branch getting-running from origin.
benchmark_1 | Switched to a new branch 'getting-running'
benchmark_1 | Starting run for repo: https://github.com/joefiorini/flittal.git
benchmark_1 | Original elm-make
benchmark_1 | Success! Compiled 91 modules.
benchmark_1 | Successfully generated index.html
benchmark_1 | 104,028,098,272 bytes allocated in the heap
benchmark_1 | 3,109,829,544 bytes copied during GC
benchmark_1 | 45,512,368 bytes maximum residency (259 sample(s))