mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-13 21:00:55 +08:00
fix(welcome): update tips for user‘s agreement and privacy
This commit is contained in:
parent
7b1116e70b
commit
3563d46a38
@ -114,7 +114,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
ReqPermissions.add(Manifest.permission.READ_PHONE_STATE);
|
||||
}
|
||||
|
||||
if (ReqPermissions.size() == 0) {
|
||||
if (ReqPermissions.isEmpty()) {
|
||||
isPermission = true;
|
||||
} else {
|
||||
requestPermissions(ReqPermissions.toArray(new String[0]), SDK_PERMISSION_REQUEST);
|
||||
@ -146,7 +146,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void doAccetion() {
|
||||
private void doAcceptation() {
|
||||
if (mAgreement && mPrivacy) {
|
||||
checkBox.setChecked(true);
|
||||
checkDefaultPermissions();
|
||||
@ -183,7 +183,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
mAgreement = false;
|
||||
|
||||
doAccetion();
|
||||
doAcceptation();
|
||||
|
||||
alertDialog.cancel();
|
||||
});
|
||||
@ -191,7 +191,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
tvAgree.setOnClickListener(v -> {
|
||||
mAgreement = true;
|
||||
|
||||
doAccetion();
|
||||
doAcceptation();
|
||||
|
||||
alertDialog.cancel();
|
||||
});
|
||||
@ -219,7 +219,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
mPrivacy = false;
|
||||
|
||||
doAccetion();
|
||||
doAcceptation();
|
||||
|
||||
alertDialog.cancel();
|
||||
});
|
||||
@ -227,7 +227,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
tvAgree.setOnClickListener(v -> {
|
||||
mPrivacy = true;
|
||||
|
||||
doAccetion();
|
||||
doAcceptation();
|
||||
|
||||
alertDialog.cancel();
|
||||
});
|
||||
@ -268,6 +268,21 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
String str = getString(R.string.app_agreement_privacy);
|
||||
SpannableStringBuilder builder = getSpannableStringBuilder(str);
|
||||
|
||||
checkBox.setText(builder);
|
||||
checkBox.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
if (mPrivacy && mAgreement) {
|
||||
checkBox.setChecked(true);
|
||||
checkDefaultPermissions();
|
||||
} else {
|
||||
checkBox.setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private SpannableStringBuilder getSpannableStringBuilder(String str) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(str);
|
||||
ClickableSpan clickSpanAgreement = new ClickableSpan() {
|
||||
@Override
|
||||
@ -299,15 +314,6 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||
int privacy_start = str.indexOf("《", agreement_end);
|
||||
int privacy_end = str.indexOf("》", agreement_end) + 1;
|
||||
builder.setSpan(clickSpanPrivacy, privacy_start, privacy_end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
checkBox.setText(builder);
|
||||
checkBox.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
if (mPrivacy && mAgreement) {
|
||||
checkBox.setChecked(true);
|
||||
checkDefaultPermissions();
|
||||
} else {
|
||||
checkBox.setChecked(false);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:layout_margin="20dp"
|
||||
android:gravity="center"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
"6. 如果用户自行安装本软件,即表明用户信任软件作者,自愿选择安装本软件,并接受本协议所有条款。 如果用户不接受本协议,请立即删除。\n"
|
||||
</string>
|
||||
<string name="app_agreement_privacy">已阅读《用户协议》和《隐私政策》</string>
|
||||
<string name="app_error_agreement">必须接受《用户协议》和《隐私政策》</string>
|
||||
<string name="app_error_read">请先阅读《用户协议》和《隐私政策》</string>
|
||||
<string name="app_error_agreement">必须先接受\n《用户协议》和《隐私政策》</string>
|
||||
<string name="app_error_read">请依次阅读并接受\n《用户协议》和《隐私政策》</string>
|
||||
<string name="app_error_gps">定位不可用,请检查 GPS 是否开启</string>
|
||||
<string name="app_error_network">网络不可用,请检查网络连接</string>
|
||||
<string name="app_error_permission">权限不足,请授予相关权限</string>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user