Commit 508bda76 by 徐健

Merge branch 'feature/userinfo_collect' of…

Merge branch 'feature/userinfo_collect' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/userinfo_collect
parents 7c52aa5c 6488b095
...@@ -181,7 +181,7 @@ dependencies { ...@@ -181,7 +181,7 @@ dependencies {
implementation project(':m-user') implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
api project(':m-tests') api project(':m-tests')
// api project(':m-consultant') api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api') implementation modularPublication('com.ydl:m-consultant-api')
// implementation project(':m-confide') // implementation project(':m-confide')
......
package com.ydl.component package com.ydl.component
//import com.ydl.confide.home.ConfideHomeActivity //import com.ydl.confide.home.ConfideHomeActivity
//import com.ydl.confide.home.ConfideHomeActivity
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
//import com.yidianling.consultant.api.IConsultantService
import android.Manifest import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.ComponentName import android.content.ComponentName
...@@ -9,6 +12,7 @@ import android.content.Intent ...@@ -9,6 +12,7 @@ import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.net.Uri import android.net.Uri
import android.os.IBinder import android.os.IBinder
import android.os.Process
import android.provider.Settings import android.provider.Settings
import android.util.Log import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
...@@ -18,21 +22,17 @@ import com.umeng.analytics.MobclickAgent ...@@ -18,21 +22,17 @@ import com.umeng.analytics.MobclickAgent
import com.ydl.component.music.FragmentContainerActivity import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter import com.ydl.component.mvp.DemoPresenter
//import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.media.audio.PlayService import com.ydl.media.audio.PlayService
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.utils.ActivityManager.Companion.finishAll
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
//import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService import com.yidianling.fm.api.service.IFMService
import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.widget.SecretDescriptionDialog import com.yidianling.user.widget.SecretDescriptionDialog
import com.yidianling.user.widget.SecretDescriptionDialog.OnSecretDescriptionDialogListener
import com.yidianling.user.widget.SecretDialog import com.yidianling.user.widget.SecretDialog
import com.yidianling.user.widget.SecretDialog.OnSecretDialogListener
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
/** /**
...@@ -42,8 +42,9 @@ import kotlinx.android.synthetic.main.activity_main.* ...@@ -42,8 +42,9 @@ import kotlinx.android.synthetic.main.activity_main.*
@Route(path = "/main/main") @Route(path = "/main/main")
class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(), class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(),
DemoContract.View { DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null private var serviceConnection: ServiceConnection? = null
private var secretDialog: SecretDialog? = null
protected var playService: PlayService? = null protected var playService: PlayService? = null
override fun getContentViewId(): Int { override fun getContentViewId(): Int {
...@@ -107,20 +108,37 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -107,20 +108,37 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity.start(this, "TrendsHomeFragment") FragmentContainerActivity.start(this, "TrendsHomeFragment")
} }
bt_to_tests.setOnClickListener { bt_to_tests.setOnClickListener {
startActivity(Intent(this, NewTestHomeActivity::class.java)) // startActivity(Intent(this, NewTestHomeActivity::class.java))
// SecretActivity.Companion.startProtocol(this, it.data.getContent());
secretDescriptionDialog = SecretDescriptionDialog(
this@MainActivity,
"122342453653456345674356",
object : OnSecretDescriptionDialogListener {
override fun onCancel() {
secretDescriptionDialog!!.dismiss()
showEnsureDialog()
}
override fun onSure() {
secretDescriptionDialog!!.dismiss()
}
})
secretDescriptionDialog!!.setCanceledOnTouchOutside(false)
secretDescriptionDialog!!.show()
} }
bt_to_collect_info.setOnClickListener { bt_to_collect_info.setOnClickListener {
startActivity(Intent(this, CollectSexAndBirthActivity::class.java)) startActivity(Intent(this, CollectSexAndBirthActivity::class.java))
} }
bt_to_confide.setOnClickListener { bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016") // YDLavManager.instances.login("1193016")
// startActivity(Intent(this, ConfideHomeActivity::class.java)) // startActivity(Intent(this, ConfideHomeActivity::class.java))
} }
bt_to_muse.setOnClickListener { bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER, // YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER,
YDLRouterParams().putExtra // YDLRouterParams().putExtra
("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3")) // ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3"))
// YDLRouterManager.router( // YDLRouterManager.router(
// IYDLRouterConstant.ROUTER_MUSE, // IYDLRouterConstant.ROUTER_MUSE,
...@@ -165,14 +183,18 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -165,14 +183,18 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
bt_to_test.setOnClickListener { bt_to_test.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity, "感谢您信任并使用壹点灵APP,\\n\n" + val dialog = SecretDescriptionDialog(this@MainActivity,
"感谢您信任并使用壹点灵APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" + "我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" + "2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" + "3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" + "4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。", object : SecretDescriptionDialog.OnSecretDescriptionDialogListener { "5. 您可以查询、更正、删除您的个人信息。",
object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() { override fun onCancel() {
val secretDialog = SecretDialog(this@MainActivity, object : SecretDialog.OnSecretDialogListener { val secretDialog = SecretDialog(
this@MainActivity,
object : SecretDialog.OnSecretDialogListener {
override fun onCancel() { override fun onCancel() {
ToastUtil.toastShort("onCancel") ToastUtil.toastShort("onCancel")
} }
...@@ -264,4 +286,22 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -264,4 +286,22 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
} }
private fun showEnsureDialog() {
secretDialog = SecretDialog(this, object : OnSecretDialogListener {
override fun onCancel() {
secretDialog!!.dismiss()
// finishAll()
// Process.killProcess(Process.myPid())
// System.exit(0)
}
override fun onSure() {
secretDialog!!.dismiss()
}
})
secretDialog!!.setCanceledOnTouchOutside(false)
secretDialog!!.show()
}
} }
...@@ -7,6 +7,7 @@ import com.ydl.component.mvp.DemoContract ...@@ -7,6 +7,7 @@ import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment //import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment import com.yidianling.home.ui.fragment.YdlHomeFragment
...@@ -70,9 +71,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra ...@@ -70,9 +71,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra
if ("YdlHomeFragment" == fragmentName) { if ("YdlHomeFragment" == fragmentName) {
return YdlHomeFragment() return YdlHomeFragment()
} }
// if ("ExpertSearchFragment" == fragmentName) { if ("ExpertSearchFragment" == fragmentName) {
// return ExpertSearchFragment() return ExpertSearchFragment()
// } }
return PlayFragment() return PlayFragment()
} }
} }
...@@ -47,7 +47,7 @@ ext { ...@@ -47,7 +47,7 @@ ext {
"m-fm" : "0.0.29.3", "m-fm" : "0.0.29.3",
"m-user" : "0.0.59.14", "m-user" : "0.0.59.14",
"m-home" : "0.0.19.1", "m-home" : "0.0.19.1",
"m-im" : "0.0.16.0", "m-im" : "0.0.16.2",
"m-dynamic" : "0.0.6.1", "m-dynamic" : "0.0.6.1",
"m-muse" : "0.0.28.9", "m-muse" : "0.0.28.9",
......
...@@ -281,8 +281,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -281,8 +281,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
collectInfoPopupWindow.show(top_expert_info_cl); collectInfoPopupWindow.show(top_expert_info_cl);
} }
} }
ChatStatusCacheHelper.clearDataByKey("collectEvent"); ChatStatusCacheHelper.clearDataByKey("collectEvent");
} }
...@@ -1190,7 +1188,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1190,7 +1188,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> { .subscribe(resp -> {
if (resp.data != null && resp.data.size() > 0) { if (resp.data != null && resp.data.size() > 0) {
collectInfoPopupWindow.setData(resp.data); ServiceImpl.Companion.getInstance().userCollectList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(hasCollectedInResp -> {
if (hasCollectedInResp.data != null && hasCollectedInResp.data.size() > 0) {
collectInfoPopupWindow.setData(resp.data, hasCollectedInResp.data);
} else {
collectInfoPopupWindow.setData(resp.data, null);
}
}, throwable -> {
collectInfoPopupWindow.setData(resp.data, null);
});
} else { } else {
collectInfoPopupWindow.dismiss(); collectInfoPopupWindow.dismiss();
} }
......
...@@ -18,7 +18,8 @@ import com.yidianling.uikit.custom.http.response.UserQuestInfoBean ...@@ -18,7 +18,8 @@ import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/12/10 * @date 2019/12/10
*/ */
class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListener) : PopupWindow(mContext) { class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListener) :
PopupWindow(mContext) {
private var collectUserInformationView: CollectUserInformationView private var collectUserInformationView: CollectUserInformationView
private var isFromBack = true private var isFromBack = true
...@@ -49,12 +50,12 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe ...@@ -49,12 +50,12 @@ class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListe
isOutsideTouchable = false isOutsideTouchable = false
} }
fun setData(list: List<UserQuestInfoBean>) { fun setData(list: List<UserQuestInfoBean>, hasCompleteInfoList: List<UserQuestInfoBean>?) {
if (list.isEmpty()) { if (list.isEmpty()) {
ToastUtil.toastShort("数据异常,请稍后重试") ToastUtil.toastShort("数据异常,请稍后重试")
return return
} }
collectUserInformationView.setData(list) collectUserInformationView.setData(list, hasCompleteInfoList)
} }
......
...@@ -37,11 +37,16 @@ import kotlin.collections.ArrayList ...@@ -37,11 +37,16 @@ import kotlin.collections.ArrayList
* @date 2019/12/10 * @date 2019/12/10
*/ */
@SuppressLint("ViewConstructor") @SuppressLint("ViewConstructor")
class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Unit, var sendMsgEvent: (content: String, list: List<UserQuestInfoBean>) -> Unit) : LinearLayout(mContext) { class CollectUserInformationView(
var mContext: Context,
var skipEvent: () -> Unit,
var sendMsgEvent: (content: String, list: List<UserQuestInfoBean>) -> Unit
) : LinearLayout(mContext) {
private var resultInfoList = ArrayList<UserQuestInfoBean>() private var resultInfoList = ArrayList<UserQuestInfoBean>()
private var hasAge = false
private var hasGender = false
private var currentIndex = 0 private var currentIndex = 0
private var year =1994 private var year = 1994
//todo CommonDialog的样式要改
private var dialog: CommonDialog? = null private var dialog: CommonDialog? = null
private var ageStr = "" private var ageStr = ""
private var genderStr = "" private var genderStr = ""
...@@ -49,7 +54,8 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -49,7 +54,8 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
private var questionStyleStr = "" private var questionStyleStr = ""
init { init {
val params = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) val params =
LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.im_view_collect_user_infomation, this) View.inflate(mContext, R.layout.im_view_collect_user_infomation, this)
orientation = VERTICAL orientation = VERTICAL
...@@ -64,9 +70,31 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -64,9 +70,31 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
} }
fun setData(list: List<UserQuestInfoBean>) { fun setData(list: List<UserQuestInfoBean>, hasCompleteInfoList: List<UserQuestInfoBean>?) {
resultInfoList.clear() resultInfoList.clear()
resultInfoList.addAll(list) resultInfoList.addAll(list)
if (hasCompleteInfoList != null && hasCompleteInfoList.isNotEmpty()) {
repeat(hasCompleteInfoList.size) {
if (TextUtils.equals("age", hasCompleteInfoList[it].userInfoType)) {
if (!TextUtils.isEmpty(hasCompleteInfoList[it].content)) {
hasAge = true
year = try {
hasCompleteInfoList[it].content!!.toInt()
} catch (e: Exception) {
1994
}
ageStr = "年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
}
}
if (TextUtils.equals("gener", hasCompleteInfoList[it].userInfoType)) {
if (!TextUtils.isEmpty(hasCompleteInfoList[it].content)) {
hasGender = true
genderStr = "性别:${hasCompleteInfoList[it].content}"
}
}
}
}
addContentView(resultInfoList[0].question!!, true) addContentView(resultInfoList[0].question!!, true)
proceedNext(list) proceedNext(list)
} }
...@@ -79,14 +107,18 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -79,14 +107,18 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
if (hasGender || hasAge) {
addContentView(resultInfoList[3].question!!, true)
currentIndex += 2
rl_question_style.visibility = View.VISIBLE
} else {
addContentView(resultInfoList[1].question!!, true) addContentView(resultInfoList[1].question!!, true)
tv_start.visibility = View.GONE
ll_gender.visibility = View.VISIBLE ll_gender.visibility = View.VISIBLE
} }
tv_start.visibility = View.GONE
}
//性别
tv_gender_male.setOnClickListener { tv_gender_male.setOnClickListener {
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
...@@ -116,8 +148,11 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -116,8 +148,11 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
} }
((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(2).visibility = View.GONE //年龄
((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(1).visibility = View.GONE ((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(2)
.visibility = View.GONE
((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(1)
.visibility = View.GONE
date_pick.init( date_pick.init(
year, year,
Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.MONTH),
...@@ -141,13 +176,17 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -141,13 +176,17 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}, 300) }, 300)
} }
if (list.size >= 3){ if (list.size >= 3) {
val adapter = CollectInfoStyleAdapter(list[3].answerList!!) { val adapter = CollectInfoStyleAdapter(list[3].answerList!!) {
addContentView(it, false) addContentView(it, false)
rl_question_style.postDelayed({ rl_question_style.postDelayed({
questionStyleStr = "咨询类型:${it}" questionStyleStr = "咨询类型:${it}"
addContentView(resultInfoList[currentIndex].question!!, true, resultInfoList[currentIndex].answerList!![0]) addContentView(
resultInfoList[currentIndex].question!!,
true,
resultInfoList[currentIndex].answerList!![0]
)
rl_question_style.visibility = View.GONE rl_question_style.visibility = View.GONE
ll_input.visibility = View.VISIBLE ll_input.visibility = View.VISIBLE
...@@ -162,7 +201,7 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -162,7 +201,7 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
val layoutManager = GridLayoutManager(mContext, 3) val layoutManager = GridLayoutManager(mContext, 3)
rl_question_style.layoutManager = layoutManager rl_question_style.layoutManager = layoutManager
rl_question_style.adapter = adapter rl_question_style.adapter = adapter
}else{ } else {
rl_question_style.visibility = View.GONE rl_question_style.visibility = View.GONE
} }
...@@ -191,16 +230,28 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -191,16 +230,28 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
//防止连击 //防止连击
return@setOnClickListener return@setOnClickListener
} }
val resultContent = ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr val resultContent =
ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr
val genderBean = UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1])
val ageBean = UserQuestInfoBean(list[2].userInfoType, "", ArrayList(),"${year}") val genderBean =
val questionStyleBean = UserQuestInfoBean(list[3].userInfoType, "", ArrayList(), questionStyleStr.split(":")[1]) UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1])
val questionBean = UserQuestInfoBean(list[4].userInfoType, "", ArrayList(), questionStr.split(":")[1]) val ageBean = UserQuestInfoBean(list[2].userInfoType, "", ArrayList(), "$year")
val questionStyleBean = UserQuestInfoBean(
list[3].userInfoType,
"",
ArrayList(),
questionStyleStr.split(":")[1]
)
val questionBean =
UserQuestInfoBean(list[4].userInfoType, "", ArrayList(), questionStr.split(":")[1])
val resultList = ArrayList<UserQuestInfoBean>() val resultList = ArrayList<UserQuestInfoBean>()
if (!hasGender) {
resultList.add(genderBean) resultList.add(genderBean)
}
if (!hasAge) {
resultList.add(ageBean) resultList.add(ageBean)
}
resultList.add(questionStyleBean) resultList.add(questionStyleBean)
resultList.add(questionBean) resultList.add(questionBean)
...@@ -212,11 +263,17 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -212,11 +263,17 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
@SuppressLint("RtlHardcoded") @SuppressLint("RtlHardcoded")
private fun addContentView(title: String, send: Boolean, subtitle: String = "") { private fun addContentView(title: String, send: Boolean, subtitle: String = "") {
val textView = TextView(mContext) val textView = TextView(mContext)
val params = LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params =
LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
params.topMargin = RxImageTool.dp2px(18f) params.topMargin = RxImageTool.dp2px(18f)
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17f) textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17f)
textView.setTextColor(Color.parseColor("#242424")) textView.setTextColor(Color.parseColor("#242424"))
textView.setPadding(RxImageTool.dp2px(13f), RxImageTool.dp2px(9f), RxImageTool.dp2px(13f), RxImageTool.dp2px(9f)) textView.setPadding(
RxImageTool.dp2px(13f),
RxImageTool.dp2px(9f),
RxImageTool.dp2px(13f),
RxImageTool.dp2px(9f)
)
if (send) { if (send) {
textView.setBackgroundResource(R.drawable.im_background_collect_info_left) textView.setBackgroundResource(R.drawable.im_background_collect_info_left)
params.gravity = Gravity.LEFT params.gravity = Gravity.LEFT
...@@ -227,8 +284,18 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -227,8 +284,18 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
if (!TextUtils.isEmpty(subtitle)) { if (!TextUtils.isEmpty(subtitle)) {
val resultText = "$title\n参考:\n$subtitle" val resultText = "$title\n参考:\n$subtitle"
val sbString = SpannableString(resultText) val sbString = SpannableString(resultText)
sbString.setSpan(ForegroundColorSpan(Color.parseColor("#999999")), title.length + 3, resultText.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) sbString.setSpan(
sbString.setSpan(AbsoluteSizeSpan(12, true), title.length, resultText.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) ForegroundColorSpan(Color.parseColor("#999999")),
title.length + 3,
resultText.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
sbString.setSpan(
AbsoluteSizeSpan(12, true),
title.length,
resultText.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
textView.text = sbString textView.text = sbString
textView.setLineSpacing(4f, 1f) textView.setLineSpacing(4f, 1f)
} else { } else {
......
...@@ -48,6 +48,12 @@ interface ServiceApi { ...@@ -48,6 +48,12 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//获取新用户收集的信息
@POST("user/getNewUserMes")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//信息采集的问题 //信息采集的问题
@POST("user/collect/submit") @POST("user/collect/submit")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
......
...@@ -64,6 +64,13 @@ class ServiceImpl private constructor() { ...@@ -64,6 +64,13 @@ class ServiceImpl private constructor() {
} }
/** /**
* 获取新用户收集的信息
*/
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes()
}
/**
* 上传采集的问题 * 上传采集的问题
*/ */
fun submitUserCollect(params: String): Observable<BaseAPIResponse<Any>> { fun submitUserCollect(params: String): Observable<BaseAPIResponse<Any>> {
......
...@@ -10,7 +10,6 @@ import android.text.Spanned ...@@ -10,7 +10,6 @@ import android.text.Spanned
import android.text.TextPaint import android.text.TextPaint
import android.text.method.LinkMovementMethod import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
...@@ -18,7 +17,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor ...@@ -18,7 +17,7 @@ import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.ui.login.H5Activity import com.yidianling.user.ui.login.H5Activity
import kotlinx.android.synthetic.main.user_activity_secret.* import kotlinx.android.synthetic.main.user_dialog_secret.*
class SecretDescriptionDialog( class SecretDescriptionDialog(
...@@ -30,7 +29,7 @@ class SecretDescriptionDialog( ...@@ -30,7 +29,7 @@ class SecretDescriptionDialog(
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.user_activity_secret) setContentView(R.layout.user_dialog_secret)
val params = window.attributes val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT params.width = WindowManager.LayoutParams.MATCH_PARENT
...@@ -65,14 +64,14 @@ class SecretDescriptionDialog( ...@@ -65,14 +64,14 @@ class SecretDescriptionDialog(
spannableString.setSpan( spannableString.setSpan(
object : ClickableSpan() { object : ClickableSpan() {
override fun onClick(widget: View?) { override fun onClick(widget: View?) {
if (Utils.isFastClick()){ if (Utils.isFastClick()) {
return return
} }
H5Activity.start(mContext, false) H5Activity.start(mContext, false)
} }
override fun updateDrawState(ds: TextPaint?) { override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF") ds?.color = Color.parseColor("#159CEF")
} }
}, 5, }, 5,
13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE 13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
...@@ -80,14 +79,14 @@ class SecretDescriptionDialog( ...@@ -80,14 +79,14 @@ class SecretDescriptionDialog(
spannableString.setSpan( spannableString.setSpan(
object : ClickableSpan() { object : ClickableSpan() {
override fun onClick(widget: View?) { override fun onClick(widget: View?) {
if (Utils.isFastClick()){ if (Utils.isFastClick()) {
return return
} }
H5Activity.start(mContext, true) H5Activity.start(mContext, true)
} }
override fun updateDrawState(ds: TextPaint?) { override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF") ds?.color = Color.parseColor("#159CEF")
} }
}, str.length - 8, }, str.length - 8,
str.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE str.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:myapp="http://schemas.android.com/apk/res-auto" android:background="#ffffff">
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="34dp"
android:layout_marginRight="34dp"
android:background="@drawable/user_secret_dialog_bg">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
myapp:pa_borderRadius="12dp"
myapp:pa_type="pa_round"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/user_secret_top_bg"/> android:src="@drawable/user_secret_top_bg" />
<RelativeLayout <RelativeLayout
android:id="@+id/user_top_rl" android:id="@+id/user_top_rl"
...@@ -34,37 +23,37 @@ ...@@ -34,37 +23,37 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginTop="40dp" android:layout_marginTop="40dp"
android:text="隐私政策" android:text="壹点灵"
android:textColor="#242424" android:textColor="#242424"
android:textSize="28dp" android:textSize="28dp"
android:textStyle="bold"/> android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/secrey_title" android:layout_below="@+id/secrey_title"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:text="及使用协议说明" android:text="隐私政策概要"
android:textColor="#242424" android:textColor="#242424"
android:textSize="28dp" android:textSize="28dp"
android:textStyle="bold"/> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout>
<RelativeLayout android:layout_width="match_parent" android:layout_height="194dp">
<ScrollView <ScrollView
android:layout_below="@+id/user_top_rl"
android:layout_alignBottom="@+id/secret_bottom_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="194dp" android:layout_height="wrap_content"
android:scrollbars="none" android:layout_marginBottom="42dp">
>
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginRight="25dp" android:layout_marginRight="25dp"
> android:orientation="vertical">
<TextView <TextView
android:id="@+id/user_secret_desc" android:id="@+id/user_secret_desc"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -78,94 +67,86 @@ ...@@ -78,94 +67,86 @@
4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n 4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n
5. 您可以查询、更正、删除您的个人信息。" 5. 您可以查询、更正、删除您的个人信息。"
android:textColor="#444444" android:textColor="#444444"
android:textSize="14dp"/> android:textSize="14dp" />
</RelativeLayout> </LinearLayout>
</ScrollView> </ScrollView>
<View
android:background="@drawable/user_secret_dectription_bg" <LinearLayout
android:id="@+id/secret_bottom_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_height="30dp"/> android:layout_marginBottom="185dp"
android:layout_marginLeft="@dimen/platform_dp_25">
</RelativeLayout> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="阅读完整版"
android:textColor="#444444"
android:textSize="14dp" />
<TextView
android:id="@+id/user_use_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="《用户使用协议》"
android:textColor="#159CEF"
android:textSize="14dp" />
<TextView <TextView
android:id="@+id/tv_content" android:layout_width="wrap_content"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:text="、"
android:layout_marginRight="25dp"
android:text="阅读完整版《用户使用协议》、《隐私保护政策》"
android:textColor="#444444" android:textColor="#444444"
android:textSize="14dp"/> android:textSize="14dp" />
<!--<TextView--> <TextView
<!--android:layout_width="wrap_content"--> android:id="@+id/user_secret_protect_btn"
<!--android:layout_height="wrap_content"--> android:layout_width="wrap_content"
<!--android:text="阅读完整版"--> android:layout_height="wrap_content"
<!--android:textColor="#444444"--> android:text="《隐私保护政策》"
<!--android:textSize="14dp"/>--> android:textColor="#159CEF"
android:textSize="14dp" />
<!--<TextView--> </LinearLayout>
<!--android:id="@+id/user_use_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《用户使用协议》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="、"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_secret_protect_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《隐私保护政策》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="24dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="25dp" android:layout_marginLeft="25dp"
android:layout_marginRight="25dp" android:layout_marginRight="25dp"
android:orientation="vertical" android:layout_marginBottom="40dp"
android:orientation="horizontal"
android:background="#ffffff"> android:background="#ffffff">
<TextView <TextView
android:id="@+id/user_secret_agree" android:id="@+id/user_secret_no_agree"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="44dp" android:layout_height="44dp"
android:layout_marginRight="5.5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg" android:background="@drawable/user_secret_left_btn_bg"
android:gravity="center" android:gravity="center"
android:text="同意并继续" android:text="不同意并退出"
android:textColor="#FFFFFF" android:textColor="#999999"
android:textSize="16dp"/> android:textSize="16dp" />
<TextView <TextView
android:id="@+id/user_secret_no_agree" android:id="@+id/user_secret_agree"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_gravity="center_horizontal" android:layout_height="44dp"
android:layout_height="wrap_content" android:layout_marginLeft="5.5dp"
android:layout_marginTop="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center" android:gravity="center"
android:text="仍不同意并退出" android:text="同意并继续"
android:textColor="#999999" android:textColor="#FFFFFF"
android:textSize="16dp"/> android:textSize="16dp" />
</LinearLayout> </LinearLayout>
</LinearLayout>
</LinearLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:myapp="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="34dp"
android:layout_marginRight="34dp"
android:background="@drawable/user_secret_dialog_bg">
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
myapp:pa_borderRadius="12dp"
myapp:pa_type="pa_round"
android:adjustViewBounds="true"
android:src="@drawable/user_secret_top_bg"/>
<RelativeLayout
android:id="@+id/user_top_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/secrey_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:text="隐私政策"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/secrey_title"
android:layout_marginLeft="25dp"
android:text="及使用协议说明"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout android:layout_width="match_parent" android:layout_height="194dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="194dp"
android:scrollbars="none"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
>
<TextView
android:id="@+id/user_secret_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:lineHeight="20dp"
tools:text="感谢您信任并使用壹点灵APP,\n
我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\n\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n
2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\n
3. 我们会采业界先进的安全措施保护您的信息安全;\n
4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n
5. 您可以查询、更正、删除您的个人信息。"
android:textColor="#444444"
android:textSize="14dp"/>
</RelativeLayout>
</ScrollView>
<View
android:background="@drawable/user_secret_dectription_bg"
android:layout_alignParentBottom="true"
android:layout_width="match_parent" android:layout_height="30dp"/>
</RelativeLayout>
<TextView
android:id="@+id/tv_content"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:text="阅读完整版《用户使用协议》、《隐私保护政策》"
android:textColor="#444444"
android:textSize="14dp"/>
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="阅读完整版"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_use_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《用户使用协议》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="、"-->
<!--android:textColor="#444444"-->
<!--android:textSize="14dp"/>-->
<!--<TextView-->
<!--android:id="@+id/user_secret_protect_btn"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="《隐私保护政策》"-->
<!--android:textColor="#159CEF"-->
<!--android:textSize="14dp"/>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="24dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:orientation="vertical"
android:background="#ffffff">
<TextView
android:id="@+id/user_secret_agree"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center"
android:text="同意并继续"
android:textColor="#FFFFFF"
android:textSize="16dp"/>
<TextView
android:id="@+id/user_secret_no_agree"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:gravity="center"
android:text="仍不同意并退出"
android:textColor="#999999"
android:textSize="16dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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