Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Out
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
xjl
Out
Commits
a26c8dc9
Commit
a26c8dc9
authored
Jan 05, 2024
by
xujialang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8a431f96
1098691c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
17 deletions
+50
-17
AdDataManager.java
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
+4
-4
AdManagerV2.java
app/src/main/java/com/zl/sdk/ad/AdManagerV2.java
+33
-7
TopOnAdManager.java
app/src/main/java/com/zl/sdk/ad/topOn/TopOnAdManager.java
+1
-1
CheckHelper.java
app/src/main/java/com/zl/sdk/out/CheckHelper.java
+1
-2
DxActivity.java
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
+11
-3
No files found.
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
View file @
a26c8dc9
...
@@ -101,10 +101,10 @@ public class AdDataManager {
...
@@ -101,10 +101,10 @@ public class AdDataManager {
adData
.
cpAdslot
=
PROP
.
isTest
()
?
"b6509805ed0208"
:
"b657019e06896e"
;
//cp:b6509805ed0208 native:b1f5eocpkk4f3f release cp:b1f5i60t92g4gq
adData
.
cpAdslot
=
PROP
.
isTest
()
?
"b6509805ed0208"
:
"b657019e06896e"
;
//cp:b6509805ed0208 native:b1f5eocpkk4f3f release cp:b1f5i60t92g4gq
adData
.
showCount
=
30
;
adData
.
showCount
=
30
;
adData
.
showTimes
=
30
;
adData
.
showTimes
=
30
;
adData
.
interval
=
10
*
60
;
//30分钟 未隐藏icon
adData
.
interval
=
8
*
60
;
//30分钟 未隐藏icon
adData
.
intervalHide
=
10
*
60
;
//10分钟 隐藏icon
adData
.
intervalHide
=
5
*
60
;
//10分钟 隐藏icon
adData
.
showTimesHideForAdId
=
4
0
;
adData
.
showTimesHideForAdId
=
6
0
;
adData
.
showTimeHide
=
4
0
;
adData
.
showTimeHide
=
6
0
;
LogUtil
.
d
(
TAG
,
"getAdData adData(test) ="
+
adData
);
LogUtil
.
d
(
TAG
,
"getAdData adData(test) ="
+
adData
);
}
else
{
}
else
{
LogUtil
.
d
(
TAG
,
"getAdData adData(release) ="
+
adData
);
LogUtil
.
d
(
TAG
,
"getAdData adData(release) ="
+
adData
);
...
...
app/src/main/java/com/zl/sdk/ad/AdManagerV2.java
View file @
a26c8dc9
package
com
.
zl
.
sdk
.
ad
;
package
com
.
zl
.
sdk
.
ad
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.text.TextUtils
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATAdStatusInfo
;
import
com.anythink.core.api.ATAdStatusInfo
;
...
@@ -11,16 +12,18 @@ import com.zl.sdk.OutHelp;
...
@@ -11,16 +12,18 @@ import com.zl.sdk.OutHelp;
import
com.zl.sdk.event.AdsParamsInfo
;
import
com.zl.sdk.event.AdsParamsInfo
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.ReportBean
;
import
com.zl.sdk.event.ReportBean
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.out.AppOutSP
;
import
com.zl.sdk.out.AppOutSP
;
import
com.zl.sdk.util.AppOutUtils
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.LogUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
AdManagerV2
implements
ATInterstitialListener
{
public
class
AdManagerV2
implements
ATInterstitialListener
{
private
volatile
ATInterstitial
atInterstitial
=
null
;
private
volatile
ATInterstitial
atInterstitial
=
null
;
private
WeakReference
<
OnInAdListener
>
mListener
=
null
;
private
OnInAdListener
mListener
=
null
;
private
int
reloadCount
=
3
;
private
int
reloadCount
=
3
;
...
@@ -95,8 +98,9 @@ public class AdManagerV2 implements ATInterstitialListener {
...
@@ -95,8 +98,9 @@ public class AdManagerV2 implements ATInterstitialListener {
requestTime
=
System
.
currentTimeMillis
();
requestTime
=
System
.
currentTimeMillis
();
EventUtils
.
statAdReport
(
getReportRequestBean
(
adId
));
EventUtils
.
statAdReport
(
getReportRequestBean
(
adId
));
LogUtil
.
d
(
"OutShow"
,
"Topon: ad show mListener="
+
mListener
);
if
(
mListener
!=
null
)
{
if
(
mListener
!=
null
)
{
mListener
.
get
().
onShow
();
mListener
.
onShow
();
}
}
}
}
...
@@ -105,7 +109,8 @@ public class AdManagerV2 implements ATInterstitialListener {
...
@@ -105,7 +109,8 @@ public class AdManagerV2 implements ATInterstitialListener {
LogUtil
.
d
(
"OutShow"
,
"Topon: ad close"
);
LogUtil
.
d
(
"OutShow"
,
"Topon: ad close"
);
EventUtils
.
statAdClose
(
getReportBean
(
atAdInfo
,
null
));
EventUtils
.
statAdClose
(
getReportBean
(
atAdInfo
,
null
));
if
(
mListener
!=
null
)
{
if
(
mListener
!=
null
)
{
mListener
.
get
().
onCloseAd
();
mListener
.
onCloseAd
();
removeListener
();
}
}
OutHelp
.
get
().
setShowLock
(
false
);
OutHelp
.
get
().
setShowLock
(
false
);
...
@@ -130,7 +135,8 @@ public class AdManagerV2 implements ATInterstitialListener {
...
@@ -130,7 +135,8 @@ public class AdManagerV2 implements ATInterstitialListener {
EventUtils
.
statDisplayFail
(
getReportBean
(
null
,
builder
));
EventUtils
.
statDisplayFail
(
getReportBean
(
null
,
builder
));
if
(
mListener
!=
null
)
{
if
(
mListener
!=
null
)
{
mListener
.
get
().
showFail
();
mListener
.
showFail
();
removeListener
();
}
}
OutHelp
.
get
().
setShowLock
(
false
);
OutHelp
.
get
().
setShowLock
(
false
);
...
@@ -141,6 +147,7 @@ public class AdManagerV2 implements ATInterstitialListener {
...
@@ -141,6 +147,7 @@ public class AdManagerV2 implements ATInterstitialListener {
adId
=
id
;
adId
=
id
;
if
(
atInterstitial
!=
null
)
{
if
(
atInterstitial
!=
null
)
{
ATAdStatusInfo
atAdStatusInfo
=
atInterstitial
.
checkAdStatus
();
ATAdStatusInfo
atAdStatusInfo
=
atInterstitial
.
checkAdStatus
();
LogUtil
.
d
(
"OutShow"
,
"atAdStatusInfo :"
+
atAdStatusInfo
);
if
(
atAdStatusInfo
.
isReady
())
{
if
(
atAdStatusInfo
.
isReady
())
{
LogUtil
.
d
(
"OutShow"
,
"ad isReady!"
);
LogUtil
.
d
(
"OutShow"
,
"ad isReady!"
);
return
false
;
return
false
;
...
@@ -167,10 +174,29 @@ public class AdManagerV2 implements ATInterstitialListener {
...
@@ -167,10 +174,29 @@ public class AdManagerV2 implements ATInterstitialListener {
public
void
showAd
(
Activity
activity
,
OnInAdListener
listener
)
{
public
void
showAd
(
Activity
activity
,
OnInAdListener
listener
)
{
LogUtil
.
d
(
"OutShow"
,
"Topon: showAd"
);
LogUtil
.
d
(
"OutShow"
,
"Topon: showAd"
);
mListener
=
new
WeakReference
<>(
listener
)
;
mListener
=
listener
;
ATInterstitial
.
entryAdScenario
(
"111"
,
""
);
ATInterstitial
.
entryAdScenario
(
"111"
,
""
);
atInterstitial
.
show
(
activity
);
atInterstitial
.
show
(
activity
);
statCallShow
(
activity
);
}
public
void
removeListener
()
{
mListener
=
null
;
}
private
void
statCallShow
(
Activity
activity
)
{
try
{
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"screen_state"
,
String
.
valueOf
(
AppOutUtils
.
isScreenOn
()));
para
.
put
(
"foreground"
,
OutHelp
.
get
().
isAppForeground
());
String
adPage
=
OutHelp
.
get
().
getPage
();
if
(!
TextUtils
.
isEmpty
(
adPage
))
{
para
.
put
(
"page"
,
adPage
);
}
Statistics
.
getInstance
().
dotEvent
(
activity
,
"ad_call_show"
,
""
,
para
);
}
catch
(
Exception
e
)
{
}
}
}
...
...
app/src/main/java/com/zl/sdk/ad/topOn/TopOnAdManager.java
View file @
a26c8dc9
...
@@ -31,7 +31,7 @@ public class TopOnAdManager {
...
@@ -31,7 +31,7 @@ public class TopOnAdManager {
LogUtil
.
d
(
TAG
+
"初始化:topon应用信息:"
+
appInfo
);
LogUtil
.
d
(
TAG
+
"初始化:topon应用信息:"
+
appInfo
);
//SDK日志功能,集成测试阶段建议开启,上线前必须关闭
//SDK日志功能,集成测试阶段建议开启,上线前必须关闭
ATSDK
.
setNetworkLogDebug
(
PROP
.
is
Test
());
ATSDK
.
setNetworkLogDebug
(
PROP
.
is
LogEnabled
());
// //检查广告平台的集成状态,提交审核时需注释此API
// //检查广告平台的集成状态,提交审核时需注释此API
// ATSDK.integrationChecking(context);
// ATSDK.integrationChecking(context);
...
...
app/src/main/java/com/zl/sdk/out/CheckHelper.java
View file @
a26c8dc9
...
@@ -23,8 +23,7 @@ public class CheckHelper {
...
@@ -23,8 +23,7 @@ public class CheckHelper {
* 解锁/回到桌面 触发展示的外展广告
* 解锁/回到桌面 触发展示的外展广告
*/
*/
public
static
boolean
checkAdCanShowByScene
(
int
actionState
,
String
scenes
)
{
public
static
boolean
checkAdCanShowByScene
(
int
actionState
,
String
scenes
)
{
if
((
actionState
==
ActionFrom
.
ACTION_TIMER
.
getAction
()
if
((
actionState
==
ActionFrom
.
ACTION_TIMER
.
getAction
())
||
actionState
==
ActionFrom
.
ACTION_BATTERY_CHANGED
.
getAction
())
&&
!
AppOutUtils
.
isScreenOn
())
{
&&
!
AppOutUtils
.
isScreenOn
())
{
LogUtil
.
d
(
TAG
+
"(场景检查)手机未亮屏,不能展示"
);
LogUtil
.
d
(
TAG
+
"(场景检查)手机未亮屏,不能展示"
);
EventUtils
.
staDialogFail
(
DialogFailReason
.
SCREEN_OFF
,
actionState
,
scenes
,
EventUtils
.
DIALOG_TYPE_AD
);
EventUtils
.
staDialogFail
(
DialogFailReason
.
SCREEN_OFF
,
actionState
,
scenes
,
EventUtils
.
DIALOG_TYPE_AD
);
...
...
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
View file @
a26c8dc9
...
@@ -5,6 +5,7 @@ import android.content.Intent;
...
@@ -5,6 +5,7 @@ import android.content.Intent;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Looper
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.KeyEvent
;
import
android.view.Window
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
...
@@ -96,6 +97,7 @@ public class DxActivity extends BaseActivity {
...
@@ -96,6 +97,7 @@ public class DxActivity extends BaseActivity {
LogUtil
.
d
(
TAG
+
"onDestroy hashCode="
+
hashCode
());
LogUtil
.
d
(
TAG
+
"onDestroy hashCode="
+
hashCode
());
mainHandler
.
removeCallbacksAndMessages
(
null
);
mainHandler
.
removeCallbacksAndMessages
(
null
);
AdManagerV2
.
get
().
removeListener
();
final
long
time
=
Math
.
abs
(
onceStayTime
-
System
.
currentTimeMillis
());
final
long
time
=
Math
.
abs
(
onceStayTime
-
System
.
currentTimeMillis
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
@@ -110,7 +112,11 @@ public class DxActivity extends BaseActivity {
...
@@ -110,7 +112,11 @@ public class DxActivity extends BaseActivity {
}
}
public
void
close
()
{
public
void
close
()
{
activity
.
finish
();
try
{
activity
.
finish
();
}
catch
(
Throwable
e
)
{
LogUtil
.
d
(
TAG
+
"close e="
+
Log
.
getStackTraceString
(
e
));
}
}
}
public
void
finishAndRemoveTask
()
{
public
void
finishAndRemoveTask
()
{
...
@@ -150,16 +156,18 @@ public class DxActivity extends BaseActivity {
...
@@ -150,16 +156,18 @@ public class DxActivity extends BaseActivity {
AdManagerV2
.
get
().
showAd
(
activity
,
new
OnInAdListener
()
{
AdManagerV2
.
get
().
showAd
(
activity
,
new
OnInAdListener
()
{
@Override
@Override
public
void
onCloseAd
()
{
public
void
onCloseAd
()
{
LogUtil
.
d
(
TAG
+
"onCloseAd"
);
close
();
}
}
@Override
@Override
public
void
onShow
()
{
public
void
onShow
()
{
LogUtil
.
d
(
TAG
+
"onShow"
);
}
}
@Override
@Override
public
void
showFail
()
{
public
void
showFail
()
{
LogUtil
.
d
(
TAG
+
"showFail"
);
close
();
close
();
}
}
});
});
...
...
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