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
2673e0b7
Commit
2673e0b7
authored
Apr 16, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
72bf2c61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
XmManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/XmManager.kt
+11
-10
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/XmManager.kt
View file @
2673e0b7
...
@@ -13,6 +13,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant
...
@@ -13,6 +13,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant
import
com.bytedance.sdk.openadsdk.TTAdSdk
import
com.bytedance.sdk.openadsdk.TTAdSdk
import
com.fendasz.moku.planet.exception.MokuException
import
com.fendasz.moku.planet.exception.MokuException
import
com.fendasz.moku.planet.helper.MokuHelper
import
com.fendasz.moku.planet.helper.MokuHelper
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
import
com.qq.e.comm.managers.GDTADManager
import
com.qq.e.comm.managers.GDTADManager
...
@@ -23,16 +24,16 @@ import kotlinx.android.synthetic.main.activity_layout_xiaoman.*
...
@@ -23,16 +24,16 @@ import kotlinx.android.synthetic.main.activity_layout_xiaoman.*
*/
*/
object
XmManager
{
object
XmManager
{
private
var
placeMateId
=
""
private
var
materialId
=
""
private
const
val
ACCESSKEY
=
"hzq-az_rvkvdy"
private
const
val
ACCESSKEY
=
"hzq-az_rvkvdy"
private
const
val
SECRETKEY
=
"22FvHjUzvQ516214"
private
const
val
SECRETKEY
=
"22FvHjUzvQ516214"
private
var
placeMateId
=
""
private
var
materialId
=
""
fun
initXm
(
application
:
Application
)
{
fun
initXm
(
application
:
Application
)
{
// //打开日志,上线之前记得关闭
try
{
try
{
//
//
打开日志,上线之前记得关闭
//打开日志,上线之前记得关闭
AdSdk
.
setDebug
(
true
);
AdSdk
.
setDebug
(
BuildConfig
.
DEBUG
)
//初始化 需要在Applicaiton 中
//初始化 需要在Applicaiton 中
AdSdk
.
init
(
application
,
ACCESSKEY
,
SECRETKEY
)
AdSdk
.
init
(
application
,
ACCESSKEY
,
SECRETKEY
)
}
catch
(
e
:
Exception
)
{
//这里应该是小满的异常
}
catch
(
e
:
Exception
)
{
//这里应该是小满的异常
...
@@ -42,8 +43,7 @@ object XmManager {
...
@@ -42,8 +43,7 @@ object XmManager {
fun
loadMater
(
placeid
:
String
)
{
fun
loadMater
(
placeid
:
String
)
{
if
(
TextUtils
.
isEmpty
(
placeMateId
))
{
if
(
TextUtils
.
isEmpty
(
placeMateId
))
{
val
tm
:
MaterialTm
by
lazy
{
MaterialTm
()
}
MaterialTm
().
loadMaterialData
(
UserManager
.
getInstance
().
userID
,
placeid
,
object
:
MaterialTm
.
Callback
{
tm
!!
.
loadMaterialData
(
UserManager
.
getInstance
().
userID
,
placeid
,
object
:
MaterialTm
.
Callback
{
//对应PlaceID会有对应的素材
//对应PlaceID会有对应的素材
override
fun
onSuccess
(
imgUrl
:
String
,
placeMateId2
:
String
,
materialId2
:
String
)
{
override
fun
onSuccess
(
imgUrl
:
String
,
placeMateId2
:
String
,
materialId2
:
String
)
{
placeMateId
=
placeMateId2
placeMateId
=
placeMateId2
...
@@ -59,7 +59,6 @@ object XmManager {
...
@@ -59,7 +59,6 @@ object XmManager {
}
else
{
}
else
{
AdSdk
.
exposure
(
UserManager
.
getInstance
().
userID
,
placeid
,
placeMateId
,
materialId
);
AdSdk
.
exposure
(
UserManager
.
getInstance
().
userID
,
placeid
,
placeMateId
,
materialId
);
LogUtil
.
d
(
"******exposure*********${UserManager.getInstance().userID}******$placeMateId********$materialId****************$placeid**"
)
LogUtil
.
d
(
"******exposure*********${UserManager.getInstance().userID}******$placeMateId********$materialId****************$placeid**"
)
}
}
}
}
...
@@ -69,8 +68,10 @@ object XmManager {
...
@@ -69,8 +68,10 @@ object XmManager {
* @param view
* @param view
*/
*/
fun
exprotClick
(
placeid
:
String
)
{
fun
exprotClick
(
placeid
:
String
)
{
AdSdk
.
click
(
UserManager
.
getInstance
().
userID
,
placeid
,
materialId
,
materialId
);
if
(!
TextUtils
.
isEmpty
(
placeMateId
))
{
LogUtil
.
d
(
"******exprotClick*******${UserManager.getInstance().userID}*******$placeMateId********$materialId******$placeid"
)
AdSdk
.
click
(
UserManager
.
getInstance
().
userID
,
placeid
,
materialId
,
materialId
)
LogUtil
.
d
(
"******exprotClick*******${UserManager.getInstance().userID}*******$placeMateId********$materialId******$placeid"
)
}
}
}
}
}
\ 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