登录页部分UI

This commit is contained in:
oujunhui
2020-04-09 15:57:14 +08:00
parent 06bd068125
commit 11319692e6
6 changed files with 46 additions and 46 deletions

View File

@@ -20,7 +20,7 @@ android {
}
dependencies {
api 'com.android.support:support-annotations:23.0.1'
api 'com.android.support:support-annotations:28.0.0'
api 'com.android.support:support-v4:26.0.1'
}

View File

@@ -149,7 +149,7 @@ android {
}
debug {
buildConfigField "String", "BASE_URL", "\"http://192.168.63.108:8079/\""
buildConfigField "String", "BASE_URL", "\"http://192.168.1.105:8079/\""
// buildConfigField "String", "BASE_URL", "\"http://apibeta.qxjiaoyou.com/\""
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
buildConfigField "String", "BASE_URL_STAGING", "\"https://preview.qxjiaoyou.com/\""

View File

@@ -61,8 +61,8 @@ public abstract class BaseLoginAct extends BaseActivity {
int userAgreementTipIndex = privacyAgreementDescTip.indexOf(userAgreementTip);
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.design_color)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.design_color)) {
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.white)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.white)) {
@Override
public void onClick(@NonNull View widget) {
if (!canClick) {
@@ -74,8 +74,8 @@ public abstract class BaseLoginAct extends BaseActivity {
CommonWebViewActivity.start(context, UriProvider.getPrivacyAgreement());
}
}, privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.design_color)), userAgreementTipIndex, userAgreementTipIndex + userAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.design_color)) {
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.white)), userAgreementTipIndex, userAgreementTipIndex + userAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.white)) {
@Override
public void onClick(@NonNull View widget) {
if (!canClick) {

View File

@@ -20,7 +20,7 @@
<string name="hint_login_password_2">请输入密码</string>
<string name="text_login_to_register">立即注册</string>
<string name="text_login_forget_password">忘记密码</string>
<string name="text_login_protocol">继续即代表同意%s与%s</string>
<string name="text_login_protocol">登录即代表同意%s与%s</string>
<string name="text_login_protocol_2">注册即代表同意 %s</string>
<string name="text_how_to_set_pwd">未设置兔兔密码的用户记得前往\n兔兔设置密码哦 %s</string>
<string name="text_bind_and_login">登录并绑定</string>

View File

@@ -69,8 +69,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
private TextView tvLoginQuickPass;
private QuickLogin login;// BUSINESS_ID为从易盾官网申请的业务id
private LinearLayout containerThirdPart;
private ImageView phoneLogin;
public static void start(Context context) {
@@ -90,6 +88,7 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
onSetListener();
permission();
showLoginTip();
preFetchMobileNum();
AuthModel.get().isFromLogin = true;
AppUpgradeHelper.checkAppUpgrade(this);
}
@@ -98,8 +97,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
tvLoginQuickPass = findViewById(R.id.tv_login_quick_pass);
tvProtocol = findViewById(R.id.tv_protocol);
setProtocol();
containerThirdPart = findViewById(R.id.container_third_part);
wxLogin = findViewById(R.id.img_wx_login);
qqLogin = findViewById(R.id.img_qq_login);
tvLoginTip = findViewById(R.id.tv_login_tip);
@@ -128,33 +125,9 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
break;
case R.id.tv_login_quick_pass:
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN, "一键登录");
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();
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_SUCCEED, "一键登录成功");
onePass();
}
@Override
public void onGetMobileNumberError(String YDToken, final String msg) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_FAILED, "一键登录失败");
toast("一键登录失败,请使用其他方式登录");
LogUtil.e("QuickPassLogin", msg);
getDialogManager().dismissDialog();
LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
}
});
onePass();
break;
case R.id.img_phone_login:
@@ -179,6 +152,29 @@ 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();
tvLoginQuickPass.setVisibility(View.VISIBLE);
}
@Override
public void onGetMobileNumberError(String YDToken, final String msg) {
toast("一键登录失败,请使用其他方式登录");
LogUtil.e("QuickPassLogin", msg);
getDialogManager().dismissDialog();
// LoginActivity.startForResult(QuickPassLoginAct.this, quickPassRequestCode);
tvLoginQuickPass.setVisibility(View.INVISIBLE);
}
});
}
private void onePass() {
// 易盾保护 token 登录
String yiDunLoginToken = watchman.getToken(XChatConstants.YI_DUN_LOGIN_BUSINESS_ID);
@@ -204,6 +200,8 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
setClickEnable(false);
getDialogManager().dismissDialog();
finish();
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_SUCCEED, "一键登录成功");
}
@Override
@@ -211,6 +209,8 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
getDialogManager().dismissDialog();
dealWithLoginError(e);
setClickEnable(true);
StatisticManager.Instance().onEvent(
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_FAILED, "一键登录失败");
}
});
@@ -285,10 +285,8 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
@Override
protected void showThirdPartLogin(boolean isShowWechat, boolean isShowQq) {
if (containerThirdPart != null) {
containerThirdPart.setVisibility(isShowWechat || isShowQq ? View.VISIBLE : View.INVISIBLE);
}
wxLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE);
qqLogin.setVisibility(isShowWechat?View.VISIBLE:View.INVISIBLE);
super.showThirdPartLogin(isShowWechat, isShowQq);
}

View File

@@ -42,7 +42,8 @@
android:background="@drawable/bg_quick_pass"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_slogan_quick_pass"
app:layout_constraintBottom_toTopOf="@id/container_third_part"
android:layout_marginBottom="@dimen/dp_20"
tools:ignore="SpUsage"
/>
@@ -51,13 +52,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dp"
android:layout_marginBottom="@dimen/dp_15"
android:text="@string/text_login_protocol"
android:textColor="@color/color_666666"
android:textColor="#FFBBB1FF"
android:textSize="@dimen/dp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/container_third_part"
app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="SpUsage" />
<LinearLayout
@@ -65,10 +66,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="29dp"
android:layout_marginBottom="@dimen/dp_30"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_desc">
app:layout_constraintBottom_toTopOf="@+id/tv_protocol">
<ImageView
android:id="@+id/img_wx_login"
@@ -111,6 +112,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:visibility="gone"
tools:text="遇到问题点击这里" />
</android.support.constraint.ConstraintLayout>