Group Buying App5 in imitation of handles -- logon interface, Group Buying app5 -- logon Interface

Source: Internet
Author: User

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;

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.