Group Buying App5 in imitation of handles -- logon interface, Group Buying app5 -- logon Interface
Activity_login.xml
<? Xml version = "1.0" encoding = "UTF-8"?> <LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android: layout_width = "match_parent" android: layout_height = "match_parent" android: orientation = "vertical" tools: context = "com. myxh. coolshopping. ui. activity. loginActivity "> <RelativeLayout android: layout_width =" match_parent "android: layout_height =" @ dimen/common_titleBar_height "android: background =" @ color/title_bar_color "> <ImageView android: id = "@ + id/login_titleBar_iv_back"> case R. id. login_quick_login_btn_getCode: mPhoneNumber = mQuickLoginEtPhoneNumber. getText (). toString (); if (LoginHelperUtil. isPhoneNumber (mPhoneNumber) {BmobManager. getInstance (new BmobMsgSendCallback () {@ Override public void onMsgSendSuccess () {ToastUtil. show (LoginActivity. this, R. string. sms_code_send_success); // The verification code is successfully sent. The countdown setCodeTimeDown () ;}@ Override public void onMsgSendFailure () {ToastUtil. show (LoginActivity. this, R. string. sms_code_send_failure );}}). sendMsgCode (mPhoneNumber);} else {ToastUtil. show (this, R. string. phone_number_incorrect);} break; case R. id. login_quick_login_btn: mPhoneNumber = mQuickLoginEtPhoneNumber. getText (). toString (); String code = mQuickLoginEtCode. getText (). toString (); if (LoginHelperUtil. isCodeCorrect (code) & LoginHelperUtil. isPhoneNumber (mPhoneNumber) {BmobManager. getInstance (new BmobLoginCallback () {@ Override public void onLoginSuccess () {Log. I (TAG, "onLoginSuccess: Login successful"); ToastUtil. show (LoginActivity. this, R. string. login_success) ;}@ Override public void onLoginFailure () {Log. I (TAG, "onLoginFailure: Logon Failed"); ToastUtil. show (LoginActivity. this, R. string. login_failed );}}). signOrLoginByMsgCode (mPhoneNumber, code);} else {ToastUtil. showLong (this, R. string. quick_login_input_incorrect);} break;
Account Logon (logon and password switching in plaintext)
AccountLoginCheckBox. setOnCheckedChangeListener (new CompoundButton. onCheckedChangeListener () {@ Override public void onCheckedChanged (CompoundButton compoundButton, boolean checked) {// switch the plaintext if (checked) {mAccountLoginEtPassword. setTransformationMethod (HideReturnsTransformationMethod. getInstance ();} else {mAccountLoginEtPassword. setTransformationMethod (PasswordTransformationMethod. getInstance ();} // mAccountLoginEtPassword is displayed at the end of the cursor. setSelection (mAccountLoginEtPassword. length ());}});
case R.id.login_account_login_btn: String username = mAccountLoginEtUsername.getText().toString(); String password = mAccountLoginEtPassword.getText().toString(); if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) { BmobManager.getInstance(new BmobLoginCallback() { @Override public void onLoginSuccess() { ToastUtil.show(LoginActivity.this,R.string.login_success); Intent data = new Intent(); setResult(LOGIN_RESULT_CODE,data); finish(); } @Override public void onLoginFailure() { ToastUtil.show(LoginActivity.this,R.string.login_failed); } }).login(username,password); } else { ToastUtil.show(this,R.string.login_input_empty); } break;