Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
eggsxiaoxiaole
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangjunhui
eggsxiaoxiaole
Commits
28306d9c
Commit
28306d9c
authored
Aug 27, 2020
by
huangjunhui
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
33ff8a24
6a663667
Pipeline
#417
canceled with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
15 deletions
+161
-15
GuildDialog.kt
app/src/main/java/com/zxhl/game/ysdzz/GuildDialog.kt
+143
-0
SplashActivity.kt
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.kt
+15
-12
Center2Dialog.kt
...src/main/java/com/zxhl/task/module/utils/Center2Dialog.kt
+1
-1
SDialog.kt
task/src/main/java/com/zxhl/task/module/utils/SDialog.kt
+1
-1
dialog_privacy_protocol_view.xml
task/src/main/res/layout/dialog_privacy_protocol_view.xml
+1
-1
No files found.
app/src/main/java/com/zxhl/game/ysdzz/GuildDialog.kt
0 → 100644
View file @
28306d9c
package
com.zxhl.game.ysdzz
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.graphics.Color
import
android.text.SpannableStringBuilder
import
android.text.Spanned
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.widget.TextView
import
com.zxhl.library.AppliContext
import
com.zxhl.library.net.NetConfig
import
com.zxhl.library.utils.JumpUtils
import
com.zxhl.library.utils.PhoneUtils
import
com.zxhl.task.R
class
GuildDialog
{
/**
* 隐私协议弹窗
*/
fun
showPrivacyProtocol
(
activity
:
Activity
,
disagreelistener
:
View
.
OnClickListener
,
agreelistener
:
View
.
OnClickListener
?)
{
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_privacy_protocol_view
,
activity
,
mDialog
,
0
,
Gravity
.
CENTER
)
val
content
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_dialog_privacy_protocol_content
)
val
desc
=
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_dialog_privacy_protocol_desc
)
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
cancel_button
)
.
setOnClickListener
{
activity
.
finish
()
}
val
clickUa
:
ClickableSpan
=
object
:
ClickableSpan
()
{
override
fun
onClick
(
widget
:
View
)
{
JumpUtils
.
h5Jump
(
"隐私政策"
,
NetConfig
.
H5
.
WEB_URL_PRIVACY
)
}
}
val
clickPrivat
:
ClickableSpan
=
object
:
ClickableSpan
()
{
override
fun
onClick
(
widget
:
View
)
{
JumpUtils
.
h5Jump
(
"用户协议"
,
NetConfig
.
H5
.
WEB_URL_USER
)
}
}
// 《隐私政策》和《用户协议》,请您在使用前仔细阅读并了解
val
descStr
=
SpannableStringBuilder
(
"您点击“同意”,即表示您阅读并同意更新后的《用户协议》和《隐私政策》"
)
descStr
.
setSpan
(
clickPrivat
,
22
,
26
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr
.
setSpan
(
clickUa
,
29
,
descStr
.
length
-
1
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#44a1ff"
)),
21
,
27
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#44a1ff"
)),
29
,
descStr
.
length
-
1
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
desc
.
text
=
descStr
desc
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
val
str
=
"欢迎使用彩蛋消消乐!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val
ss
=
SpannableStringBuilder
(
"查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。"
)
ss
.
setSpan
(
clickPrivat
,
4
,
10
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
ss
.
setSpan
(
clickUa
,
12
,
16
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
ss
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#44a1ff"
)),
4
,
10
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
ss
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#44a1ff"
)),
12
,
16
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
content
.
append
(
str
)
content
.
append
(
ss
)
content
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
privacy_protocol_button
).
setOnClickListener
{
mDialog
.
dismiss
()
agreelistener
?.
onClick
(
it
)
}
mDialog
.
findViewById
<
TextView
>(
R
.
id
.
cancel_button
).
setOnClickListener
{
mDialog
.
dismiss
()
disagreelistener
?.
onClick
(
it
)
}
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
show
()
}
fun
showBottomDialog
(
layout
:
Int
,
activity
:
Context
,
setHeadDialog
:
Dialog
,
animation
:
Int
,
gravity
:
Int
):
View
{
// AlertDialog setHeadDialog = new AlertDialog.Builder(activity).create();
// setHeadDialog.show();
val
mDialogView
=
View
.
inflate
(
activity
,
layout
,
null
)
setHeadDialog
.
setContentView
(
mDialogView
)
val
window
=
setHeadDialog
.
window
// window.setContentView(mDialogView);
window
?.
setGravity
(
gravity
)
// window.setWindowAnimations(R.style.AnimBottom)
// WindowManager windowManager = activity.getWindowManager();
// Display display = windowManager.getDefaultDisplay();
val
lp
=
window
?.
attributes
window
?.
decorView
?.
setPadding
(
0
,
0
,
0
,
0
)
// 设置宽度
//Point size = new Point();
//display.getSize(size);
//lp.width = size.x;
lp
?.
width
=
PhoneUtils
.
getScreenWidth
(
AppliContext
.
get
())
if
(
gravity
==
Gravity
.
TOP
)
{
lp
?.
height
=
PhoneUtils
.
getScreenHeight
(
AppliContext
.
get
())
}
//lp.width = (int) (display.getWidth()); // 设置宽度方式二: @过时
//window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,0);
window
?.
attributes
=
lp
if
(
animation
>
0
)
window
?.
setWindowAnimations
(
animation
)
//设置动画
return
mDialogView
}
}
\ No newline at end of file
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.kt
View file @
28306d9c
...
@@ -9,6 +9,7 @@ import androidx.core.app.ActivityCompat
...
@@ -9,6 +9,7 @@ import androidx.core.app.ActivityCompat
import
com.bytedance.sdk.openadsdk.TTSplashAd
import
com.bytedance.sdk.openadsdk.TTSplashAd
import
com.zxhl.detector.news.SplashContract
import
com.zxhl.detector.news.SplashContract
import
com.zxhl.game.ysdzz.ADConfig.AD_SPLASH
import
com.zxhl.game.ysdzz.ADConfig.AD_SPLASH
import
com.zxhl.game.ysdzz.GuildDialog
import
com.zxhl.game.ysdzz.R
import
com.zxhl.game.ysdzz.R
import
com.zxhl.library.Constant
import
com.zxhl.library.Constant
import
com.zxhl.library.config.AdManager.loadSplashAd
import
com.zxhl.library.config.AdManager.loadSplashAd
...
@@ -47,20 +48,22 @@ class SplashActivity : BaseActivity(), SplashContract.View {
...
@@ -47,20 +48,22 @@ class SplashActivity : BaseActivity(), SplashContract.View {
//TODO 加载开屏广告
//TODO 加载开屏广告
Log
.
e
(
"huang"
,
"广告展现 开始"
+
System
.
currentTimeMillis
())
Log
.
e
(
"huang"
,
"广告展现 开始"
+
System
.
currentTimeMillis
())
if
(
SettingPreference
.
isFirst
())
{
if
(
SettingPreference
.
isFirst
())
{
//tipDialog();
GuildDialog
().
showPrivacyProtocol
(
// Center2Dialog.showPrivacyProtocol(this, View.OnClickListener { finish() }, View.OnClickListener {
this
,
SettingPreference
.
setIsFirst
(
false
)
View
.
OnClickListener
{
finish
()
},
if
(
Constant
.
is_first_load_splash_ad
==
0
)
{
View
.
OnClickListener
{
startMain
()
SettingPreference
.
setIsFirst
(
false
)
// return@OnClickListener
if
(
Constant
.
is_first_load_splash_ad
==
0
)
{
}
else
{
startMain
()
loadSplash
()
return
@OnClickListener
}
else
{
loadSplash
()
}
}
}
}
)
// )
}
else
{
// } else {
loadSplash
()
loadSplash
()
//
}
}
}
}
private
fun
loadSplash
()
{
private
fun
loadSplash
()
{
...
...
task/src/main/java/com/zxhl/task/module/utils/Center2Dialog.kt
View file @
28306d9c
...
@@ -699,7 +699,7 @@ object Center2Dialog : BaseDialog() {
...
@@ -699,7 +699,7 @@ object Center2Dialog : BaseDialog() {
desc
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
desc
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
val
str
=
"欢迎使用
趣味来电
!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val
str
=
"欢迎使用
彩蛋消消乐
!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val
ss
=
SpannableStringBuilder
(
"查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。"
)
val
ss
=
SpannableStringBuilder
(
"查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。"
)
ss
.
setSpan
(
ss
.
setSpan
(
...
...
task/src/main/java/com/zxhl/task/module/utils/SDialog.kt
View file @
28306d9c
...
@@ -68,7 +68,7 @@ object SDialog{
...
@@ -68,7 +68,7 @@ object SDialog{
desc
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
desc
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
val
str
=
"欢迎使用
趣味来电
!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val
str
=
"欢迎使用
彩蛋消消乐
!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val
ss
=
SpannableStringBuilder
(
"查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。"
)
val
ss
=
SpannableStringBuilder
(
"查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。"
)
ss
.
setSpan
(
ss
.
setSpan
(
...
...
task/src/main/res/layout/dialog_privacy_protocol_view.xml
View file @
28306d9c
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
android:layout_marginRight=
"16dp"
android:layout_marginRight=
"16dp"
android:textSize=
"15sp"
android:textSize=
"15sp"
android:textColor=
"#666666"
android:textColor=
"#666666"
android:text=
"我们依据最新法律,向您说明
趣味来电\n
软件的隐私政策,特向您推送本提示,\n请您阅读并充分理解相关条款。"
/>
android:text=
"我们依据最新法律,向您说明
彩蛋消消乐
软件的隐私政策,特向您推送本提示,\n请您阅读并充分理解相关条款。"
/>
<TextView
<TextView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
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