use of butterknife.OnEditorAction in project run-wallet-android by runplay.
the class PasswordLoginFragment method onEditorAction.
@OnEditorAction(R.id.password_login)
public boolean onEditorAction(int actionId, KeyEvent event) {
if ((actionId == EditorInfo.IME_ACTION_DONE) || ((event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))) {
login(true);
} else {
SharedPreferences prefs = android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
int pl = prefs.getInt(Constants.PREFERENCE_PASS_LENGTH, 0);
if (pl > 0 && textInputEditTextPassword.getText().toString().length() == pl) {
login(false);
}
}
return true;
}
Aggregations