This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Perform the login, provided {@link #hasErrors()} returns false | |
*/ | |
private void doLogin() { | |
if (!hasErrors()) { | |
listener.onFinishLoginDialog(username.getText().toString(), | |
password.getText().toString()); | |
this.dismiss(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, | |
int after) {} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, | |
int count) {} | |
/** | |
* If the user receives an error message due to a blank field, this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* These TextWatchers are used to clear the error icons | |
* automatically once the user has remedied an error | |
*/ | |
username.addTextChangedListener(this); | |
password.addTextChangedListener(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We have to override setOnShowListener here (min API level 8) in | |
* order to validate the inputs before closing the dialog. Just | |
* overriding setPositiveButton closes the automatically when the | |
* button is pressed | |
* | |
* @return The onShowListener for the AlertDialog | |
*/ | |
@Override | |
public void onShow(DialogInterface dialog) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginDialogFragment extends DialogFragment implements | |
OnEditorActionListener, TextWatcher, OnShowListener { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Perform the login if the user presses the Done key from the | |
* password field | |
*/ | |
@Override | |
public boolean onEditorAction(TextView v, int actionId, | |
KeyEvent event) { | |
if (actionId == EditorInfo.IME_ACTION_DONE) { | |
doLogin(); | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
password.setOnEditorActionListener(this); |
NewerOlder