Skip to content

Commit

Permalink
【ID869532311】App数据隐私合规检测风险问题修复-用户协议弹框内添加隐私摘要链接
Browse files Browse the repository at this point in the history
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192869532311

Change-Id: I78697c217572312bd942d9f40f3b6dba0acf35f6
  • Loading branch information
archurtan committed Jun 23, 2022
1 parent df6fff5 commit 8eaca2e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,38 @@ class UserAgreeDialog(context: Context) : IosCenterStyleDialog(context, R.layout
val agreeContentStrPrefix = context.getString(R.string.rule_content_prefix)
val partStr1 = "${context.getString(R.string.register_agree_2)}"
val partStr2 = context.getString(R.string.register_agree_3)
val partStr3 = "${context.getString(R.string.register_agree_4)}"

val partStr3 = "${context.getString(R.string.summary_of_privacy_policy)}"
val partStr4 = context.getString(R.string.pause_mark)

val partStr5 = "${context.getString(R.string.register_agree_4)}"
val agreeContentStrMiddle = context.getString(R.string.rule_content_middle)
val partStr4 = "${context.getString(R.string.app_logo_name)}App${context.getString(R.string.personal_information_list)}"
val partStr6 = "${context.getString(R.string.app_logo_name)}App${context.getString(R.string.personal_information_list)}"
val agreeContentStrMiddle2 = context.getString(R.string.rule_content_middle2)
val partStr5 = "${context.getString(R.string.rule_content_list)}"
val partStr7 = "${context.getString(R.string.rule_content_list)}"
val agreeContentStrSuffix = context.getString(R.string.rule_content_suffix)
var agreeContentStr = agreeContentStrPrefix + partStr1 + partStr2 + partStr3 + agreeContentStrMiddle + partStr4 + agreeContentStrMiddle2 + partStr5 + agreeContentStrSuffix
var agreeContentStr = agreeContentStrPrefix + partStr1 + partStr2 + partStr3 + partStr4 + partStr5 + agreeContentStrMiddle + partStr6 + agreeContentStrMiddle2 + partStr7 + agreeContentStrSuffix
var agreeContentSpannable = SpannableStringBuilder(agreeContentStr)

agreeContentSpannable.setSpan(IndexClickableSpan(context, 1),
agreeContentStrPrefix.length, agreeContentStrPrefix.length + partStr1.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

val start1 = agreeContentStrPrefix.length + partStr1.length + partStr2.length
agreeContentSpannable.setSpan(IndexClickableSpan(context, 2),
start1, start1 + partStr3.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
val start2 = agreeContentStrPrefix.length + partStr1.length + partStr2.length + partStr3.length + agreeContentStrMiddle.length

val start2 = agreeContentStrPrefix.length + partStr1.length + partStr2.length + partStr3.length + partStr4.length
agreeContentSpannable.setSpan(IndexClickableSpan(context, 3),
start2, start2 + partStr4.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
val start3 = agreeContentStrPrefix.length + partStr1.length + partStr2.length + partStr3.length + agreeContentStrMiddle.length + partStr4.length + agreeContentStrMiddle2.length
start2, start2 + partStr5.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

val start3 = agreeContentStrPrefix.length + partStr1.length + partStr2.length + partStr3.length + partStr4.length + partStr5.length + agreeContentStrMiddle.length
agreeContentSpannable.setSpan(IndexClickableSpan(context, 4),
start3, start3 + partStr5.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
start3, start3 + partStr6.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

val start4 = agreeContentStrPrefix.length + partStr1.length + partStr2.length + partStr3.length + partStr4.length + partStr5.length + agreeContentStrMiddle.length + partStr6.length + agreeContentStrMiddle2.length
agreeContentSpannable.setSpan(IndexClickableSpan(context, 5),
start4, start4 + partStr7.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

tv_tip_content?.movementMethod = LinkMovementMethod.getInstance()
tv_tip_content?.text = agreeContentSpannable

Expand Down Expand Up @@ -109,6 +122,7 @@ class UserAgreeDialog(context: Context) : IosCenterStyleDialog(context, R.layout
fun onOkClickedPrivacyPolicy()
fun onOkClickedPersonalInfoList()
fun onOkClickedThirdSDKList()
fun onClickedPrivacyPolicySummary()
}

fun setOnDismisListener(onDismisListener: OnDismisListener?) {
Expand All @@ -133,10 +147,12 @@ class UserAgreeDialog(context: Context) : IosCenterStyleDialog(context, R.layout
if (index == 1) {
onDismisListener?.onOkClickedUserAgreement()
} else if (index == 2) {
onDismisListener?.onOkClickedPrivacyPolicy()
onDismisListener?.onClickedPrivacyPolicySummary()
} else if (index == 3) {
onDismisListener?.onOkClickedPersonalInfoList()
onDismisListener?.onOkClickedPrivacyPolicy()
} else if (index == 4) {
onDismisListener?.onOkClickedPersonalInfoList()
} else if (index == 5) {
onDismisListener?.onOkClickedThirdSDKList()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ class PrivicyDialogActivity : BaseActivity() {
OpensourceLicenseActivity.startWebWithExtra(this@PrivicyDialogActivity, getString(R.string.rule_content_list), CommonField.THIRD_SDK_URL_US_EN)
}
}

override fun onClickedPrivacyPolicySummary() {
val intent = Intent(this@PrivicyDialogActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.summary_of_privacy_policy))
var url = CommonField.PRIVACY_POLICY_SUMMARY_URL_CN_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
}
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ object CommonField {
const val THIRD_SDK_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config13.js"
const val PERSONAL_INFO_URL_US_ZH = "https://privacy.qq.com/document/preview/278bbbbbdd5748999fce491cfa6dd424"
const val PERSONAL_INFO_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config15.js"
const val PRIVACY_POLICY_SUMMARY_URL_CN_ZH = "https://privacy.qq.com/document/preview/4f262b760a4543a7a26409064d1391c2"
const val PRIVACY_POLICY_SUMMARY_URL_CN_EN = "https://privacy.qq.com/document/preview/4f262b760a4543a7a26409064d1391c2"

/************返回结果通用字段*************/
const val RESPONSE = "Response"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-en-rUS/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
<string name="register_agree_3">&#160;and&#160;</string>
<string name="register_agree_4">Privacy Policy</string>
<string name="register_agree_4_low">privacy policy</string>
<string name="summary_of_privacy_policy">Summary of Privacy Policy</string>
<string name="pause_mark">、</string>
<string name="register_agree_5">Open-Source Software Info</string>
<string name="register_get_code">Send</string>
<string name="get_mobile_code_sent">The verification code has been sent to your phone:</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
<string name="register_agree_3">及</string>
<string name="register_agree_4">隐私政策</string>
<string name="register_agree_4_low">隐私政策</string>
<string name="summary_of_privacy_policy">隐私政策摘要</string>
<string name="pause_mark">、</string>
<string name="register_agree_5">开源软件信息</string>
<string name="register_get_code">获取验证码</string>
<string name="get_mobile_code_sent">验证码已经发送到您的手机:</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@
<string name="register_agree_3">及</string>
<string name="register_agree_4">隐私政策</string>
<string name="register_agree_4_low">隐私政策</string>
<string name="summary_of_privacy_policy">隐私政策摘要</string>
<string name="pause_mark">、</string>
<string name="register_agree_5">开源软件信息</string>
<string name="register_get_code">获取验证码</string>
<string name="get_mobile_code_sent">验证码已经发送到您的手机:</string>
Expand Down

0 comments on commit 8eaca2e

Please sign in to comment.