一键登录按键后端配

This commit is contained in:
oujunhui
2020-05-13 16:02:20 +08:00
parent c2f244e618
commit ee6f6b80a1
4 changed files with 17 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ public abstract class BaseLoginAct extends BaseActivity {
protected TextView tvProtocol; protected TextView tvProtocol;
protected TextView wxLogin; protected TextView wxLogin;
protected TextView qqLogin; protected TextView qqLogin;
protected TextView tvLoginQuickPass;
protected TextView tvLoginTip; protected TextView tvLoginTip;
protected TextView tvDesc; protected TextView tvDesc;
@@ -104,19 +105,20 @@ public abstract class BaseLoginAct extends BaseActivity {
showTvDesc(loginTipsInfo.getTips()); showTvDesc(loginTipsInfo.getTips());
showTvLoginTip(loginTipsInfo.isShowWechat() || loginTipsInfo.isShowQq()); showTvLoginTip(loginTipsInfo.isShowWechat() || loginTipsInfo.isShowQq());
showThirdPartLogin(loginTipsInfo.isShowWechat(), loginTipsInfo.isShowQq()); showThirdPartLogin(loginTipsInfo.isShowWechat(), loginTipsInfo.isShowQq(),loginTipsInfo.isShowOneClick());
} else { } else {
showTvLoginTip(false); showTvLoginTip(false);
showThirdPartLogin(false, false); showThirdPartLogin(false, false,false);
} }
} }
}); });
} }
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq) { protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq,boolean isShowOneClick) {
showwxLogin(isShowWechat); showwxLogin(isShowWechat);
showqqLogin(isShowQq); showqqLogin(isShowQq);
showOneClickLogin(isShowOneClick);
} }
private void showTvLoginTip(boolean visible) { private void showTvLoginTip(boolean visible) {
@@ -137,6 +139,12 @@ public abstract class BaseLoginAct extends BaseActivity {
} }
} }
private void showOneClickLogin(boolean visible) {
if (tvLoginQuickPass != null) {
tvLoginQuickPass.setVisibility(visible ? View.VISIBLE : View.GONE);
}
}
private void showTvDesc(String tips) { private void showTvDesc(String tips) {
if (tvDesc != null && !TextUtils.isEmpty(tips)) { if (tvDesc != null && !TextUtils.isEmpty(tips)) {
SpannableStringBuilder builder = new SpannableStringBuilder(tips); SpannableStringBuilder builder = new SpannableStringBuilder(tips);

View File

@@ -112,6 +112,7 @@ public class LoginActivity extends BaseLoginAct implements View.OnClickListener
wxLogin = findViewById(R.id.img_wx_login); wxLogin = findViewById(R.id.img_wx_login);
qqLogin = findViewById(R.id.img_qq_login); qqLogin = findViewById(R.id.img_qq_login);
tvLoginTip = findViewById(R.id.tv_login_tip); tvLoginTip = findViewById(R.id.tv_login_tip);
tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass);
codeEditText = findViewById(R.id.et_code); codeEditText = findViewById(R.id.et_code);
getCodeButton = findViewById(R.id.btn_get_code); getCodeButton = findViewById(R.id.btn_get_code);
tvDesc = findViewById(R.id.tv_desc); tvDesc = findViewById(R.id.tv_desc);

View File

@@ -98,6 +98,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass); tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass);
tvProtocol = findViewById(R.id.tv_protocol); tvProtocol = findViewById(R.id.tv_protocol);
wxLogin = findViewById(R.id.img_wx_login); wxLogin = findViewById(R.id.img_wx_login);
tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass);
qqLogin = findViewById(R.id.img_qq_login); qqLogin = findViewById(R.id.img_qq_login);
tvLoginTip = findViewById(R.id.tv_login_tip); tvLoginTip = findViewById(R.id.tv_login_tip);
tvDesc = findViewById(R.id.tv_desc); tvDesc = findViewById(R.id.tv_desc);
@@ -282,10 +283,11 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
} }
@Override @Override
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq) { protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq,boolean isOneClick) {
wxLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE); wxLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE);
qqLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE); qqLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE);
super.showThirdPartLogin(isShowWechat, isShowQq); tvLoginQuickPass.setVisibility(isOneClick?View.VISIBLE:View.INVISIBLE);
super.showThirdPartLogin(isShowWechat, isShowQq,isOneClick);
} }
private void setClickEnable(boolean enable) { private void setClickEnable(boolean enable) {

View File

@@ -7,4 +7,5 @@ public class LoginTipsInfo {
private String tips; private String tips;
private boolean showWechat; private boolean showWechat;
private boolean showQq; private boolean showQq;
private boolean showOneClick;
} }