Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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
android
android_goodmoney
Commits
dcf4b919
Commit
dcf4b919
authored
Jan 15, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
珊瑚loginkey添加json
parent
c00e92b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
build.gradle
GoodMoney/app/build.gradle
+1
-1
ShVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
+25
-2
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+1
-1
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+1
-4
No files found.
GoodMoney/app/build.gradle
View file @
dcf4b919
...
...
@@ -262,7 +262,7 @@ dependencies {
// 微转阅读
implementation
(
name:
'articlesdk-v1.0.6.202012121917-x'
,
ext:
'aar'
)
//天卓SDK的珊瑚2.0组件
implementation
(
"com.android.support:support-v4:28.+"
)
//
implementation("com.android.support:support-v4:28.+")
implementation
(
name:
'adapt-1.3.3'
,
ext:
'aar'
)
implementation
(
name:
'commonbase-1.0.2'
,
ext:
'aar'
)
implementation
(
name:
'discovery-2.0.14'
,
ext:
'aar'
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
View file @
dcf4b919
package
com.mints.goodmoney.ad.video
import
android.app.Activity
import
android.text.TextUtils
import
androidx.annotation.Nullable
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.common.AppConfig
...
...
@@ -10,12 +11,15 @@ import com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.presenters.TzVideoAdPresenter
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.MD5
import
com.mints.library.utils.json.JsonUtil
import
com.tz.sdk.coral.ad.CoralAD
import
com.tz.sdk.coral.callback.CoralVideoListener
import
com.tz.sdk.core.ad.ADError
import
com.tz.sdk.core.ad.ADSource
import
com.tz.sdk.core.ad.ADType
import
com.tz.sdk.core.loader.ADLoader
import
net.grandcentrix.tray.AppPreferences
private
val
TAG
=
ShVideoAdManager
::
class
.
java
.
simpleName
...
...
@@ -29,6 +33,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
private
var
tzVideoAdPresenter
:
TzVideoAdPresenter
?
=
null
private
var
shVideoAdListener
:
ShVideoAdListener
?
=
null
private
lateinit
var
ps
:
AppPreferences
companion
object
{
...
...
@@ -57,6 +62,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
ps
=
AppPreferences
(
activity
)
tzVideoAdPresenter
=
TzVideoAdPresenter
()
tzVideoAdPresenter
?.
attachView
(
this
)
}
...
...
@@ -80,7 +86,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
init
{
put
(
CoralAD
.
Key
.
TASK_TYPE
,
type
)
put
(
CoralAD
.
Key
.
ACCOUNT_ID
,
UserManager
.
getInstance
().
userID
)
put
(
CoralAD
.
Key
.
LOGIN_KEY
,
UserManager
.
getInstance
().
tokenID
)
put
(
CoralAD
.
Key
.
LOGIN_KEY
,
JsonUtil
.
toJson
(
getAdMapVO
(
curCoin
,
carrierType
,
extraId
))
)
// put(CoralAD.Key.VIDEO_AUTO_PLAY, true) //拉取成功后是否自动播放视频,非必须,默认true
}
})
...
...
@@ -193,8 +199,25 @@ class ShVideoAdManager private constructor(activity: Activity) :
it
.
dispose
()
it
.
detachView
()
}
activity
=
null
}
private
fun
getAdMapVO
(
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?):
HashMap
<
String
,
Any
>
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"adtype"
]
=
Constant
.
ADTYPE_VEDIO
vo
[
"tid"
]
=
MD5
.
GetMD5Code
(
System
.
currentTimeMillis
().
toString
()
+
UserManager
.
getInstance
().
userID
)
vo
[
"adsource"
]
=
Constant
.
AD_SOURCE_SH
vo
[
"ip"
]
=
ps
.
getString
(
Constant
.
CSJ_VEDIO_APPIP
,
""
)
!!
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_HOMEWATER
->
vo
[
"waterCoin"
]
=
curCoin
Constant
.
CARRIER_OFFLINE_DOUBLE
->
{
vo
[
"offline_income"
]
=
curCoin
vo
[
"turntableKey"
]
=
if
(
TextUtils
.
isEmpty
(
extraId
))
""
else
extraId
!!
}
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
->
vo
[
"turntableKey"
]
=
if
(
TextUtils
.
isEmpty
(
extraId
))
""
else
extraId
!!
}
return
vo
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
dcf4b919
...
...
@@ -139,7 +139,7 @@ object Constant {
const
val
AD_SOURCE_SDHZ
=
"SDHZ"
//闪电盒子
const
val
AD_SOURCE_FL
=
"FL"
//枫岚
const
val
AD_SOURCE_CSJFULL
=
"CSJFULL"
const
val
AD_SOURCE_SH
=
"
SH
"
//天卓
const
val
AD_SOURCE_SH
=
"
CORAL
"
//天卓
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const
val
EVENT_TYPE_ZERO
=
"0"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
dcf4b919
...
...
@@ -13,7 +13,6 @@ import androidx.core.content.ContextCompat
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.video.TzVideoAdManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.login.LoginApi
import
com.mints.goodmoney.login.OnLoginListener
...
...
@@ -188,9 +187,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
submitInvitedCode
()
}
R
.
id
.
item_cleanCache
->
{
// clearDialog()
TzVideoAdManager
.
getInstance
(
this
)
?.
loadAd
(
this
,
10
,
"A"
,
"0"
)
clearDialog
()
}
R
.
id
.
item_userAgree
->
{
val
bundle
=
Bundle
()
...
...
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