feat:调整登录页UI(仅UI),移除易盾一键登录SDK
This commit is contained in:
@@ -269,9 +269,6 @@ dependencies {
|
||||
|
||||
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
|
||||
|
||||
// 易盾一键登录
|
||||
implementation 'io.github.yidun:quicklogin:3.1.5'
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
//华为推送
|
||||
implementation 'com.huawei.hms:push:6.5.0.300'
|
||||
|
@@ -1,14 +1,10 @@
|
||||
package com.nnbc123.app.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
@@ -22,24 +18,15 @@ import com.nnbc123.app.common.widget.OriginalDrawStatusClickSpan;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.core.UriProvider;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.bean.LoginTipsInfo;
|
||||
import com.nnbc123.core.market_verify.MarketVerifyModel;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
|
||||
public abstract class BaseLoginAct extends BaseActivity {
|
||||
|
||||
protected CheckBox tvProtocol;
|
||||
protected TextView wxLogin;
|
||||
protected TextView qqLogin;
|
||||
protected TextView tvLoginQuickPass;
|
||||
protected TextView tvLoginTip;
|
||||
protected TextView tvDesc;
|
||||
|
||||
protected boolean canClick = true;
|
||||
|
||||
@@ -92,82 +79,6 @@ public abstract class BaseLoginAct extends BaseActivity {
|
||||
tvProtocol.setMovementMethod(new LinkMovementMethod());
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
protected void showLoginTip() {
|
||||
MarketVerifyModel.get().loadLoginTip()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new BiConsumer<LoginTipsInfo, Throwable>() {
|
||||
@Override
|
||||
public void accept(LoginTipsInfo loginTipsInfo, Throwable throwable) throws Exception {
|
||||
if (throwable == null) {
|
||||
showTvDesc(loginTipsInfo.getTips());
|
||||
showTvLoginTip(loginTipsInfo.isShowWechat() || loginTipsInfo.isShowQq());
|
||||
showThirdPartLogin(loginTipsInfo.isShowWechat(), loginTipsInfo.isShowQq(), loginTipsInfo.isShowOneClick());
|
||||
} else {
|
||||
showTvLoginTip(false);
|
||||
showThirdPartLogin(false, false, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq, boolean isShowOneClick) {
|
||||
showwxLogin(isShowWechat);
|
||||
showqqLogin(isShowQq);
|
||||
showOneClickLogin(isShowOneClick);
|
||||
}
|
||||
|
||||
private void showTvLoginTip(boolean visible) {
|
||||
if (tvLoginTip != null) {
|
||||
tvLoginTip.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showwxLogin(boolean visible) {
|
||||
if (wxLogin != null) {
|
||||
wxLogin.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showqqLogin(boolean visible) {
|
||||
if (qqLogin != null) {
|
||||
qqLogin.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showOneClickLogin(boolean visible) {
|
||||
if (tvLoginQuickPass != null) {
|
||||
tvLoginQuickPass.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void showTvDesc(String tips) {
|
||||
if (tvDesc != null && !TextUtils.isEmpty(tips)) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
int start = tips.indexOf("如何登录");
|
||||
|
||||
if (start > -1) {
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_FE4C62)), start, start + 5, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new OriginalDrawStatusClickSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
CommonWebViewActivity.start(BaseLoginAct.this, UriProvider.WEB_URL + XChatConstants.LOGIN_ERBAN_ACCOUNT_URL);
|
||||
}
|
||||
}, start, start + 5, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
tvDesc.setText(builder);
|
||||
tvDesc.setHighlightColor(Color.TRANSPARENT);
|
||||
tvDesc.setMovementMethod(new LinkMovementMethod());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void wxLogin() {
|
||||
// 易盾保护 token
|
||||
// String yiDunToken = watchman.getToken(XChatConstants.YI_DUN_BUSINESS_ID);
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_last_login.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_last_login.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 950 B |
BIN
app/src/main/res/drawable-xhdpi/ic_login_google.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_login_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_login_line.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_login_line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
6
app/src/main/res/drawable/shape_login_btn_bg.xml
Normal file
6
app/src/main/res/drawable/shape_login_btn_bg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#F3F5FA" />
|
||||
<corners android:radius="@dimen/dp_26"/>
|
||||
</shape>
|
@@ -45,6 +45,7 @@
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -989,4 +989,7 @@
|
||||
<string name="diamond_inning">%d钻/局</string>
|
||||
<string name="permission_denied_tips_mic">为了实现连麦及语音输入等功能,请您允许应用向您获取“麦克风”权限</string>
|
||||
<string name="permission_denied_tips_image">访问你的本地内容,以能正常使用图片上传、视频发送等应用功能</string>
|
||||
<string name="last_login">上次登录</string>
|
||||
<string name="login_line">Line登录</string>
|
||||
<string name="login_google">Google登录</string>
|
||||
</resources>
|
||||
|
@@ -1,107 +0,0 @@
|
||||
package com.nnbc123.app.quick_pass;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.netease.nis.quicklogin.helper.UnifyUiConfig;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.core.PreferencesUtils;
|
||||
|
||||
/**
|
||||
* Created by hzhuqi on 2019/12/31
|
||||
*/
|
||||
public class QuickLoginUiConfig {
|
||||
public static UnifyUiConfig getUiConfig(final Context context) {
|
||||
|
||||
int logoToTop = 60;
|
||||
int logoWidth = 100;
|
||||
int logoHeight = 100;
|
||||
int maskNumToTop = logoToTop + logoHeight + 170;
|
||||
int maskNumSize = 20;
|
||||
int sloganToTop = maskNumToTop + maskNumSize + 10;
|
||||
int sloganSize = 14;
|
||||
int loginBtnToTop = sloganToTop + sloganSize + 30;
|
||||
int loginBtnHeight = 45;
|
||||
|
||||
int X_OFFSET = 0;
|
||||
int BOTTOM_OFFSET = 0;
|
||||
final boolean privacyState = PreferencesUtils.readPrivacyState();
|
||||
UnifyUiConfig uiConfig = new UnifyUiConfig.Builder()
|
||||
// 状态栏
|
||||
.setStatusBarDarkColor(true)
|
||||
.setStatusBarColor(ContextCompat.getColor(context, R.color.bg_normal_1c1b22))
|
||||
.setBackgroundImage("bg_normal")
|
||||
// 设置导航栏
|
||||
.setHideNavigation(false)
|
||||
.setHideNavigationBackIcon(false)
|
||||
.setNavigationIcon("quick_pass_back")
|
||||
.setNavigationHeight(50)
|
||||
.setNavigationBackIconWidth(25)
|
||||
.setNavigationBackIconHeight(25)
|
||||
.setNavigationTitle("一键登录")
|
||||
.setNavigationTitleColor(ContextCompat.getColor(context, R.color.text_normal_282828))
|
||||
// 设置logo
|
||||
.setLogoIconName("quick_pass_logo")
|
||||
.setLogoWidth(logoWidth)
|
||||
.setLogoHeight(logoHeight)
|
||||
.setLogoXOffset(X_OFFSET)
|
||||
.setLogoTopYOffset(logoToTop)
|
||||
.setHideLogo(false)
|
||||
//手机掩码
|
||||
.setMaskNumberColor(ContextCompat.getColor(context, R.color.text_normal_282828))
|
||||
.setMaskNumberSize(maskNumSize)
|
||||
.setMaskNumberXOffset(X_OFFSET)
|
||||
.setMaskNumberTopYOffset(maskNumToTop)
|
||||
.setMaskNumberBottomYOffset(BOTTOM_OFFSET)
|
||||
// 认证品牌
|
||||
.setSloganSize(sloganSize)
|
||||
.setSloganColor(ContextCompat.getColor(context, R.color.text_secondary_878b9c))
|
||||
.setSloganXOffset(X_OFFSET)
|
||||
.setSloganTopYOffset(sloganToTop)
|
||||
.setSloganBottomYOffset(BOTTOM_OFFSET)
|
||||
// 登录按钮
|
||||
.setLoginBtnTextColor(ContextCompat.getColor(context, R.color.text_normal_282828))
|
||||
.setLoginBtnText("本机号码一键登录")
|
||||
.setLoginBtnBackgroundRes("bg_common_confirm")
|
||||
.setLoginBtnWidth(280)
|
||||
.setLoginBtnHeight(loginBtnHeight)
|
||||
.setLoginBtnTextSize(15)
|
||||
.setLoginBtnXOffset(X_OFFSET)
|
||||
.setLoginBtnTopYOffset(loginBtnToTop)
|
||||
.setLoginBtnBottomYOffset(BOTTOM_OFFSET)
|
||||
// 隐私栏
|
||||
.setPrivacyTextStart("登录即代表同意")
|
||||
.setPrivacyTextEnd(context.getString(R.string.authorization_text))
|
||||
.setPrivacyTextColor(ContextCompat.getColor(context, R.color.text_secondary_878b9c))
|
||||
.setPrivacyProtocolColor(ContextCompat.getColor(context, R.color.app_248cfe))
|
||||
.setHidePrivacyCheckBox(false)
|
||||
|
||||
/**
|
||||
* offset只是设置左侧的间距,无法左右居中,易盾并没有提供左右居中的api;
|
||||
* 通过更改yd_quick_login_privacy.xml实现(文件在quicklogin_libary-external-release.aar)
|
||||
*/
|
||||
// .setPrivacyXOffset(43)
|
||||
|
||||
.setPrivacyState(privacyState)
|
||||
.setPrivacySize(12)
|
||||
// .setPrivacyTopYOffset(510)
|
||||
.setPrivacyBottomYOffset(20)
|
||||
.setPrivacyMarginLeft(20)
|
||||
.setPrivacyMarginRight(20)
|
||||
.setCheckedImageName("quick_pass_checked")
|
||||
.setUnCheckedImageName("quick_pass_uncheck")
|
||||
// 协议详情页导航栏
|
||||
.setProtocolPageNavTitle("服务条款")
|
||||
.setProtocolPageNavBackIcon("quick_pass_back")
|
||||
.setProtocolPageNavColor(Color.WHITE)
|
||||
.setClickEventListener((viewType, code) -> {
|
||||
if (viewType == 2) {
|
||||
PreferencesUtils.savePrivacyState(code == 1);
|
||||
}
|
||||
})
|
||||
.build(context);
|
||||
return uiConfig;
|
||||
}
|
||||
}
|
@@ -14,14 +14,10 @@ import android.widget.TextView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nis.quicklogin.QuickLogin;
|
||||
import com.netease.nis.quicklogin.listener.QuickLoginPreMobileListener;
|
||||
import com.netease.nis.quicklogin.listener.QuickLoginTokenListener;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.base.BaseLoginAct;
|
||||
import com.nnbc123.app.ui.login.LoginPasswordActivity;
|
||||
import com.nnbc123.app.ui.login.LoginPhoneActivity;
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants;
|
||||
import com.nnbc123.core.DemoCache;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.auth.event.LoginEvent;
|
||||
@@ -30,6 +26,7 @@ import com.nnbc123.core.auth.exception.BanAccountException;
|
||||
import com.nnbc123.core.auth.exception.IsSuperAdminException;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -40,21 +37,12 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListener {
|
||||
|
||||
|
||||
private static final String NEED_CHECKED_PROTOCOL = "need_checked_protocol";
|
||||
|
||||
private static final int quickPassRequestCode = 1000;
|
||||
|
||||
private TextView tvLoginQuickPass;
|
||||
private QuickLogin login;// BUSINESS_ID为从易盾官网申请的业务id
|
||||
|
||||
private TextView phoneLogin;
|
||||
|
||||
private TextView tvProtocolHint;
|
||||
|
||||
public static void start(Context context) {
|
||||
@@ -67,31 +55,22 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.act_quick_pass);
|
||||
EventBus.getDefault().register(this);
|
||||
login = QuickLogin.getInstance(getApplicationContext(), XChatConstants.QUICK_PASS_BUSINESS_ID);// BUSINESS_ID为从易盾官网申请的业务id
|
||||
login.setUnifyUiConfig(QuickLoginUiConfig.getUiConfig(getApplicationContext()));
|
||||
|
||||
onFindViews();
|
||||
onSetListener();
|
||||
showLoginTip();
|
||||
AuthModel.get().isFromLogin = true;
|
||||
}
|
||||
|
||||
private void onFindViews() {
|
||||
tvProtocol = findViewById(R.id.tv_protocol);
|
||||
tvProtocolHint = findViewById(R.id.tv_protocol_hint);
|
||||
wxLogin = findViewById(R.id.img_wx_login);
|
||||
tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass);
|
||||
qqLogin = findViewById(R.id.img_qq_login);
|
||||
tvDesc = findViewById(R.id.tv_desc);
|
||||
phoneLogin = findViewById(R.id.img_phone_login);
|
||||
setProtocol();
|
||||
}
|
||||
|
||||
private void onSetListener() {
|
||||
wxLogin.setOnClickListener(this);
|
||||
qqLogin.setOnClickListener(this);
|
||||
tvLoginQuickPass.setOnClickListener(this);
|
||||
phoneLogin.setOnClickListener(this);
|
||||
findViewById(R.id.cs_google).setOnClickListener(this);
|
||||
findViewById(R.id.cs_line).setOnClickListener(this);
|
||||
findViewById(R.id.tv_password_login).setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,26 +95,16 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
return;
|
||||
}
|
||||
switch (v.getId()) {
|
||||
case R.id.img_wx_login:
|
||||
wxLogin();
|
||||
case R.id.tv_password_login:
|
||||
LoginPasswordActivity.start(QuickPassLoginAct.this);
|
||||
break;
|
||||
|
||||
case R.id.img_qq_login:
|
||||
qqLogin();
|
||||
case R.id.cs_google:
|
||||
SingleToastUtil.showToast("Google");
|
||||
break;
|
||||
|
||||
case R.id.tv_login_quick_pass:
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_ONE_CLICK_LOGIN, "一键登录");
|
||||
preFetchMobileNum();
|
||||
break;
|
||||
case R.id.img_phone_login:
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_ONE_CLICK_LOGIN_CHANGE_ID, "一键登录-切换账号");
|
||||
LoginPhoneActivity.start(QuickPassLoginAct.this);
|
||||
case R.id.cs_line:
|
||||
SingleToastUtil.showToast("Line");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,81 +119,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
return true;
|
||||
}
|
||||
|
||||
private void preFetchMobileNum() {
|
||||
getDialogManager().showProgressDialog(this, "");
|
||||
login.prefetchMobileNumber(new QuickLoginPreMobileListener() {
|
||||
@Override
|
||||
public void onGetMobileNumberSuccess(String YDToken, final String mobileNumber) {
|
||||
// 注:对于3网UI统一版本SDK,即2.0.0及以后版本,直接在该回调中调用取号接口onePass即可
|
||||
getDialogManager().dismissDialog();
|
||||
onePass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetMobileNumberError(String YDToken, final String msg) {
|
||||
|
||||
toast("一键登录失败,请使用其他方式登录");
|
||||
getDialogManager().dismissDialog();
|
||||
//跳转到手机登录页
|
||||
LoginPhoneActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void onePass() {
|
||||
// 易盾保护 token 登录
|
||||
// String yiDunLoginToken = watchman.getToken(XChatConstants.YI_DUN_LOGIN_BUSINESS_ID);
|
||||
// 数美天网 deviceId
|
||||
// String shuMeiDeviceId = SmAntiFraud.getDeviceId();
|
||||
login.onePass(new QuickLoginTokenListener() {
|
||||
@Override
|
||||
public void onGetTokenSuccess(String s, String s1) {
|
||||
setClickEnable(false);
|
||||
AuthModel.get().quickPassLogin(s, s1, "", "")
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
if (mCompositeDisposable != null) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
setClickEnable(false);
|
||||
login.quitActivity();
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_ONE_CLICK_LOGIN_SUCCEED, "一键登录成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dealWithLoginError(e);
|
||||
setClickEnable(true);
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_ONE_CLICK_LOGIN_FAILED, "一键登录失败");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetTokenError(String s, String s1) {
|
||||
toast("一键登录失败,请使用其他登录方式");
|
||||
LoginPhoneActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
|
||||
setClickEnable(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelGetToken() {
|
||||
super.onCancelGetToken();
|
||||
setClickEnable(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dealWithLoginError(Throwable e) {
|
||||
if (!(e instanceof IsSuperAdminException)) {
|
||||
@@ -290,44 +184,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq, boolean isOneClick) {
|
||||
wxLogin.setVisibility(isShowWechat ? View.VISIBLE : View.INVISIBLE);
|
||||
qqLogin.setVisibility(isShowQq ? View.VISIBLE : View.INVISIBLE);
|
||||
|
||||
if (isOneClick){
|
||||
login.prefetchMobileNumber(new QuickLoginPreMobileListener() {
|
||||
@Override
|
||||
public void onGetMobileNumberSuccess(String YDToken, final String mobileNumber) {
|
||||
tvLoginQuickPass.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetMobileNumberError(String YDToken, final String msg) {
|
||||
tvLoginQuickPass.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
}else {
|
||||
tvLoginQuickPass.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
super.showThirdPartLogin(isShowWechat, isShowQq, isOneClick);
|
||||
}
|
||||
|
||||
private void setClickEnable(boolean enable) {
|
||||
if (tvLoginQuickPass != null) {
|
||||
tvLoginQuickPass.setEnabled(enable);
|
||||
}
|
||||
if (wxLogin != null) {
|
||||
wxLogin.setEnabled(enable);
|
||||
}
|
||||
if (qqLogin != null) {
|
||||
qqLogin.setEnabled(enable);
|
||||
}
|
||||
// if (phoneLogin != null) {
|
||||
// phoneLogin.setEnabled(enable);
|
||||
// }
|
||||
canClick = enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
@@ -344,15 +200,4 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
private boolean checkProtocol() {
|
||||
|
||||
if (!tvProtocol.isChecked()) {
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -30,36 +30,129 @@
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login_quick_pass"
|
||||
android:layout_width="275dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:text="本机号码一键登录"
|
||||
android:id="@+id/tv_password_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text="密码登录"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:visibility="invisible"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top_guile_line"
|
||||
tools:ignore="SpUsage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_google"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top_guile_line">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_google"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/login_google"
|
||||
android:textColor="#6D6B89"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:src="@drawable/ic_login_google"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_google_last_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:layout_marginEnd="-10dp"
|
||||
android:background="@drawable/bg_last_login"
|
||||
android:gravity="center"
|
||||
android:text="@string/last_login"
|
||||
android:textColor="@color/color_F5F6FA"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cs_google"
|
||||
app:layout_constraintTop_toTopOf="@+id/cs_google"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cs_google">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:gravity="center"
|
||||
android:text="@string/login_line"
|
||||
android:textColor="#6D6B89"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:src="@drawable/ic_login_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_line_last_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-10dp"
|
||||
android:layout_marginEnd="-10dp"
|
||||
android:background="@drawable/bg_last_login"
|
||||
android:gravity="center"
|
||||
android:text="@string/last_login"
|
||||
android:textColor="@color/color_F5F6FA"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/cs_line"
|
||||
app:layout_constraintTop_toTopOf="@+id/cs_line"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tv_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="@dimen/dp_50"
|
||||
android:button="@null"
|
||||
android:drawableStart="@drawable/selector_login_radio_btn"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:text="@string/text_login_protocol"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_login_quick_pass"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<TextView
|
||||
@@ -79,71 +172,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_protocol"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/container_third_part"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_50"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/img_qq_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_login_qq"
|
||||
android:drawablePadding="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="QQ"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/img_phone_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_45"
|
||||
android:layout_marginEnd="@dimen/dp_45"
|
||||
android:drawableTop="@drawable/ic_login_phone"
|
||||
android:drawablePadding="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="@dimen/dp_11"
|
||||
tools:text="手机" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/img_wx_login"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_login_wx"
|
||||
android:drawablePadding="@dimen/dp_15"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_282828"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:visibility="gone"
|
||||
tools:text="微信"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
android:layout_marginBottom="49dp"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="遇到问题点击这里" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Reference in New Issue
Block a user