feat:针对google play的审核调整(无障碍相关)
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package com.nnbc123.app.base;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -20,7 +21,7 @@ import com.nnbc123.core.UriProvider;
|
||||
|
||||
public abstract class BaseLoginAct extends BaseActivity {
|
||||
|
||||
protected CheckBox tvProtocol;
|
||||
protected TextView tvProtocol;
|
||||
|
||||
protected boolean canClick = true;
|
||||
|
||||
@@ -37,11 +38,29 @@ public abstract class BaseLoginAct extends BaseActivity {
|
||||
|
||||
String privacyAgreementTip = context.getString(R.string.tip_privacy_agreement);
|
||||
String userAgreementTip = context.getString(R.string.tip_user_agreement);
|
||||
String privacyAgreementDescTip = context.getString(R.string.text_login_protocol, privacyAgreementTip, userAgreementTip);
|
||||
String privacyAgreementDescTip = context.getString(R.string.text_login_protocol, userAgreementTip, privacyAgreementTip);
|
||||
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
||||
int privacyAgreementTipIndex = privacyAgreementDescTip.indexOf(privacyAgreementTip);
|
||||
int userAgreementTipIndex = privacyAgreementDescTip.indexOf(userAgreementTip);
|
||||
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.text_normal_282828)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
if (widget instanceof TextView)
|
||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||
|
||||
CommonWebViewActivity.start(context, UriProvider.getUserProtocolUrl());
|
||||
}
|
||||
}, userAgreementTipIndex, userAgreementTipIndex + userAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
ss.setSpan(
|
||||
new StyleSpan(Typeface.BOLD), userAgreementTipIndex, userAgreementTipIndex + userAgreementTip.length(),
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.text_normal_282828)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
@@ -55,18 +74,11 @@ public abstract class BaseLoginAct extends BaseActivity {
|
||||
}
|
||||
}, privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.text_normal_282828)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (!canClick) {
|
||||
return;
|
||||
}
|
||||
if (widget instanceof TextView)
|
||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||
|
||||
CommonWebViewActivity.start(context, UriProvider.getUserProtocolUrl());
|
||||
}
|
||||
}, userAgreementTipIndex, userAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(
|
||||
new StyleSpan(Typeface.BOLD),
|
||||
privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(),
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
|
||||
tvProtocol.setText(ss);
|
||||
tvProtocol.setHighlightColor(Color.TRANSPARENT);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.9 KiB |
@@ -20,16 +20,18 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="返回上一个网页"
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="退出"
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:scaleType="center"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:src="@drawable/ic_close_black" />
|
||||
@@ -50,6 +52,7 @@
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:contentDescription="分享"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_share_white"
|
||||
|
@@ -26,6 +26,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="返回"
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -19,7 +19,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_login_protocol_3">阅读并同意%s与\n%s方可登录</string>
|
||||
<string name="text_how_to_set_pwd">未设置兔兔密码的用户记得前往\n兔兔设置密码哦 %s</string>
|
||||
@@ -826,7 +826,7 @@
|
||||
</string>
|
||||
<string name="tip_privacy_agreement_desc">欢迎您点击查看%s和%s,当您点击“同意”即表示您已充分阅读、理解并接受《用户协议》和《隐私政策》的全部内容。</string>
|
||||
<string name="tip_privacy_agreement">《隐私政策》</string>
|
||||
<string name="tip_user_agreement">《用户协议》</string>
|
||||
<string name="tip_user_agreement">《用户服务协议》</string>
|
||||
<string name="my_family">家族</string>
|
||||
|
||||
<string name="label_charge_gold">我的账户</string>
|
||||
|
@@ -9,7 +9,6 @@ import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
@@ -17,7 +16,6 @@ import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.base.BaseLoginAct;
|
||||
import com.nnbc123.app.ui.login.LoginPasswordActivity;
|
||||
import com.nnbc123.core.DemoCache;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.auth.event.LoginEvent;
|
||||
import com.nnbc123.core.auth.exception.AccountCancelException;
|
||||
@@ -29,7 +27,6 @@ import com.nnbc123.library.common.Constants;
|
||||
import com.nnbc123.library.common.SpConstants;
|
||||
import com.nnbc123.library.common.util.SPUtils;
|
||||
import com.nnbc123.library.utils.AppMetaDataUtil;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -46,12 +43,8 @@ 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 tvProtocolHint;
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, QuickPassLoginAct.class);
|
||||
context.startActivity(intent);
|
||||
@@ -70,7 +63,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
|
||||
private void onFindViews() {
|
||||
tvProtocol = findViewById(R.id.tv_protocol);
|
||||
tvProtocolHint = findViewById(R.id.tv_protocol_hint);
|
||||
if (AppMetaDataUtil.getChannelID().equals(Constants.CHANNEL_GOOGLE)) {
|
||||
findViewById(R.id.cs_google).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
@@ -97,24 +89,10 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
@Override
|
||||
protected void setProtocol() {
|
||||
super.setProtocol();
|
||||
if (DemoCache.readBoolean(NEED_CHECKED_PROTOCOL, false)) {
|
||||
tvProtocol.setChecked(true);
|
||||
}
|
||||
|
||||
tvProtocol.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
if (isChecked) {
|
||||
tvProtocolHint.setVisibility(View.GONE);
|
||||
DemoCache.saveBoolean(NEED_CHECKED_PROTOCOL, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!tvProtocol.isChecked()) {
|
||||
tvProtocolHint.setVisibility(View.VISIBLE);
|
||||
return;
|
||||
}
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_password_login:
|
||||
LoginPasswordActivity.start(QuickPassLoginAct.this);
|
||||
|
@@ -34,10 +34,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:padding="10dp"
|
||||
android:text="密码登录"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -89,87 +90,68 @@
|
||||
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.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.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.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.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>-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<CheckBox
|
||||
<TextView
|
||||
android:id="@+id/tv_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_50"
|
||||
android:button="@null"
|
||||
android:drawableStart="@drawable/selector_login_radio_btn"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:padding="10dp"
|
||||
android:text="@string/text_login_protocol"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_protocol_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/bg_login_protocol_hint"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="同意隐私政策和用户协议后,才可以注册登录哦~"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_protocol"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Reference in New Issue
Block a user