Commit 3921888b by 刘鹏

Merge branch 'feat/lp/lp_test_yinsi' into 'd/v4.4.07'

feat: 兼容心理测试包的隐私政策

See merge request app_android_lib/YDL-Component!295
parents f79f4b0f f842ac79
...@@ -9,7 +9,9 @@ import android.widget.ImageView; ...@@ -9,7 +9,9 @@ import android.widget.ImageView;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.ChannelConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.yidianling.common.tools.RxNetTool; import com.yidianling.common.tools.RxNetTool;
import com.yidianling.user.R; import com.yidianling.user.R;
...@@ -58,11 +60,15 @@ public class H5Activity extends BaseActivity { ...@@ -58,11 +60,15 @@ public class H5Activity extends BaseActivity {
// 开启 DOM storage API 功能 // 开启 DOM storage API 功能
web_view.getSettings().setDomStorageEnabled(true); web_view.getSettings().setDomStorageEnabled(true);
if (getIntent().getBooleanExtra(INTENT_PRIVACY, false)) { if (getIntent().getBooleanExtra(INTENT_PRIVACY, false)) {
String ffrom = PlatformDataManager.INSTANCE.getRam().getChannelName();
//隐私政策 //隐私政策
if (!RxNetTool.isConnected(BaseApp.Companion.getApp())){ if (!RxNetTool.isConnected(BaseApp.Companion.getApp())) {
//无网络 读取本地文件 //无网络 读取本地文件
web_view.loadUrl("file:///android_asset/html/yinsi.html"); web_view.loadUrl("file:///android_asset/html/yinsi.html");
}else { } else if (ffrom.startsWith(ChannelConfig.ATK_4.name())) {
//心理测试包更改隐私协议地址
web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh/test");
} else {
web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh");//加载url web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh");//加载url
} }
} else { } else {
......
...@@ -17,6 +17,8 @@ import com.mobile.auth.gatewayauth.model.TokenRet ...@@ -17,6 +17,8 @@ import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.app.Apm import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.data.PlatformDataManager.getRam
import com.ydl.ydlcommon.utils.JPushUtils import com.ydl.ydlcommon.utils.JPushUtils
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
...@@ -307,7 +309,7 @@ object OneKeyLoginHelp { ...@@ -307,7 +309,7 @@ object OneKeyLoginHelp {
val appName= mActivity.resources.getString(R.string.user_login_name_start) val appName= mActivity.resources.getString(R.string.user_login_name_start)
var appPrivacyOneTip = "${appName}用户使用协议" var appPrivacyOneTip = "${appName}用户使用协议"
var appPrivacyOne = "https://h5.ydl.com/SDUserProtol" var appPrivacyOne = "https://h5.ydl.com/SDUserProtol"
var appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh" var appPrivacyTwo = getPrivacyUrl()
if (mAppType == YDL_EXPERT_APP) { if (mAppType == YDL_EXPERT_APP) {
loginLogo = "ic_expert_login_logo" loginLogo = "ic_expert_login_logo"
loginHeight = 60 loginHeight = 60
...@@ -394,7 +396,7 @@ object OneKeyLoginHelp { ...@@ -394,7 +396,7 @@ object OneKeyLoginHelp {
// 每次打开页面前先清空所有的自定义控件,再重新设置 // 每次打开页面前先清空所有的自定义控件,再重新设置
phoneNumberAuthHelper.removeAuthRegisterXmlConfig() phoneNumberAuthHelper.removeAuthRegisterXmlConfig()
phoneNumberAuthHelper.removeAuthRegisterViewConfig() phoneNumberAuthHelper.removeAuthRegisterViewConfig()
var appPrivacyTwo = getPrivacyUrl()
val dialogHeight = RxImageTool.px2dp((RxDeviceTool.getScreenHeight(mActivity) * 0.45f)) val dialogHeight = RxImageTool.px2dp((RxDeviceTool.getScreenHeight(mActivity) * 0.45f))
phoneNumberAuthHelper.setAuthUIConfig( phoneNumberAuthHelper.setAuthUIConfig(
AuthUIConfig.Builder() AuthUIConfig.Builder()
...@@ -422,7 +424,7 @@ object OneKeyLoginHelp { ...@@ -422,7 +424,7 @@ object OneKeyLoginHelp {
.setSwitchAccTextColor(Color.parseColor("#999999")) .setSwitchAccTextColor(Color.parseColor("#999999"))
.setSwitchOffsetY_B(80) .setSwitchOffsetY_B(80)
.setAppPrivacyOne("壹点灵用户使用协议", "https://h5.ydl.com/SDUserProtol") .setAppPrivacyOne("壹点灵用户使用协议", "https://h5.ydl.com/SDUserProtol")
.setAppPrivacyTwo("隐私协议", "https://m.ydl.com/Protol/yinsi/shdh") .setAppPrivacyTwo("隐私协议", appPrivacyTwo)
.setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2")) .setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2"))
.setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏 .setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏
.setCheckBoxHeight(22) .setCheckBoxHeight(22)
...@@ -439,6 +441,16 @@ object OneKeyLoginHelp { ...@@ -439,6 +441,16 @@ object OneKeyLoginHelp {
) )
} }
private fun getPrivacyUrl(): String {
val ffrom = getRam().getChannelName()
var appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh"
if (ffrom.startsWith(ChannelConfig.ATK_4.name)) {
//心理测试包更改隐私协议地址
appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh/test"
}
return appPrivacyTwo
}
// 一键登录token监听器 // 一键登录token监听器
private var mTokenListener: TokenResultListener = object : TokenResultListener { private var mTokenListener: TokenResultListener = object : TokenResultListener {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment