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
2e8a1fd5
Commit
2e8a1fd5
authored
Aug 27, 2020
by
huangjunhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改splash
parent
8f049419
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
589 additions
and
215 deletions
+589
-215
build.gradle
app/build.gradle
+1
-0
GameActivity.kt
app/src/main/java/com/zxhl/game/ysdzz/ui/GameActivity.kt
+6
-0
GamePauseActivity.kt
...src/main/java/com/zxhl/game/ysdzz/ui/GamePauseActivity.kt
+3
-2
SplashActivity.java
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.java
+0
-172
SplashActivity.kt
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.kt
+144
-0
NetConfig.java
library/src/main/java/com/zxhl/library/net/NetConfig.java
+6
-2
NewWebActivity.kt
...main/java/com/zxhl/task/module/activity/NewWebActivity.kt
+4
-4
RedPackageActivity.kt
.../java/com/zxhl/task/module/activity/RedPackageActivity.kt
+2
-2
WebActivity.kt
...rc/main/java/com/zxhl/task/module/activity/WebActivity.kt
+3
-8
CoinCrashFragment.kt
...in/java/com/zxhl/task/module/caiyuan/CoinCrashFragment.kt
+8
-3
GameTaskActivity.kt
...ain/java/com/zxhl/task/module/caiyuan/GameTaskActivity.kt
+5
-5
RedCrashFragment.kt
...ain/java/com/zxhl/task/module/caiyuan/RedCrashFragment.kt
+7
-3
ScratchCardActivity.kt
...xhl/task/module/luckydraw/activity/ScratchCardActivity.kt
+2
-2
LuckyAdFragment.kt
...om/zxhl/task/module/luckydraw/fragment/LuckyAdFragment.kt
+2
-2
SlotMachineFragment.kt
...xhl/task/module/luckydraw/fragment/SlotMachineFragment.kt
+5
-5
Center2Dialog.kt
...src/main/java/com/zxhl/task/module/utils/Center2Dialog.kt
+102
-5
SDialog.kt
task/src/main/java/com/zxhl/task/module/utils/SDialog.kt
+133
-0
shape_00c98d_r6.xml
task/src/main/res/drawable/shape_00c98d_r6.xml
+5
-0
dialog_privacy_protocol_view.xml
task/src/main/res/layout/dialog_privacy_protocol_view.xml
+151
-0
No files found.
app/build.gradle
View file @
2e8a1fd5
...
@@ -147,5 +147,6 @@ dependencies {
...
@@ -147,5 +147,6 @@ dependencies {
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
implementation
project
(
path:
':task'
)
implementation
project
(
path:
':task'
)
implementation
project
(
path:
':game'
)
implementation
project
(
path:
':game'
)
implementation
project
(
path:
':library'
)
}
}
app/src/main/java/com/zxhl/game/ysdzz/ui/GameActivity.kt
View file @
2e8a1fd5
...
@@ -114,6 +114,12 @@ class GameActivity : UnityPlayerActivity() {
...
@@ -114,6 +114,12 @@ class GameActivity : UnityPlayerActivity() {
EventUtils
.
onEvent
(
action
)
EventUtils
.
onEvent
(
action
)
}
}
// TODO 事件上传
fun
eventAction
(
action
:
String
,
value
:
String
){
EventUtils
.
onEvent
(
action
,
value
)
}
//TODO 闯关红包 配置list
//TODO 闯关红包 配置list
fun
getCompleteRedList
(){
fun
getCompleteRedList
(){
ApiClient
.
taskApi
.
getCompleteList
()
ApiClient
.
taskApi
.
getCompleteList
()
...
...
app/src/main/java/com/zxhl/game/ysdzz/ui/GamePauseActivity.kt
View file @
2e8a1fd5
...
@@ -13,6 +13,7 @@ import com.zxhl.library.config.ZXADSizeConfig
...
@@ -13,6 +13,7 @@ import com.zxhl.library.config.ZXADSizeConfig
import
com.zxhl.library.listener.ZXADExpressListener
import
com.zxhl.library.listener.ZXADExpressListener
import
com.zxhl.library.module.NewsEntity
import
com.zxhl.library.module.NewsEntity
import
com.zxhl.library.net.BaseActivity
import
com.zxhl.library.net.BaseActivity
import
com.zxhl.library.net.NetConfig
import
com.zxhl.library.utils.JumpUtils
import
com.zxhl.library.utils.JumpUtils
import
com.zxhl.library.utils.PhoneUtils
import
com.zxhl.library.utils.PhoneUtils
import
com.zxhl.library.utils.Utils
import
com.zxhl.library.utils.Utils
...
@@ -82,11 +83,11 @@ class GamePauseActivity :BaseActivity() {
...
@@ -82,11 +83,11 @@ class GamePauseActivity :BaseActivity() {
}
}
//隐私协议
//隐私协议
secret_agreement
.
setOnClickListener
(
View
.
OnClickListener
{
secret_agreement
.
setOnClickListener
(
View
.
OnClickListener
{
JumpUtils
.
h5Jump
(
"隐私协议"
,
"https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/privacy.html"
);
JumpUtils
.
h5Jump
(
"隐私协议"
,
NetConfig
.
H5
.
WEB_URL_PRIVACY
);
})
})
//用户协议
//用户协议
user_agreement
.
setOnClickListener
(
View
.
OnClickListener
{
user_agreement
.
setOnClickListener
(
View
.
OnClickListener
{
JumpUtils
.
h5Jump
(
"
隐私协议"
,
"https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/user.html"
);
JumpUtils
.
h5Jump
(
"
用户协议"
,
NetConfig
.
H5
.
WEB_URL_USER
);
})
})
}
}
...
...
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.java
deleted
100644 → 0
View file @
8f049419
package
com
.
zxhl
.
game
.
ysdzz
.
ui
;
import
android.app.AlertDialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.util.Log
;
import
android.widget.FrameLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.ActivityCompat
;
import
com.bytedance.sdk.openadsdk.TTSplashAd
;
import
com.zxhl.detector.news.SplashContract
;
import
com.zxhl.game.ysdzz.ADConfig
;
import
com.zxhl.game.ysdzz.MainActivity
;
import
com.zxhl.game.ysdzz.R
;
import
com.zxhl.library.Constant
;
import
com.zxhl.library.config.AdManager
;
import
com.zxhl.library.listener.ZXADSplashListener
;
import
com.zxhl.library.module.NewsEntity
;
import
com.zxhl.library.net.BaseActivity
;
import
com.zxhl.library.net.PermissionsActivity
;
import
com.zxhl.library.net.SplashPresenter
;
import
com.zxhl.library.utils.EventUtils
;
import
com.zxhl.library.utils.SettingPreference
;
import
org.jetbrains.annotations.NotNull
;
public
class
SplashActivity
extends
BaseActivity
implements
SplashContract
.
View
{
private
SplashPresenter
mPresenter
;
private
TextView
tv_skipview
;
private
FrameLayout
splash_container
;
@Override
public
int
layoutID
()
{
return
R
.
layout
.
splash_layout
;
}
@Override
public
void
init
()
{
EventUtils
.
INSTANCE
.
onEvent
(
"app_start"
);
tv_skipview
=
findViewById
(
R
.
id
.
tv_skipview
);
splash_container
=
findViewById
(
R
.
id
.
splash_container
);
mPresenter
=
new
SplashPresenter
(
this
,
this
);
mPresenter
.
checkPermissions
();
//检测权限
// Intent intent
// = new Intent(this,GamePauseActivity.class);
// startActivity(intent);
}
@Override
public
void
jumpPage
()
{
//TODO 加载开屏广告
Log
.
e
(
"huang"
,
"广告展现 开始"
+
System
.
currentTimeMillis
());
if
(
SettingPreference
.
isFirst
()){
//tipDialog();
SettingPreference
.
setIsFirst
(
false
);
if
(
Constant
.
is_first_load_splash_ad
==
0
){
startMain
();
return
;
}
}
AdManager
.
INSTANCE
.
loadSplashAd
(
this
,
ADConfig
.
INSTANCE
.
getAD_SPLASH
(),
tv_skipview
,
splash_container
,
new
ZXADSplashListener
()
{
@Override
public
void
onSuccessResult
()
{
}
@Override
public
void
onFailResult
(
@NotNull
String
result
)
{
startMain
();
}
@Override
public
void
onTimeout
()
{
startMain
();
}
@Override
public
void
onErrorResult
(
@NotNull
String
s
)
{
startMain
();
}
@Override
public
void
onSplashAdLoad
(
@NotNull
TTSplashAd
ad
)
{
}
@Override
public
void
onAdClicked
(
@NotNull
NewsEntity
data
)
{
}
@Override
public
void
onAdShow
(
@NotNull
NewsEntity
data
)
{
}
@Override
public
void
onAdSkip
()
{
startMain
();
}
@Override
public
void
onAdTimeOver
()
{
startMain
();
}
});
}
//隐私协议
public
void
tipDialog
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setTitle
(
"协议"
);
builder
.
setMessage
(
"111111111111111111111111111111111111111111111111111111111111111111111111"
);
builder
.
setIcon
(
R
.
mipmap
.
ic_launcher
);
builder
.
setCancelable
(
false
);
//点击对话框以外的区域是否让对话框消失
//设置正面按钮
builder
.
setPositiveButton
(
"同意"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
//设置反面按钮
builder
.
setNegativeButton
(
"取消"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
finish
();
}
});
AlertDialog
dialog
=
builder
.
create
();
//创建AlertDialog对象
//对话框显示的监听事件
dialog
.
setOnShowListener
(
new
DialogInterface
.
OnShowListener
()
{
@Override
public
void
onShow
(
DialogInterface
dialog
)
{
}
});
//对话框消失的监听事件
dialog
.
setOnCancelListener
(
new
DialogInterface
.
OnCancelListener
()
{
@Override
public
void
onCancel
(
DialogInterface
dialog
)
{
}
});
dialog
.
show
();
//显示对话框
}
private
long
startTime
=
0L
;
//防止两次点击
private
void
startMain
()
{
//用户点击了 跳过按钮 .......
if
(
System
.
currentTimeMillis
()-
startTime
>
2000
){
startTime
=
System
.
currentTimeMillis
();
Intent
intent
=
new
Intent
(
SplashActivity
.
this
,
GameActivity
.
class
);
startActivity
(
intent
);
finish
();
}
}
@Override
public
void
jumpPermissionsPage
()
{
Intent
intent
=
new
Intent
(
this
,
PermissionsActivity
.
class
);
intent
.
putExtra
(
PermissionsActivity
.
EXTRA_PERMISSIONS
,
SplashPresenter
.
Companion
.
getPERMISSIONS
());
ActivityCompat
.
startActivityForResult
(
this
,
intent
,
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
,
null
);
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
startMain
();
}
else
{
mPresenter
.
getAppConfig
();
}
}
@Override
public
boolean
getDestroyed
()
{
return
false
;
}
}
app/src/main/java/com/zxhl/game/ysdzz/ui/SplashActivity.kt
0 → 100644
View file @
2e8a1fd5
package
com.zxhl.game.ysdzz.ui
import
android.content.Intent
import
android.util.Log
import
android.view.View
import
android.widget.FrameLayout
import
android.widget.TextView
import
androidx.core.app.ActivityCompat
import
com.bytedance.sdk.openadsdk.TTSplashAd
import
com.zxhl.detector.news.SplashContract
import
com.zxhl.game.ysdzz.ADConfig.AD_SPLASH
import
com.zxhl.game.ysdzz.R
import
com.zxhl.library.Constant
import
com.zxhl.library.config.AdManager.loadSplashAd
import
com.zxhl.library.listener.ZXADSplashListener
import
com.zxhl.library.module.NewsEntity
import
com.zxhl.library.net.BaseActivity
import
com.zxhl.library.net.PermissionsActivity
import
com.zxhl.library.net.SplashPresenter
import
com.zxhl.library.net.SplashPresenter.Companion.PERMISSIONS
import
com.zxhl.library.utils.EventUtils.onEvent
import
com.zxhl.library.utils.SettingPreference
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
private
var
mPresenter
:
SplashPresenter
?
=
null
private
var
tv_skipview
:
TextView
?
=
null
private
var
splash_container
:
FrameLayout
?
=
null
override
fun
layoutID
():
Int
{
return
R
.
layout
.
splash_layout
}
override
fun
init
()
{
onEvent
(
"app_start"
)
tv_skipview
=
findViewById
(
R
.
id
.
tv_skipview
)
splash_container
=
findViewById
(
R
.
id
.
splash_container
)
mPresenter
=
SplashPresenter
(
this
,
this
)
mPresenter
!!
.
checkPermissions
()
//检测权限
// Intent intent
// = new Intent(this,GamePauseActivity.class);
// startActivity(intent);
}
override
fun
jumpPage
()
{
//TODO 加载开屏广告
Log
.
e
(
"huang"
,
"广告展现 开始"
+
System
.
currentTimeMillis
())
if
(
SettingPreference
.
isFirst
())
{
//tipDialog();
// Center2Dialog.showPrivacyProtocol(this, View.OnClickListener { finish() }, View.OnClickListener {
SettingPreference
.
setIsFirst
(
false
)
if
(
Constant
.
is_first_load_splash_ad
==
0
)
{
startMain
()
// return@OnClickListener
}
else
{
loadSplash
()
}
}
// )
// } else {
loadSplash
()
// }
}
private
fun
loadSplash
()
{
loadSplashAd
(
this
,
AD_SPLASH
,
tv_skipview
,
splash_container
!!
,
object
:
ZXADSplashListener
{
override
fun
onSuccessResult
()
{}
override
fun
onFailResult
(
result
:
String
)
{
startMain
()
}
override
fun
onTimeout
()
{
startMain
()
}
override
fun
onErrorResult
(
s
:
String
)
{
startMain
()
}
override
fun
onSplashAdLoad
(
ad
:
TTSplashAd
)
{}
override
fun
onAdClicked
(
data
:
NewsEntity
)
{}
override
fun
onAdShow
(
data
:
NewsEntity
)
{}
override
fun
onAdSkip
()
{
startMain
()
}
override
fun
onAdTimeOver
()
{
startMain
()
}
})
}
private
var
startTime
=
0L
//防止两次点击
private
fun
startMain
()
{
//用户点击了 跳过按钮 .......
if
(
System
.
currentTimeMillis
()
-
startTime
>
2000
)
{
startTime
=
System
.
currentTimeMillis
()
val
intent
=
Intent
(
this
@SplashActivity
,
GameActivity
::
class
.
java
)
startActivity
(
intent
)
finish
()
}
}
override
fun
jumpPermissionsPage
()
{
val
intent
=
Intent
(
this
,
PermissionsActivity
::
class
.
java
)
intent
.
putExtra
(
PermissionsActivity
.
EXTRA_PERMISSIONS
,
PERMISSIONS
)
ActivityCompat
.
startActivityForResult
(
this
,
intent
,
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
,
null
)
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
Constant
.
REQUEST_CODE_ASK_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
startMain
()
}
else
{
mPresenter
!!
.
getAppConfig
()
}
}
override
fun
getDestroyed
():
Boolean
{
return
false
}
}
\ No newline at end of file
library/src/main/java/com/zxhl/library/net/NetConfig.java
View file @
2e8a1fd5
package
com
.
zxhl
.
library
.
net
;
package
com
.
zxhl
.
library
.
net
;
import
android.view.View
;
import
com.zxhl.library.utils.JumpUtils
;
import
static
com
.
zxhl
.
library
.
net
.
NetConfig
.
Environment
.
DEV
;
import
static
com
.
zxhl
.
library
.
net
.
NetConfig
.
Environment
.
DEV
;
import
static
com
.
zxhl
.
library
.
net
.
NetConfig
.
Environment
.
PRODUCT
;
import
static
com
.
zxhl
.
library
.
net
.
NetConfig
.
Environment
.
PRODUCT
;
...
@@ -223,13 +227,13 @@ public class NetConfig {
...
@@ -223,13 +227,13 @@ public class NetConfig {
public
static
String
WEB_URL_ABOUT_US
;
//TODO 关于我们页面
public
static
String
WEB_URL_ABOUT_US
;
//TODO 关于我们页面
public
static
String
WEB_URL_PRIVACY
=
"https://newspool.huolea.com/sspapiNovel/su/custom/
funnycallapp
/privacy.html"
;
//TODO 隐私协议
public
static
String
WEB_URL_PRIVACY
=
"https://newspool.huolea.com/sspapiNovel/su/custom/
gameysdzz
/privacy.html"
;
//TODO 隐私协议
public
static
String
WEB_URL_FEEDBACK
;
//TODO 用户反馈
public
static
String
WEB_URL_FEEDBACK
;
//TODO 用户反馈
public
static
String
WEB_URL_CLEARINSTRUCTIONS
;
//TODO
public
static
String
WEB_URL_CLEARINSTRUCTIONS
;
//TODO
public
static
String
WEB_URL_USER
=
"https://newspool.huolea.com/sspapiNovel/su/custom/
funnycallapp
/user.html"
;
//TODO 用户协议
public
static
String
WEB_URL_USER
=
"https://newspool.huolea.com/sspapiNovel/su/custom/
gameysdzz
/user.html"
;
//TODO 用户协议
public
static
String
WEB_URL_SHARE_LAND
;
//TODO
public
static
String
WEB_URL_SHARE_LAND
;
//TODO
...
...
task/src/main/java/com/zxhl/task/module/activity/NewWebActivity.kt
View file @
2e8a1fd5
...
@@ -25,7 +25,7 @@ import com.zxhl.library.utils.StatusBarUtil
...
@@ -25,7 +25,7 @@ import com.zxhl.library.utils.StatusBarUtil
import
com.zxhl.task.R
import
com.zxhl.task.R
import
com.zxhl.task.module.contract.NewWebContract
import
com.zxhl.task.module.contract.NewWebContract
import
com.zxhl.task.module.presenter.NewWebPresenter
import
com.zxhl.task.module.presenter.NewWebPresenter
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.weight.MyWebChromeClient
import
com.zxhl.task.module.weight.MyWebChromeClient
import
com.zxhl.task.module.weight.ScrollWebView
import
com.zxhl.task.module.weight.ScrollWebView
import
kotlinx.android.synthetic.main.activity_new_web.*
import
kotlinx.android.synthetic.main.activity_new_web.*
...
@@ -137,14 +137,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -137,14 +137,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
isAdds
=
true
isAdds
=
true
var
text
=
"阅读奖励 金币+"
+
coins
var
text
=
"阅读奖励 金币+"
+
coins
if
(
Constant
.
kkz_award_render_type
==
1
)
{
if
(
Constant
.
kkz_award_render_type
==
1
)
{
CenterDialog
.
showDialogReadCoins
(
this
,
coins
,
value
,
object
:
View
.
OnClickListener
{
Center
2
Dialog
.
showDialogReadCoins
(
this
,
coins
,
value
,
object
:
View
.
OnClickListener
{
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
isAdds
=
false
isAdds
=
false
mPresenter
?.
nextUrl
()
mPresenter
?.
nextUrl
()
}
}
})
})
}
else
{
}
else
{
showNewCoinsDialog
=
CenterDialog
.
showNewCoinsDialog
(
this
@NewWebActivity
,
coins
)
showNewCoinsDialog
=
Center
2
Dialog
.
showNewCoinsDialog
(
this
@NewWebActivity
,
coins
)
}
}
}
}
...
@@ -321,7 +321,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -321,7 +321,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
if
(
isAdds
==
true
)
{
if
(
isAdds
==
true
)
{
super
.
finish
()
super
.
finish
()
}
else
{
}
else
{
CenterDialog
.
showSignOutDialog
(
this
,
this
)
Center
2
Dialog
.
showSignOutDialog
(
this
,
this
)
}
}
}
}
...
...
task/src/main/java/com/zxhl/task/module/activity/RedPackageActivity.kt
View file @
2e8a1fd5
...
@@ -22,7 +22,7 @@ import com.zxhl.library.utils.StatusBarUtil
...
@@ -22,7 +22,7 @@ import com.zxhl.library.utils.StatusBarUtil
import
com.zxhl.task.R
import
com.zxhl.task.R
import
com.zxhl.task.module.contract.RedPacketContract
import
com.zxhl.task.module.contract.RedPacketContract
import
com.zxhl.task.module.presenter.RedPacketPresenter
import
com.zxhl.task.module.presenter.RedPacketPresenter
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.utils.ToastUtils
import
com.zxhl.task.module.utils.ToastUtils
import
com.zxhl.task.module.weight.helper.RedPacketViewHelper
import
com.zxhl.task.module.weight.helper.RedPacketViewHelper
import
kotlinx.android.synthetic.main.layout_count_down.*
import
kotlinx.android.synthetic.main.layout_count_down.*
...
@@ -112,7 +112,7 @@ class RedPackageActivity : Activity(), RedPacketContract.View {
...
@@ -112,7 +112,7 @@ class RedPackageActivity : Activity(), RedPacketContract.View {
tvCount
?.
setText
(
""
+
0
+
"s"
)
tvCount
?.
setText
(
""
+
0
+
"s"
)
mPresenter
?.
addRedPkg
(
ids
)
mPresenter
?.
addRedPkg
(
ids
)
mRedPacketViewHelper
!!
.
endGiftRain
()
mRedPacketViewHelper
!!
.
endGiftRain
()
CenterDialog
.
showGetGoldDialog
(
this
@RedPackageActivity
,
Center
2
Dialog
.
showGetGoldDialog
(
this
@RedPackageActivity
,
goldCount
,
goldCount
,
redNum
,
redNum
,
goldNum
,
goldNum
,
...
...
task/src/main/java/com/zxhl/task/module/activity/WebActivity.kt
View file @
2e8a1fd5
...
@@ -10,7 +10,6 @@ import android.graphics.PixelFormat
...
@@ -10,7 +10,6 @@ import android.graphics.PixelFormat
import
android.net.Uri
import
android.net.Uri
import
android.net.http.SslError
import
android.net.http.SslError
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Base64
import
android.util.Log
import
android.util.Log
import
android.view.*
import
android.view.*
import
android.webkit.*
import
android.webkit.*
...
@@ -25,16 +24,12 @@ import com.zxhl.library.net.*
...
@@ -25,16 +24,12 @@ import com.zxhl.library.net.*
import
com.zxhl.library.utils.StatusBarUtil
import
com.zxhl.library.utils.StatusBarUtil
import
com.zxhl.library.utils.Utils
import
com.zxhl.library.utils.Utils
import
com.zxhl.task.R
import
com.zxhl.task.R
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.utils.JavaInterface
import
com.zxhl.task.module.utils.JavaInterface
import
com.zxhl.task.module.utils.RxTimerUtil
import
com.zxhl.task.module.utils.RxTimerUtil
import
com.zxhl.task.module.weight.MyWebChromeClient
import
com.zxhl.task.module.weight.MyWebChromeClient
import
com.zxhl.task.module.weight.ScrollWebView
import
com.zxhl.task.module.weight.ScrollWebView
import
io.reactivex.Observer
import
io.reactivex.disposables.Disposable
import
kotlinx.android.synthetic.main.activity_web.*
import
kotlinx.android.synthetic.main.activity_web.*
import
okhttp3.ResponseBody
import
java.io.IOException
import
java.util.regex.Pattern
import
java.util.regex.Pattern
...
@@ -356,7 +351,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -356,7 +351,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
override
fun
onSuccess
(
result
:
CoinEntity
?)
{
override
fun
onSuccess
(
result
:
CoinEntity
?)
{
if
(
result
!=
null
&&
result
.
coins
>
0
)
{
if
(
result
!=
null
&&
result
.
coins
>
0
)
{
var
text
=
"阅读奖励 金币+"
+
result
.
coins
var
text
=
"阅读奖励 金币+"
+
result
.
coins
CenterDialog
.
showNewCoinsDialog
(
this
@WebActivity
,
result
.
coins
)
Center
2
Dialog
.
showNewCoinsDialog
(
this
@WebActivity
,
result
.
coins
)
isSuc
=
true
isSuc
=
true
status
=
OVER
status
=
OVER
setTimerLayoutGone
()
setTimerLayoutGone
()
...
@@ -639,7 +634,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -639,7 +634,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
override
fun
finish
()
{
override
fun
finish
()
{
if
(
incentive_level
==
2
||
incentive_level
==
8
||
incentive_level
==
9
||
incentive_level
==
11
)
{
if
(
incentive_level
==
2
||
incentive_level
==
8
||
incentive_level
==
9
||
incentive_level
==
11
)
{
if
(!
isAdd
)
{
if
(!
isAdd
)
{
CenterDialog
.
showSignOutDialog
(
this
,
this
)
Center
2
Dialog
.
showSignOutDialog
(
this
,
this
)
}
else
{
}
else
{
super
.
finish
()
super
.
finish
()
}
}
...
...
task/src/main/java/com/zxhl/task/module/caiyuan/CoinCrashFragment.kt
View file @
2e8a1fd5
...
@@ -48,6 +48,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
...
@@ -48,6 +48,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
//立即提现
//立即提现
cash_coin_tv_now
?.
setOnClickListener
{
cash_coin_tv_now
?.
setOnClickListener
{
EventUtils
.
onEvent
(
"withdraw_cash_click"
,
"金币提现详情页-提现按钮"
)
EventUtils
.
onEvent
(
"withdraw_cash_click"
,
"金币提现详情页-提现按钮"
)
EventUtils
.
onEvent
(
"GetCash_Btn_Click"
,
"金币提现详情页-提现按钮"
)
val
userInfoData
=
SettingPreference
.
getUserInfoData
()
val
userInfoData
=
SettingPreference
.
getUserInfoData
()
if
(
userInfoData
!=
null
)
{
if
(
userInfoData
!=
null
)
{
if
(!
userInfoData
.
isBindWxPayOpenid
!!
)
{
if
(!
userInfoData
.
isBindWxPayOpenid
!!
)
{
...
@@ -135,6 +136,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
...
@@ -135,6 +136,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
//
//
override
fun
onCashResult
(
result
:
CashEntity
)
{
override
fun
onCashResult
(
result
:
CashEntity
)
{
if
(
result
.
coinList
!=
null
)
{
if
(
result
.
coinList
!=
null
)
{
EventUtils
.
onEvent
(
"GetCashPage_Coin_Show"
)
var
arrlist
:
ArrayList
<
CashEntity
.
CoinListBean
>
=
ArrayList
()
var
arrlist
:
ArrayList
<
CashEntity
.
CoinListBean
>
=
ArrayList
()
for
(
value
in
result
?.
coinList
!!
){
for
(
value
in
result
?.
coinList
!!
){
if
(
value
?.
show
==
1
){
if
(
value
?.
show
==
1
){
...
@@ -157,7 +159,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
...
@@ -157,7 +159,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
}
}
}
//微信提现成功
override
fun
onWxCash
(
result
:
WechatResultEntity
)
{
override
fun
onWxCash
(
result
:
WechatResultEntity
)
{
EventUtils
.
onEvent
(
"WithDraw_Coin_Success"
,
""
+
result
?.
reason
)
mLoading
?.
dismiss
()
mLoading
?.
dismiss
()
cash_coin_tv_now
.
isEnabled
=
true
cash_coin_tv_now
.
isEnabled
=
true
showToast
(
result
?.
reason
)
showToast
(
result
?.
reason
)
...
@@ -166,6 +170,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
...
@@ -166,6 +170,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
}
override
fun
onWxCashFail
(
errorMsg
:
String
)
{
override
fun
onWxCashFail
(
errorMsg
:
String
)
{
EventUtils
.
onEvent
(
"WithDraw_Coin_Faile"
,
""
+
errorMsg
)
mLoading
?.
dismiss
()
mLoading
?.
dismiss
()
showToast
(
errorMsg
)
showToast
(
errorMsg
)
cash_coin_tv_now
.
isEnabled
=
true
cash_coin_tv_now
.
isEnabled
=
true
...
@@ -176,9 +181,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
...
@@ -176,9 +181,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
}
override
fun
withdrawSuccess
(
cash
:
Float
,
status
:
String
,
type
:
String
,
desc
:
String
)
{
override
fun
withdrawSuccess
(
cash
:
Float
,
status
:
String
,
type
:
String
,
desc
:
String
)
{
Toast
.
makeText
(
mActivity
,
desc
,
Toast
.
LENGTH_LONG
).
show
()
//
Toast.makeText(mActivity,desc,Toast.LENGTH_LONG).show()
//
mPresenter
?.
getCashConfig
(
1
)
// 获取金币提现
//
mPresenter?.getCashConfig(1)// 获取金币提现
}
}
...
...
task/src/main/java/com/zxhl/task/module/caiyuan/GameTaskActivity.kt
View file @
2e8a1fd5
...
@@ -26,7 +26,7 @@ import com.zxhl.task.module.adapter.TaskSignInAdapter
...
@@ -26,7 +26,7 @@ import com.zxhl.task.module.adapter.TaskSignInAdapter
import
com.zxhl.task.module.contract.TaskContract
import
com.zxhl.task.module.contract.TaskContract
import
com.zxhl.task.module.listener.OnRecycleItemClickListener
import
com.zxhl.task.module.listener.OnRecycleItemClickListener
import
com.zxhl.task.module.presenter.TaskPresenter
import
com.zxhl.task.module.presenter.TaskPresenter
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.weight.LoadingDialog
import
com.zxhl.task.module.weight.LoadingDialog
import
kotlinx.android.synthetic.main.activity_task_game_xxl.*
import
kotlinx.android.synthetic.main.activity_task_game_xxl.*
import
java.text.DecimalFormat
import
java.text.DecimalFormat
...
@@ -93,7 +93,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
...
@@ -93,7 +93,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
return
return
}
}
//事件上报
//事件上报
EventUtils
.
onEvent
(
"TaskPage_TaskList_Click"
)
EventUtils
.
onEvent
(
"TaskPage_TaskList_Click"
,
"sid:"
+
newsEntity
?.
sid
)
if
(
newsEntity
?.
opentype
==
50
)
{
//游戏页面
if
(
newsEntity
?.
opentype
==
50
)
{
//游戏页面
val
sid
:
String
=
data
.
sid
.
toString
()
val
sid
:
String
=
data
.
sid
.
toString
()
if
(
sid
.
equals
(
"2334"
))
{
//连闯5关
if
(
sid
.
equals
(
"2334"
))
{
//连闯5关
...
@@ -167,14 +167,14 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
...
@@ -167,14 +167,14 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
//领红包
//领红包
ll_get_red
.
setOnClickListener
{
ll_get_red
.
setOnClickListener
{
CenterDialog
.
showDialogRed
(
this
@GameTaskActivity
,
this
@GameTaskActivity
)
Center
2
Dialog
.
showDialogRed
(
this
@GameTaskActivity
,
this
@GameTaskActivity
)
}
}
handler
?.
postDelayed
(
Runnable
{
handler
?.
postDelayed
(
Runnable
{
var
i
=
System
.
currentTimeMillis
()
%
1800000
//整点毫秒数 距离上个整点的毫秒数
var
i
=
System
.
currentTimeMillis
()
%
1800000
//整点毫秒数 距离上个整点的毫秒数
var
l1
=
((
1800000
-
i
)
/
1000
).
toInt
()
var
l1
=
((
1800000
-
i
)
/
1000
).
toInt
()
startTimeTask
(
l1
,
task_game_time
)
startTimeTask
(
l1
,
task_game_time
)
CenterDialog
.
showDialogRed
(
this
@GameTaskActivity
,
this
@GameTaskActivity
)
Center
2
Dialog
.
showDialogRed
(
this
@GameTaskActivity
,
this
@GameTaskActivity
)
},
1000
)
},
1000
)
//事件上报
//事件上报
...
@@ -307,7 +307,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
...
@@ -307,7 +307,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
if
(
isOnline
)
{
//如果是在线红包的话,需要弹框
if
(
isOnline
)
{
//如果是在线红包的话,需要弹框
isOnline
=
!
isOnline
isOnline
=
!
isOnline
handler
.
postDelayed
(
Runnable
{
handler
.
postDelayed
(
Runnable
{
CenterDialog
.
showSignDialog
(
this
@GameTaskActivity
,
coin
,
object
:
View
.
OnClickListener
{
Center
2
Dialog
.
showSignDialog
(
this
@GameTaskActivity
,
coin
,
object
:
View
.
OnClickListener
{
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
if
(
mLoading
==
null
)
{
if
(
mLoading
==
null
)
{
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
...
...
task/src/main/java/com/zxhl/task/module/caiyuan/RedCrashFragment.kt
View file @
2e8a1fd5
...
@@ -49,7 +49,9 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
...
@@ -49,7 +49,9 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
//立即提现
//立即提现
cash_coin_tv_now
?.
setOnClickListener
{
cash_coin_tv_now
?.
setOnClickListener
{
EventUtils
.
onEvent
(
"withdraw_cash_click"
,
"金币提现详情页-提现按钮"
)
EventUtils
.
onEvent
(
"withdraw_cash_click"
,
"红包提现详情页-提现按钮"
)
EventUtils
.
onEvent
(
"GetCash_Btn_Click"
,
"红包提现详情页-提现按钮"
)
val
userInfoData
=
SettingPreference
.
getUserInfoData
()
val
userInfoData
=
SettingPreference
.
getUserInfoData
()
if
(
userInfoData
!=
null
)
{
if
(
userInfoData
!=
null
)
{
if
(!
userInfoData
.
isBindWxPayOpenid
!!
)
{
if
(!
userInfoData
.
isBindWxPayOpenid
!!
)
{
...
@@ -168,6 +170,8 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
...
@@ -168,6 +170,8 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
override
fun
onCashResult
(
result
:
CashEntity
)
{
override
fun
onCashResult
(
result
:
CashEntity
)
{
if
(
result
.
cashList
!=
null
){
if
(
result
.
cashList
!=
null
){
EventUtils
.
onEvent
(
"GetCashPage_RedPack_Show"
)
mNumAdapter
?.
setSelectPosition
(
0
)
mNumAdapter
?.
setSelectPosition
(
0
)
mNumAdapter
?.
clear
()
mNumAdapter
?.
clear
()
mNumAdapter
?.
setType
(
mDefaultType
)
mNumAdapter
?.
setType
(
mDefaultType
)
...
@@ -186,14 +190,14 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
...
@@ -186,14 +190,14 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
override
fun
onWxCash
(
result
:
WechatResultEntity
)
{
override
fun
onWxCash
(
result
:
WechatResultEntity
)
{
EventUtils
.
onEvent
(
"WithDraw_RedPack_Success"
,
""
+
result
?.
reason
)
showToast
(
result
?.
reason
)
showToast
(
result
?.
reason
)
mPresenter
?.
getCashConfig
(
2
)
// 获取金币提现
mPresenter
?.
getCashConfig
(
2
)
// 获取金币提现
}
}
override
fun
onWxCashFail
(
errorMsg
:
String
)
{
override
fun
onWxCashFail
(
errorMsg
:
String
)
{
EventUtils
.
onEvent
(
"WithDraw_RedPack_Faile"
,
""
+
errorMsg
)
showToast
(
errorMsg
)
showToast
(
errorMsg
)
}
}
...
...
task/src/main/java/com/zxhl/task/module/luckydraw/activity/ScratchCardActivity.kt
View file @
2e8a1fd5
...
@@ -27,7 +27,7 @@ import com.zxhl.task.module.luckydraw.presenter.ScratchCardPresenter
...
@@ -27,7 +27,7 @@ import com.zxhl.task.module.luckydraw.presenter.ScratchCardPresenter
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.CallbackIncentiveVideo
import
com.zxhl.task.module.utils.CallbackIncentiveVideo
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
kotlinx.android.synthetic.main.activity_scratch_card.*
import
kotlinx.android.synthetic.main.activity_scratch_card.*
import
java.util.*
import
java.util.*
...
@@ -62,7 +62,7 @@ class ScratchCardActivity : BaseActivity(), ScratchCardContract.View {
...
@@ -62,7 +62,7 @@ class ScratchCardActivity : BaseActivity(), ScratchCardContract.View {
scratch_card_top_desc_right_icon
?.
setOnClickListener
{
scratch_card_top_desc_right_icon
?.
setOnClickListener
{
//奖励说明
//奖励说明
CenterDialog
.
showScratchExplainDialog
(
this
@ScratchCardActivity
)
Center
2
Dialog
.
showScratchExplainDialog
(
this
@ScratchCardActivity
)
}
}
id_content_scrape_card
?.
setTopView
(
R
.
layout
.
scrape_card_content_top_view
)
id_content_scrape_card
?.
setTopView
(
R
.
layout
.
scrape_card_content_top_view
)
...
...
task/src/main/java/com/zxhl/task/module/luckydraw/fragment/LuckyAdFragment.kt
View file @
2e8a1fd5
...
@@ -36,7 +36,7 @@ import com.zxhl.task.module.luckydraw.presenter.LuckyAdPresenter
...
@@ -36,7 +36,7 @@ import com.zxhl.task.module.luckydraw.presenter.LuckyAdPresenter
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.AdRenderCallback
import
com.zxhl.task.module.utils.AdRenderCallback
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.utils.RxTimerUtil
import
com.zxhl.task.module.utils.RxTimerUtil
import
com.zxhl.task.module.weight.CenterMenuDialog
import
com.zxhl.task.module.weight.CenterMenuDialog
import
kotlinx.android.synthetic.main.activity_lucky_ad.*
import
kotlinx.android.synthetic.main.activity_lucky_ad.*
...
@@ -460,7 +460,7 @@ class LuckyAdFragment : LuckyAnimImpl(), LuckyAdContract.View, AdCallback<String
...
@@ -460,7 +460,7 @@ class LuckyAdFragment : LuckyAnimImpl(), LuckyAdContract.View, AdCallback<String
override
fun
showBoxDialog
(
coins
:
String
,
limit
:
String
)
{
override
fun
showBoxDialog
(
coins
:
String
,
limit
:
String
)
{
if
(
mActivity
!=
null
)
if
(
mActivity
!=
null
)
CenterDialog
.
showDialogLuckyBox
(
mActivity
,
coins
.
toInt
(),
0
,
limit
,
this
)
Center
2
Dialog
.
showDialogLuckyBox
(
mActivity
,
coins
.
toInt
(),
0
,
limit
,
this
)
}
}
override
fun
onResult
(
code
:
Int
,
result
:
String
?)
{
override
fun
onResult
(
code
:
Int
,
result
:
String
?)
{
...
...
task/src/main/java/com/zxhl/task/module/luckydraw/fragment/SlotMachineFragment.kt
View file @
2e8a1fd5
...
@@ -29,7 +29,7 @@ import com.zxhl.task.module.luckydraw.presenter.SlotMachinePresenter
...
@@ -29,7 +29,7 @@ import com.zxhl.task.module.luckydraw.presenter.SlotMachinePresenter
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialog
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.AdDialogCallback
import
com.zxhl.task.module.utils.AninUtils
import
com.zxhl.task.module.utils.AninUtils
import
com.zxhl.task.module.utils.CenterDialog
import
com.zxhl.task.module.utils.Center
2
Dialog
import
com.zxhl.task.module.utils.TextSwitcherAnimation
import
com.zxhl.task.module.utils.TextSwitcherAnimation
import
com.zxhl.task.module.weight.SlotMachineRecyClerView
import
com.zxhl.task.module.weight.SlotMachineRecyClerView
import
kotlinx.android.synthetic.main.fragment_slot_machine_layout.*
import
kotlinx.android.synthetic.main.fragment_slot_machine_layout.*
...
@@ -80,7 +80,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
...
@@ -80,7 +80,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
icon_slotmachine_rule
?.
setOnClickListener
{
icon_slotmachine_rule
?.
setOnClickListener
{
//活动规则弹窗
//活动规则弹窗
CenterDialog
.
showActivityRulesDialog
(
mActivity
)
Center
2
Dialog
.
showActivityRulesDialog
(
mActivity
)
}
}
...
@@ -265,7 +265,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
...
@@ -265,7 +265,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
override
fun
slotMachineRe
(
result
:
SlotMachineReEntity
)
{
override
fun
slotMachineRe
(
result
:
SlotMachineReEntity
)
{
CenterDialog
.
showSlotMachineDialog
(
mActivity
,
result
?.
receiveNum
?:
""
)
Center
2
Dialog
.
showSlotMachineDialog
(
mActivity
,
result
?.
receiveNum
?:
""
)
presenter
?.
slotMachineInfo
()
presenter
?.
slotMachineInfo
()
}
}
...
@@ -305,7 +305,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
...
@@ -305,7 +305,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
slot_machine_more_nomal
?.
setBackgroundResource
(
R
.
drawable
.
icon_slotmachine_waite_next
)
slot_machine_more_nomal
?.
setBackgroundResource
(
R
.
drawable
.
icon_slotmachine_waite_next
)
slot_machine_more_nomal
?.
isEnabled
=
false
slot_machine_more_nomal
?.
isEnabled
=
false
CenterDialog
.
showSlotMachineTimerDialog
(
mActivity
,
entity
?.
countdownSecond
?:
0
)
Center
2
Dialog
.
showSlotMachineTimerDialog
(
mActivity
,
entity
?.
countdownSecond
?:
0
)
}
}
5
->{
5
->{
...
@@ -363,7 +363,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
...
@@ -363,7 +363,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
CenterDialog
.
showSlotMachineBoxDialog
(
mActivity
,
object
:
View
.
OnClickListener
{
Center
2
Dialog
.
showSlotMachineBoxDialog
(
mActivity
,
object
:
View
.
OnClickListener
{
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
...
...
task/src/main/java/com/zxhl/task/module/utils/CenterDialog.kt
→
task/src/main/java/com/zxhl/task/module/utils/Center
2
Dialog.kt
View file @
2e8a1fd5
...
@@ -2,9 +2,15 @@ package com.zxhl.task.module.utils
...
@@ -2,9 +2,15 @@ package com.zxhl.task.module.utils
import
android.app.Activity
import
android.app.Activity
import
android.app.Dialog
import
android.app.Dialog
import
android.graphics.Color
import
android.os.Build
import
android.os.Build
import
android.os.CountDownTimer
import
android.os.CountDownTimer
import
android.text.SpannableStringBuilder
import
android.text.Spanned
import
android.text.TextUtils
import
android.text.TextUtils
import
android.text.method.LinkMovementMethod
import
android.text.style.ClickableSpan
import
android.text.style.ForegroundColorSpan
import
android.view.*
import
android.view.*
import
android.view.animation.*
import
android.view.animation.*
import
android.widget.*
import
android.widget.*
...
@@ -16,6 +22,7 @@ import com.zxhl.library.config.AdManager
...
@@ -16,6 +22,7 @@ import com.zxhl.library.config.AdManager
import
com.zxhl.library.config.ZXADSizeConfig
import
com.zxhl.library.config.ZXADSizeConfig
import
com.zxhl.library.listener.ZXADExpressListener
import
com.zxhl.library.listener.ZXADExpressListener
import
com.zxhl.library.module.NewsEntity
import
com.zxhl.library.module.NewsEntity
import
com.zxhl.library.net.NetConfig
import
com.zxhl.library.utils.*
import
com.zxhl.library.utils.*
import
com.zxhl.task.R
import
com.zxhl.task.R
import
com.zxhl.task.module.listener.AdCallback
import
com.zxhl.task.module.listener.AdCallback
...
@@ -24,7 +31,7 @@ import java.util.*
...
@@ -24,7 +31,7 @@ import java.util.*
/**
/**
* Created by gaoleichao on 2018/8/17.
* Created by gaoleichao on 2018/8/17.
*/
*/
object
Center
Dialog
:
BaseDialog
()
{
object
Center
2Dialog
:
BaseDialog
()
{
fun
showActivityRulesDialog
(
activity
:
Activity
?)
{
fun
showActivityRulesDialog
(
activity
:
Activity
?)
{
if
(
activity
==
null
)
{
if
(
activity
==
null
)
{
...
@@ -641,5 +648,95 @@ object CenterDialog : BaseDialog() {
...
@@ -641,5 +648,95 @@ object CenterDialog : BaseDialog() {
/**
* 隐私协议弹窗
*/
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
()
}
}
}
\ No newline at end of file
task/src/main/java/com/zxhl/task/module/utils/SDialog.kt
0 → 100644
View file @
2e8a1fd5
package
com.zxhl.task.module.utils
import
android.app.Activity
import
android.app.Dialog
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.net.NetConfig
import
com.zxhl.library.utils.JumpUtils
import
com.zxhl.task.R
object
SDialog
{
/**
* 隐私协议弹窗
*/
fun
showPrivacyProtocol
(
activity
:
Activity
,
disagreelistener
:
View
.
OnClickListener
,
agreelistener
:
View
.
OnClickListener
?)
{
val
mDialog
=
Dialog
(
activity
,
R
.
style
.
UpdateVersionCompatDialogTheme
)
val
mDialogView
=
Center2Dialog
.
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
());
mDialog
.
run
{
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
());
val
privacy_protocol_button
=
findViewById
<
TextView
>(
R
.
id
.
privacy_protocol_button
)
val
cancel_button
=
mDialog
.
findViewById
<
TextView
>(
R
.
id
.
cancel_button
)
privacy_protocol_button
.
setOnClickListener
{
mDialog
.
dismiss
()
agreelistener
?.
onClick
(
privacy_protocol_button
)
}
cancel_button
.
setOnClickListener
{
mDialog
.
dismiss
()
disagreelistener
?.
onClick
(
cancel_button
)
}
}
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
show
()
}
}
\ No newline at end of file
task/src/main/res/drawable/shape_00c98d_r6.xml
0 → 100644
View file @
2e8a1fd5
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#00c98d"
/>
<corners
android:radius=
"6dp"
/>
</shape>
\ No newline at end of file
task/src/main/res/layout/dialog_privacy_protocol_view.xml
0 → 100644
View file @
2e8a1fd5
<?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"
android:gravity=
"center"
>
<LinearLayout
android:layout_width=
"298dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:orientation=
"vertical"
android:background=
"@drawable/shape_white_r6"
>
<TextView
android:id=
"@+id/privacy_protocol_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"19dp"
android:textSize=
"16sp"
android:layout_gravity=
"center_horizontal"
android:textColor=
"@color/color_333333"
android:text=
"用户协议及隐私条款"
/>
<ScrollView
android:layout_width=
"wrap_content"
android:fadingEdge=
"none"
android:overScrollMode=
"never"
android:layout_height=
"327.5dp"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:textSize=
"15sp"
android:textColor=
"#666666"
android:text=
"我们依据最新法律,向您说明趣味来电\n软件的隐私政策,特向您推送本提示,\n请您阅读并充分理解相关条款。"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:text=
"我们承诺:"
android:textSize=
"15sp"
android:textColor=
"#333333"
/>
<RelativeLayout
android:layout_marginTop=
"13dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/baozhan_img"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<TextView
android:layout_toRightOf=
"@+id/baozhan_img"
android:layout_alignTop=
"@+id/baozhan_img"
android:textColor=
"#999999"
android:textSize=
"12sp"
android:layout_marginLeft=
"4dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"我们会严格按照《网络安全法》、《信息网络传播保护条例》等保护您的个人信息"
/>
</RelativeLayout>
<RelativeLayout
android:layout_marginTop=
"31dp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/gerenxinxi_img"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<TextView
android:layout_toRightOf=
"@+id/gerenxinxi_img"
android:layout_alignTop=
"@+id/gerenxinxi_img"
android:textColor=
"#999999"
android:textSize=
"12sp"
android:layout_marginLeft=
"4dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"如果未经您的授权,我们不会使用您的个人信息用于您未授权的其他途径和目的"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/id_dialog_privacy_protocol_desc"
android:layout_marginTop=
"20dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:textColor=
"#666666"
/>
<TextView
android:id=
"@+id/id_dialog_privacy_protocol_content"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_marginTop=
"20dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:lineSpacingExtra=
"8dp"
android:textSize=
"14sp"
/>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_marginTop=
"15dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:alpha=
"0.6"
android:layout_alignParentTop=
"true"
android:background=
"#DDDDDD"
/>
<TextView
android:id=
"@+id/cancel_button"
android:layout_width=
"115.5dp"
android:layout_height=
"37dp"
android:text=
"不同意"
android:gravity=
"center"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"11dp"
android:layout_marginBottom=
"11dp"
android:textColor=
"#999999"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/privacy_protocol_button"
android:layout_width=
"115.5dp"
android:layout_height=
"37dp"
android:text=
"同意"
android:gravity=
"center"
android:layout_marginTop=
"11dp"
android:layout_marginRight=
"20dp"
android:layout_alignParentRight=
"true"
android:layout_marginBottom=
"11dp"
android:background=
"@drawable/shape_00c98d_r6"
android:textColor=
"@color/white"
android:textSize=
"16sp"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
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