Commit 3e3acd10 by yjiucheng

Merge remote-tracking branch 'origin/隐私弹窗功能更新' into feature/image_picker

# Conflicts:
#	config.gradle
parents b60e5991 02110b90
......@@ -30,6 +30,8 @@ import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.widget.SecretDescriptionDialog
import com.yidianling.user.widget.SecretDialog
import kotlinx.android.synthetic.main.activity_main.*
/**
......@@ -85,7 +87,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.navigation()
}
bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
// ARouter.getInstance()
// .build("/consult/hot_search")
// .withString(
// HOT_SEARCH_DOCTOR_NAME,
......@@ -154,10 +156,38 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.navigation()
}
bt_to_home.setOnClickListener {
// FragmentContainerActivity.start(this, "YdlHomeFragment")
// FragmentContainerActivity.start(this, "YdlHomeFragment")
startActivity(Intent(this, TestAppActivity::class.java))
}
bt_to_test.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity, "感谢您信任并使用壹点灵APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。", object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() {
val secretDialog = SecretDialog(this@MainActivity, object : SecretDialog.OnSecretDialogListener {
override fun onCancel() {
ToastUtil.toastShort("onCancel")
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
})
secretDialog?.show()
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
}
)
dialog.show()
}
}
......
......@@ -185,6 +185,23 @@
android:layout_marginRight="10dp"
android:text="动态" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingLeft="40dp"
android:paddingRight="40dp"
android:paddingBottom="20dp">
<Button
android:id="@+id/bt_to_test"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="入口" />
</LinearLayout>
</LinearLayout>
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
......
......@@ -82,13 +82,13 @@ class SecretActivity : BaseActivity() {
agreeAction()
}
user_use_btn.setOnClickListener {
H5Activity.start(this@SecretActivity, false)
}
user_secret_protect_btn.setOnClickListener {
H5Activity.start(this@SecretActivity, true)
}
// user_use_btn.setOnClickListener {
// H5Activity.start(this@SecretActivity, false)
// }
//
// user_secret_protect_btn.setOnClickListener {
// H5Activity.start(this@SecretActivity, true)
// }
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
......
package com.yidianling.user.widget
import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.text.Html
import android.text.SpannableString
import android.text.Spanned
import android.text.TextPaint
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.user.R
import com.yidianling.user.ui.login.H5Activity
import kotlinx.android.synthetic.main.user_activity_secret.*
class SecretDescriptionDialog(
var mContext: Context,
var mSecretProtocolString: String,
private val listener: OnSecretDescriptionDialogListener?
) : Dialog(mContext, R.style.platform_dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_activity_secret)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
window.setGravity(Gravity.CENTER)
window.attributes = params
user_secret_desc.text = Html.fromHtml(mSecretProtocolString)
user_secret_no_agree.setOnClickListener {
listener?.onCancel()
}
user_secret_agree.setOnClickListener {
agreeAction()
}
val str = "阅读完整版《用户使用协议》、《隐私保护政策》"
val spannableString = SpannableString(str)
// spannableString.setSpan(
// ForegroundColorSpan(Color.parseColor("#159CEF")),
// 5,
// 13,
// Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
// )
// spannableString.setSpan(
// ForegroundColorSpan(Color.parseColor("#159CEF")),
// str.length - 8,
// str.length,
// Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
// )
spannableString.setSpan(
object : ClickableSpan() {
override fun onClick(widget: View?) {
if (Utils.isFastClick()){
return
}
H5Activity.start(mContext, false)
}
override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF")
}
}, 5,
13, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
spannableString.setSpan(
object : ClickableSpan() {
override fun onClick(widget: View?) {
if (Utils.isFastClick()){
return
}
H5Activity.start(mContext, true)
}
override fun updateDrawState(ds: TextPaint?) {
ds?.color=Color.parseColor("#159CEF")
}
}, str.length - 8,
str.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
tv_content.movementMethod = LinkMovementMethod.getInstance()
tv_content.highlightColor = Color.TRANSPARENT
tv_content.text = spannableString
}
private fun agreeAction() {
SharedPreferencesEditor.putString("hasAgreeSecret", "true")
listener?.onSure()
}
interface OnSecretDescriptionDialogListener {
fun onCancel()
fun onSure()
}
}
\ No newline at end of file
......@@ -5,10 +5,12 @@ import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.user.R
import kotlinx.android.synthetic.main.user_secret_dialog_layout.*
class SecretDialog(context: Context, private val listener: OnSecretDialogListener?): Dialog(context, R.style.platform_dialog_default_style) {
class SecretDialog(context: Context, private val listener: OnSecretDialogListener?) :
Dialog(context, R.style.platform_dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -22,14 +24,12 @@ class SecretDialog(context: Context, private val listener: OnSecretDialogListene
window.attributes = params
user_secret_dialog_agree.setOnClickListener {
listener?.onSure()
agreeAction()
}
user_secret_dialog_no_agree.setOnClickListener {
listener?.onCancel()
}
}
interface OnSecretDialogListener {
......@@ -37,5 +37,9 @@ class SecretDialog(context: Context, private val listener: OnSecretDialogListene
fun onSure()
}
private fun agreeAction() {
SharedPreferencesEditor.putString("hasAgreeSecret", "true")
listener?.onSure()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#E6FFFFFF" android:endColor="#00FFFFFF"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="#ffffff">
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">
<ImageView
<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" />
android:src="@drawable/user_secret_top_bg"/>
<RelativeLayout
android:id="@+id/user_top_rl"
......@@ -23,37 +34,37 @@
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:text="壹点灵"
android:text="隐私政策"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold" />
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:text="及使用协议说明"
android:textColor="#242424"
android:textSize="28dp"
android:textStyle="bold" />
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout android:layout_width="match_parent" android:layout_height="194dp">
<ScrollView
android:layout_below="@+id/user_top_rl"
android:layout_alignBottom="@+id/secret_bottom_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="42dp">
android:layout_height="194dp"
android:scrollbars="none"
>
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:orientation="vertical">
>
<TextView
android:id="@+id/user_secret_desc"
android:layout_width="match_parent"
......@@ -67,86 +78,94 @@
4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\n
5. 您可以查询、更正、删除您的个人信息。"
android:textColor="#444444"
android:textSize="14dp" />
android:textSize="14dp"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>
<LinearLayout
android:id="@+id/secret_bottom_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
<View
android:background="@drawable/user_secret_dectription_bg"
android:layout_alignParentBottom="true"
android:layout_marginBottom="185dp"
android:layout_marginLeft="@dimen/platform_dp_25">
android:layout_width="match_parent" android:layout_height="30dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="阅读完整版"
android:textColor="#444444"
android:textSize="14dp" />
</RelativeLayout>
<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:id="@+id/tv_content"
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="、"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
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: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:layout_marginBottom="40dp"
android:orientation="horizontal"
android:orientation="vertical"
android:background="#ffffff">
<TextView
android:id="@+id/user_secret_no_agree"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginRight="5.5dp"
android:layout_weight="1"
android:background="@drawable/user_secret_left_btn_bg"
android:gravity="center"
android:text="不同意并退出"
android:textColor="#999999"
android:textSize="16dp" />
<TextView
android:id="@+id/user_secret_agree"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginLeft="5.5dp"
android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center"
android:text="同意并继续"
android:textColor="#FFFFFF"
android:textSize="16dp" />
android:textSize="16dp"/>
</LinearLayout>
<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>
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -9,8 +9,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginLeft="34dp"
android:layout_marginRight="34dp"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@drawable/user_secret_dialog_bg">
......
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