Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
adc390cb
Commit
adc390cb
authored
Jul 16, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开发启动页隐私政策弹框
parent
fb767c4e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
200 additions
and
61 deletions
+200
-61
AndroidManifest.xml
CommonLib/Common/src/main/AndroidManifest.xml
+1
-0
PublicWebViewActivity.kt
...n/java/com/yidian/common/webview/PublicWebViewActivity.kt
+56
-0
PublicWebViewModel.kt
...main/java/com/yidian/common/webview/PublicWebViewModel.kt
+6
-0
activity_public_web_view.xml
...b/Common/src/main/res/layout/activity_public_web_view.xml
+53
-0
ManagerChangeActivity.kt
...huoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
+1
-1
FlashActivity.kt
...a/com/yidian/shenghuoquan/newscontent/ui/FlashActivity.kt
+52
-11
dialog_privacy.xml
...onents/newscontent/src/main/res/layout/dialog_privacy.xml
+29
-48
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+1
-0
www
Components/xbirdbusiness/src/main/assets/www
+1
-1
No files found.
CommonLib/Common/src/main/AndroidManifest.xml
View file @
adc390cb
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<service
android:name=
"com.amap.api.location.APSService"
/>
<service
android:name=
"com.amap.api.location.APSService"
/>
<!--高德地图配置 end -->
<!--高德地图配置 end -->
<activity
android:name=
".webview.PublicWebViewActivity"
/>
</application>
</application>
</manifest>
</manifest>
CommonLib/Common/src/main/java/com/yidian/common/webview/PublicWebViewActivity.kt
0 → 100644
View file @
adc390cb
package
com.yidian.common.webview
import
android.os.Build
import
android.webkit.WebChromeClient
import
android.webkit.WebSettings
import
android.webkit.WebView
import
androidx.activity.viewModels
import
com.yidian.common.R
import
com.yidian.common.databinding.ActivityPublicWebViewBinding
import
com.yidian.common.extensions.initTitleBar
import
com.yidian.common.mvvm.BaseMvvmActivity
class
PublicWebViewActivity
:
BaseMvvmActivity
<
ActivityPublicWebViewBinding
,
PublicWebViewModel
>()
{
override
val
layoutId
:
Int
=
R
.
layout
.
activity_public_web_view
override
val
vm
:
PublicWebViewModel
by
viewModels
()
override
fun
initView
()
{
val
url
=
intent
?.
getStringExtra
(
"url"
)
initTitleBar
(
binding
.
toolbar
,
binding
.
tvTitle
,
"声明"
)
initWebView
(
binding
.
webView
)
binding
.
webView
.
loadUrl
(
url
)
}
private
fun
initWebView
(
webView
:
WebView
)
{
// webView设置
webView
.
settings
.
apply
{
// 允许使用js
javaScriptEnabled
=
true
// 支持屏幕缩放
setSupportZoom
(
true
)
builtInZoomControls
=
true
// 缓存模式,不使用缓存
cacheMode
=
WebSettings
.
LOAD_NO_CACHE
// 支持混合模式
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
mixedContentMode
=
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
}
}
webView
.
webChromeClient
=
object
:
WebChromeClient
()
{
override
fun
onReceivedTitle
(
view
:
WebView
?,
title
:
String
?)
{
super
.
onReceivedTitle
(
view
,
title
)
if
(!
title
.
isNullOrBlank
())
{
initTitleBar
(
binding
.
toolbar
,
binding
.
tvTitle
,
title
)
}
}
}
}
// override fun onDestroy() {
// super.onDestroy()
// binding.webView.destroy()
// }
}
CommonLib/Common/src/main/java/com/yidian/common/webview/PublicWebViewModel.kt
0 → 100644
View file @
adc390cb
package
com.yidian.common.webview
import
com.yidian.common.mvvm.BaseViewModel
class
PublicWebViewModel
:
BaseViewModel
()
{
}
CommonLib/Common/src/main/res/layout/activity_public_web_view.xml
0 → 100644
View file @
adc390cb
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
>
<data>
<variable
name=
"vm"
type=
"com.yidian.common.webview.PublicWebViewModel"
/>
</data>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:fitsSystemWindows=
"true"
android:minHeight=
"50dp"
android:paddingStart=
"@dimen/dp15"
android:paddingEnd=
"@dimen/dp15"
app:layout_scrollFlags=
"scroll|enterAlways"
app:navigationIcon=
"@drawable/icon_back"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:textColor=
"#FF333333"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"标题"
/>
</androidx.appcompat.widget.Toolbar>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<WebView
android:id=
"@+id/webView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</FrameLayout>
</LinearLayout>
</layout>
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/personnel/ui/ManagerChangeActivity.kt
View file @
adc390cb
...
@@ -182,7 +182,7 @@ class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
...
@@ -182,7 +182,7 @@ class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
override
fun
onClick
(
widget
:
View
)
{
override
fun
onClick
(
widget
:
View
)
{
val
map
=
HashMap
<
String
,
String
>()
val
map
=
HashMap
<
String
,
String
>()
map
[
ProtocolActivity
.
ProtocolTitleKey
]
=
resources
.
getString
(
R
.
string
.
user_protocol
)
map
[
ProtocolActivity
.
ProtocolTitleKey
]
=
resources
.
getString
(
R
.
string
.
user_protocol
)
map
[
ProtocolActivity
.
ProtocolUrlKey
]
=
AppConfig
.
privacyPolicyStatement
map
[
ProtocolActivity
.
ProtocolUrlKey
]
=
AppConfig
.
userProtocol
XPageManager
.
push
(
XRouterPathConstants
.
PROTOCOL
,
map
)
XPageManager
.
push
(
XRouterPathConstants
.
PROTOCOL
,
map
)
}
}
},
28
,
33
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
},
28
,
33
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/FlashActivity.kt
View file @
adc390cb
...
@@ -2,16 +2,18 @@ package com.yidian.shenghuoquan.newscontent.ui
...
@@ -2,16 +2,18 @@ package com.yidian.shenghuoquan.newscontent.ui
import
android.app.AlertDialog
import
android.app.AlertDialog
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Color
import
android.text.*
import
android.text.method.LinkMovementMethod
import
android.text.style.ClickableSpan
import
android.view.View
import
android.view.View
import
android.widget.TextView
import
android.widget.TextView
import
com.orhanobut.hawk.Hawk
import
com.orhanobut.hawk.Hawk
import
com.yidian.common.BaseInitConfig
import
com.yidian.common.*
import
com.yidian.common.HawkConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.FLASH
import
com.yidian.common.XRouterPathConstants.Companion.FLASH
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.services.AppUpgradeService
import
com.yidian.common.services.AppUpgradeService
import
com.yidian.common.webview.PublicWebViewActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityFlashBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityFlashBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.ApiService
...
@@ -44,12 +46,13 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
...
@@ -44,12 +46,13 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
* 检查隐私协议是否同意
* 检查隐私协议是否同意
*/
*/
private
fun
checkPrivacyIsAgreed
()
{
private
fun
checkPrivacyIsAgreed
()
{
val
isAgree
=
Hawk
.
get
(
HawkConfig
.
ProtocolIsAgree
,
false
)
// val isAgree = Hawk.get(HawkConfig.ProtocolIsAgree, false)
if
(
isAgree
)
{
// if (isAgree) {
toLoginOrHome
()
// toLoginOrHome()
}
else
{
// } else {
showPrivacyDialog
()
// showPrivacyDialog()
}
// }
showPrivacyDialog
()
}
}
/**
/**
...
@@ -79,12 +82,15 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
...
@@ -79,12 +82,15 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
private
fun
showPrivacyDialog
()
{
private
fun
showPrivacyDialog
()
{
val
builder
=
AlertDialog
.
Builder
(
this
,
R
.
style
.
NoTitleDialog
)
val
builder
=
AlertDialog
.
Builder
(
this
,
R
.
style
.
NoTitleDialog
)
val
updateDialog
=
View
.
inflate
(
this
,
R
.
layout
.
dialog_privacy
,
null
)
val
updateDialog
=
View
.
inflate
(
this
,
R
.
layout
.
dialog_privacy
,
null
)
val
tvContent
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_
update_content
)
val
tvContent
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_
privacy_tips
)
val
btnCancel
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_cancel
)
val
btnCancel
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_cancel
)
val
btnEnsure
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_sure
)
val
btnEnsure
=
updateDialog
.
findViewById
<
TextView
>(
R
.
id
.
tv_sure
)
builder
.
setView
(
updateDialog
)
builder
.
setView
(
updateDialog
)
builder
.
setCancelable
(
false
)
builder
.
setCancelable
(
false
)
builder
.
create
()
builder
.
create
()
// 提示内容
initUserProtocol
(
tvContent
)
// 取消按钮
// 取消按钮
btnCancel
.
setOnClickListener
{
btnCancel
.
setOnClickListener
{
dismissPrivacyDialog
()
dismissPrivacyDialog
()
...
@@ -100,6 +106,41 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
...
@@ -100,6 +106,41 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
builder
.
show
()
builder
.
show
()
}
}
private
fun
initUserProtocol
(
textView
:
TextView
)
{
val
span
=
SpannableString
(
resources
.
getString
(
R
.
string
.
privacy_tips
))
span
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
super
.
updateDrawState
(
ds
)
ds
.
color
=
Color
.
parseColor
(
"#1852F1"
);
ds
.
isUnderlineText
=
false
;
// 去掉下划线
}
override
fun
onClick
(
widget
:
View
)
{
val
intent
=
Intent
(
this
@FlashActivity
,
PublicWebViewActivity
::
class
.
java
)
intent
.
putExtra
(
"url"
,
AppConfig
.
userProtocol
)
startActivity
(
intent
)
}
},
19
,
25
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
span
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
super
.
updateDrawState
(
ds
)
ds
.
color
=
Color
.
parseColor
(
"#1852F1"
);
ds
.
isUnderlineText
=
false
;
// 去掉下划线
ds
.
clearShadowLayer
();
//清除阴影
}
override
fun
onClick
(
widget
:
View
)
{
val
intent
=
Intent
(
this
@FlashActivity
,
PublicWebViewActivity
::
class
.
java
)
intent
.
putExtra
(
"url"
,
AppConfig
.
privacyPolicyStatement
)
startActivity
(
intent
)
}
},
26
,
32
,
Spannable
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
textView
.
setLinkTextColor
(
Color
.
TRANSPARENT
)
textView
.
setHintTextColor
(
resources
.
getColor
(
R
.
color
.
transparent
))
//设置点击后的颜色为透明,否则会一直出现高亮
textView
.
append
(
span
)
textView
.
movementMethod
=
LinkMovementMethod
.
getInstance
()
//开始响应点击事件
}
/**
/**
* 关闭弹框
* 关闭弹框
*/
*/
...
...
Components/newscontent/src/main/res/layout/dialog_privacy.xml
View file @
adc390cb
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:background=
"@color/transparent"
android:background=
"@color/transparent"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<LinearLayout
<LinearLayout
android:layout_width=
"275dp"
android:layout_width=
"280dp"
android:layout_height=
"109dp"
android:background=
"@drawable/icon_life_account_select"
android:orientation=
"vertical"
android:paddingStart=
"15dp"
android:paddingTop=
"15dp"
android:paddingEnd=
"15dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"隐私协议声明"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"275dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_person_bg"
android:background=
"@drawable/shape_person_bg"
android:orientation=
"vertical"
android:orientation=
"vertical"
>
android:paddingStart=
"15dp"
android:paddingEnd=
"15dp"
android:paddingBottom=
"15dp"
>
<TextView
<TextView
android:id=
"@+id/tv_privacy_tips"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"新版本说明:"
android:padding=
"@dimen/dp20"
android:textColor=
"#292626"
tools:text=
"@string/privacy_tips"
android:textColor=
"#000000"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<TextView
<View
android:id=
"@+id/tv_update_content"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"1px"
android:text=
"1.优化首页按钮、地址导航标题地址导航\n2.首页按钮导航标题地址导航"
android:background=
"#979797"
/>
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"@dimen/dp48"
android:layout_marginTop=
"@dimen/dp10"
android:gravity=
"center"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
android:id=
"@+id/tv_cancel"
android:id=
"@+id/tv_cancel"
android:layout_width=
"105dp"
android:layout_width=
"0dp"
android:layout_height=
"27dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"取消"
android:text=
"暂不使用"
android:textColor=
"#03A9F4"
android:textColor=
"@color/color_333333"
android:textSize=
"12sp"
/>
android:textSize=
"16sp"
/>
<View
android:layout_width=
"1px"
android:layout_height=
"match_parent"
android:background=
"#979797"
/>
<TextView
<TextView
android:id=
"@+id/tv_sure"
android:id=
"@+id/tv_sure"
android:layout_width=
"105dp"
android:layout_width=
"0dp"
android:layout_height=
"27dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"同意"
android:text=
"同意"
android:textColor=
"#03A9F4"
android:textColor=
"#1852F1"
android:textSize=
"12sp"
/>
android:textSize=
"16sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
Components/newscontent/src/main/res/values/strings.xml
View file @
adc390cb
...
@@ -104,6 +104,7 @@
...
@@ -104,6 +104,7 @@
<string
name=
"agree"
>
我同意
</string>
<string
name=
"agree"
>
我同意
</string>
<string
name=
"privacy_policy"
>
《隐私政策》
</string>
<string
name=
"privacy_policy"
>
《隐私政策》
</string>
<string
name=
"user_agreement"
>
《用户协议》
</string>
<string
name=
"user_agreement"
>
《用户协议》
</string>
<string
name=
"privacy_tips"
>
欢迎您使用生活圈商家版!您可以通过阅读《用户协议》与《隐私政策》帮助您了解我们收集、使用、存储和共享个人信息的情况,以及您所享有的相关权利。
</string>
<string
name=
"auth_finish"
>
完成认证
</string>
<string
name=
"auth_finish"
>
完成认证
</string>
<string
name=
"enterprise_qualification"
>
企业资质
</string>
<string
name=
"enterprise_qualification"
>
企业资质
</string>
<string
name=
"enterprise_manager"
>
经营者
</string>
<string
name=
"enterprise_manager"
>
经营者
</string>
...
...
www
@
91a83eef
Subproject commit
8b28605769210f30bfd671011c0effb9c4bade42
Subproject commit
91a83eef2caab22ebd8bd063ec2aab43a22cf6ba
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment