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
40712597
Commit
40712597
authored
Dec 05, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外展逻辑调整
parent
b3344029
Changes
22
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
374 additions
and
331 deletions
+374
-331
build.gradle
app/build.gradle
+2
-0
mapping.txt
app/mapping.txt
+51
-51
seeds.txt
app/seeds.txt
+106
-106
NameInterfaceHelp.java
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
+0
-2
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+2
-2
AdBean.java
app/src/main/java/com/zl/sdk/ad/AdBean.java
+4
-4
AdDataManager.java
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
+18
-18
TopOnAdLoadManager.java
app/src/main/java/com/zl/sdk/ad/TopOnAdLoadManager.java
+21
-21
TopOnAdInterstitialCallBack.java
...m/zl/sdk/ad/interstitial/TopOnAdInterstitialCallBack.java
+3
-3
TopOnAdNativeCallBack.java
...ain/java/com/zl/sdk/ad/natives/TopOnAdNativeCallBack.java
+3
-3
IconOpt.java
app/src/main/java/com/zl/sdk/bean/IconOpt.java
+6
-1
OutAdData.java
app/src/main/java/com/zl/sdk/bean/OutAdData.java
+54
-29
OutConfig.java
app/src/main/java/com/zl/sdk/bean/OutConfig.java
+7
-0
DataManager.java
app/src/main/java/com/zl/sdk/data/DataManager.java
+42
-34
EventUtils.java
app/src/main/java/com/zl/sdk/event/EventUtils.java
+5
-6
BaseOutShowManager.java
app/src/main/java/com/zl/sdk/out/BaseOutShowManager.java
+3
-3
CheckHelper.java
app/src/main/java/com/zl/sdk/out/CheckHelper.java
+8
-8
DxManager.java
app/src/main/java/com/zl/sdk/out/DxManager.java
+4
-4
OutAdManager.java
app/src/main/java/com/zl/sdk/out/OutAdManager.java
+20
-20
DialogFactory.java
app/src/main/java/com/zl/sdk/out/ui/DialogFactory.java
+2
-2
DxActivity.java
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
+8
-9
WeatherPureAdDialog.java
app/src/main/java/com/zl/sdk/out/ui/WeatherPureAdDialog.java
+5
-5
No files found.
app/build.gradle
View file @
40712597
...
...
@@ -35,6 +35,8 @@ dependencies {
// implementation 'com.global.wt:l1b2t123457j1:v28.5.1'
implementation
'com.alibaba:fastjson:2.0.28'
implementation
platform
(
'com.google.firebase:firebase-bom:32.1.0'
)
implementation
'com.google.firebase:firebase-analytics'
...
...
app/mapping.txt
View file @
40712597
This diff is collapsed.
Click to expand it.
app/seeds.txt
View file @
40712597
This diff is collapsed.
Click to expand it.
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
View file @
40712597
...
...
@@ -131,7 +131,6 @@ public class NameInterfaceHelp {
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
callBackMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
GetNewCallBackMethod
);
Object
obj
=
callBackMethod
.
invoke
(
null
);
LogUtil
.
d
(
"OutShow 反射获取 getNewCallBack"
);
return
obj
;
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
...
...
@@ -149,7 +148,6 @@ public class NameInterfaceHelp {
public
static
String
GetNewCallBackMethod
=
"getNewCallBack"
;
/**
* 获取保活方法的方法名称
*/
...
...
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
40712597
...
...
@@ -272,13 +272,13 @@ public final class OutHelp implements KPListener {
}
Class
<?>
startCallbackClass
=
Class
.
forName
(
NameInterfaceHelp
.
getStartCallbackClassPath
());
if
(
startCallbackClass
==
null
)
{
LogUtil
.
d
(
TAG
+
"拉起外展 startCallbackClass=null"
);
callback
.
fail
(
"startCallbackClass=null"
);
return
;
}
Object
callObj
=
NameInterfaceHelp
.
getNewCallBack
();
...
...
@@ -325,7 +325,7 @@ public final class OutHelp implements KPListener {
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
|
InstantiationException
e
)
{
LogUtil
.
d
(
TAG
+
"拉起外展:(catch) fail="
+
e
);
LogUtil
.
d
(
TAG
+
"拉起外展:(catch) fail="
+
e
.
getMessage
()
);
if
(
callback
!=
null
)
{
callback
.
fail
(
"执行失败"
);
}
...
...
app/src/main/java/com/zl/sdk/ad/AdBean.java
View file @
40712597
package
com
.
zl
.
sdk
.
ad
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
public
class
AdBean
{
private
Weather
AdData
.
NormalAdData
adData
;
private
Out
AdData
.
NormalAdData
adData
;
private
String
adUnitId
;
private
String
adPosition
;
...
...
@@ -25,11 +25,11 @@ public class AdBean {
return
nativeTemplate
==
3
||
nativeTemplate
==
4
||
nativeTemplate
==
5
;
}
public
Weather
AdData
.
NormalAdData
getAdData
()
{
public
Out
AdData
.
NormalAdData
getAdData
()
{
return
adData
;
}
public
AdBean
setAdData
(
Weather
AdData
.
NormalAdData
adData
)
{
public
AdBean
setAdData
(
Out
AdData
.
NormalAdData
adData
)
{
this
.
adData
=
adData
;
return
this
;
}
...
...
app/src/main/java/com/zl/sdk/ad/AdDataManager.java
View file @
40712597
package
com
.
zl
.
sdk
.
ad
;
import
static
com
.
zl
.
sdk
.
bean
.
Weather
AdData
.
CP_AD_TOPON
;
import
static
com
.
zl
.
sdk
.
bean
.
Weather
AdData
.
CP_AD_TYPE_CHAPING
;
import
static
com
.
zl
.
sdk
.
bean
.
Out
AdData
.
CP_AD_TOPON
;
import
static
com
.
zl
.
sdk
.
bean
.
Out
AdData
.
CP_AD_TYPE_CHAPING
;
import
android.text.TextUtils
;
import
com.zl.sdk.OutHelp
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
import
com.zl.sdk.data.DataManager
;
import
com.zl.sdk.util.LogUtil
;
...
...
@@ -29,21 +29,21 @@ public class AdDataManager {
private
static
final
String
TAG
=
"OutShow AdDataManager --> "
;
private
Weather
AdData
.
NormalAdData
defaultData
=
null
;
private
Out
AdData
.
NormalAdData
defaultData
=
null
;
public
void
setDefaultData
(
Weather
AdData
.
NormalAdData
defaultData
)
{
public
void
setDefaultData
(
Out
AdData
.
NormalAdData
defaultData
)
{
this
.
defaultData
=
defaultData
;
}
public
Weather
AdData
.
NormalAdData
getDefaultData
()
{
public
Out
AdData
.
NormalAdData
getDefaultData
()
{
return
defaultData
;
}
public
ArrayList
<
Weather
AdData
.
NormalAdData
>
getOutAdData
(
int
position
,
String
cpName
)
{
Map
<
Integer
,
ArrayList
<
Weather
AdData
.
NormalAdData
>>
adDataFromSP
=
DataManager
.
get
().
getAdDataFromSP
(
OutHelp
.
get
().
getContext
());
public
ArrayList
<
Out
AdData
.
NormalAdData
>
getOutAdData
(
int
position
,
String
cpName
)
{
Map
<
Integer
,
ArrayList
<
Out
AdData
.
NormalAdData
>>
adDataFromSP
=
DataManager
.
get
().
getAdDataFromSP
(
OutHelp
.
get
().
getContext
());
ArrayList
<
Weather
AdData
.
NormalAdData
>
cpNameList
=
new
ArrayList
<>();
ArrayList
<
Out
AdData
.
NormalAdData
>
cpNameList
=
new
ArrayList
<>();
if
(
adDataFromSP
==
null
||
adDataFromSP
.
isEmpty
())
{
LogUtil
.
d
(
TAG
+
"getOutAdData adDataMap empty"
);
...
...
@@ -55,14 +55,14 @@ public class AdDataManager {
return
cpNameList
;
}
ArrayList
<
Weather
AdData
.
NormalAdData
>
list
=
adDataFromSP
.
get
(
position
);
ArrayList
<
Out
AdData
.
NormalAdData
>
list
=
adDataFromSP
.
get
(
position
);
if
(
list
==
null
)
{
LogUtil
.
d
(
TAG
+
"getOutAdData list empty position ="
+
position
);
return
cpNameList
;
}
for
(
Weather
AdData
.
NormalAdData
data
:
list
)
{
for
(
Out
AdData
.
NormalAdData
data
:
list
)
{
LogUtil
.
d
(
TAG
+
"getOutAdData data.cpAdtype ="
+
data
.
cpAdtype
+
" ,cpName :"
+
cpName
+
",,,"
+
data
.
cpName
);
if
(
cpName
.
equalsIgnoreCase
(
data
.
cpName
))
{
if
(
CP_AD_TYPE_CHAPING
.
equals
(
data
.
cpAdtype
))
{
...
...
@@ -83,11 +83,11 @@ public class AdDataManager {
*
* @return
*/
public
Weather
AdData
.
NormalAdData
getShowAdData
()
{
public
Out
AdData
.
NormalAdData
getShowAdData
()
{
try
{
Weather
AdData
.
NormalAdData
adData
=
null
;
Out
AdData
.
NormalAdData
adData
=
null
;
ArrayList
<
WeatherAdData
.
NormalAdData
>
list
=
AdDataManager
.
get
().
getOutAdData
(
Weather
AdData
.
POSITION_HOME
,
CP_AD_TOPON
);
ArrayList
<
OutAdData
.
NormalAdData
>
list
=
AdDataManager
.
get
().
getOutAdData
(
Out
AdData
.
POSITION_HOME
,
CP_AD_TOPON
);
int
size
=
list
.
size
();
...
...
@@ -103,10 +103,10 @@ public class AdDataManager {
}
if
(
adData
==
null
)
{
adData
=
new
Weather
AdData
.
NormalAdData
();
adData
.
cpName
=
Weather
AdData
.
CP_AD_TOPON
;
adData
.
cpAdtype
=
Weather
AdData
.
CP_AD_TYPE_CHAPING
;
adData
.
position
=
Weather
AdData
.
POSITION_HOME
;
adData
=
new
Out
AdData
.
NormalAdData
();
adData
.
cpName
=
Out
AdData
.
CP_AD_TOPON
;
adData
.
cpAdtype
=
Out
AdData
.
CP_AD_TYPE_CHAPING
;
adData
.
position
=
Out
AdData
.
POSITION_HOME
;
adData
.
cpAppid
=
PROP
.
isTest
()
?
"a6501757a165c4"
:
""
;
adData
.
cpAdslot
=
PROP
.
isTest
()
?
"b6509805ed0208"
:
""
;
//cp:b6509805ed0208 native:b1f5eocpkk4f3f release cp:b1f5i60t92g4gq
adData
.
showCount
=
5
;
...
...
app/src/main/java/com/zl/sdk/ad/TopOnAdLoadManager.java
View file @
40712597
...
...
@@ -16,7 +16,7 @@ import com.zl.sdk.ad.interstitial.TopOnAdInterstitialCallBack;
import
com.zl.sdk.ad.interstitial.TopOnInterstitialAdLoad
;
import
com.zl.sdk.ad.natives.TopOnAdNativeCallBack
;
import
com.zl.sdk.ad.natives.TopOnNativeAdManager
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
...
...
@@ -47,7 +47,7 @@ public final class TopOnAdLoadManager {
private
TopOnAdInterstitialCallBack
adInterstitialCallBack
=
new
TopOnAdInterstitialCallBack
()
{
@Override
public
void
onAdLoaded
(
String
adUnitId
,
String
adScenes
,
Weather
AdData
.
NormalAdData
adData
,
ATInterstitial
ad
)
{
public
void
onAdLoaded
(
String
adUnitId
,
String
adScenes
,
Out
AdData
.
NormalAdData
adData
,
ATInterstitial
ad
)
{
LogUtil
.
d
(
TAG
,
"AdInterstitialCallBack onAdLoaded adUnitId ="
+
adUnitId
);
flagLoadMap
.
put
(
adUnitId
,
true
);
adCacheDataMap
.
put
(
adUnitId
,
new
AdCacheData
(
ad
,
System
.
currentTimeMillis
(),
adUnitId
));
...
...
@@ -67,7 +67,7 @@ public final class TopOnAdLoadManager {
}
@Override
public
void
onAdDisplayed
(
String
adUnitId
,
Weather
AdData
.
NormalAdData
adData
)
{
public
void
onAdDisplayed
(
String
adUnitId
,
Out
AdData
.
NormalAdData
adData
)
{
LogUtil
.
d
(
TAG
,
"AdInterstitialCallBack onAdDisplayed adUnitId ="
+
adUnitId
);
flagLoadMap
.
put
(
adUnitId
,
true
);
adCacheDataMap
.
remove
(
adUnitId
);
...
...
@@ -115,7 +115,7 @@ public final class TopOnAdLoadManager {
};
private
TopOnAdNativeCallBack
adNativeCallBack
=
new
TopOnAdNativeCallBack
()
{
@Override
public
void
onNativeAdLoaded
(
String
adUnitId
,
String
adScenes
,
Weather
AdData
.
NormalAdData
adData
,
@Nullable
ATNativeAdView
atNative
)
{
public
void
onNativeAdLoaded
(
String
adUnitId
,
String
adScenes
,
Out
AdData
.
NormalAdData
adData
,
@Nullable
ATNativeAdView
atNative
)
{
LogUtil
.
d
(
TAG
,
"AdNativeCallBack onNativeAdLoaded adUnitId ="
+
adUnitId
);
if
(
null
==
atNative
)
{
...
...
@@ -165,7 +165,7 @@ public final class TopOnAdLoadManager {
}
@Override
public
void
onAdImpression
(
String
adUnitId
,
Weather
AdData
.
NormalAdData
adData
)
{
public
void
onAdImpression
(
String
adUnitId
,
Out
AdData
.
NormalAdData
adData
)
{
LogUtil
.
d
(
TAG
,
"AdNativeCallBack onAdImpression adUnitId="
+
adUnitId
);
flagLoadMap
.
put
(
adUnitId
,
true
);
adCacheDataMap
.
remove
(
adUnitId
);
...
...
@@ -198,7 +198,7 @@ public final class TopOnAdLoadManager {
return
adCacheDataMap
.
get
(
adUnitId
);
}
public
void
loadInterstitialAd
(
Weather
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
public
void
loadInterstitialAd
(
Out
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
if
(
null
==
normalAdData
||
TextUtils
.
isEmpty
(
normalAdData
.
cpAdslot
))
{
LogUtil
.
d
(
TAG
,
"loadInterstitialAd data or adId empty"
);
callInterstitialNotAd
(
AdErrorMessage
.
AD_DATA_IS_NULL_OR_NOT_ADUNITID
);
...
...
@@ -231,7 +231,7 @@ public final class TopOnAdLoadManager {
callInterstitialNotAd
(
AdErrorMessage
.
NOT_AD_CP
);
return
;
}
if
(!
cpName
.
equalsIgnoreCase
(
Weather
AdData
.
CP_AD_TOPON
))
{
if
(!
cpName
.
equalsIgnoreCase
(
Out
AdData
.
CP_AD_TOPON
))
{
LogUtil
.
d
(
TAG
,
"loadInterstitialAd adCp not support"
);
callInterstitialNotAd
(
AdErrorMessage
.
AD_CP_NOT_SUPPORT
);
return
;
...
...
@@ -264,7 +264,7 @@ public final class TopOnAdLoadManager {
LogUtil
.
d
(
TAG
,
"isInterstitialReady data empty"
);
return
false
;
}
if
(!
cpName
.
equalsIgnoreCase
(
Weather
AdData
.
CP_AD_TOPON
))
{
if
(!
cpName
.
equalsIgnoreCase
(
Out
AdData
.
CP_AD_TOPON
))
{
LogUtil
.
d
(
TAG
,
"isInterstitialReady no ad"
);
return
false
;
}
...
...
@@ -286,7 +286,7 @@ public final class TopOnAdLoadManager {
return
false
;
}
public
void
showInterstitialAd
(
Activity
activity
,
Weather
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
public
void
showInterstitialAd
(
Activity
activity
,
Out
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
if
(
null
==
normalAdData
||
TextUtils
.
isEmpty
(
normalAdData
.
cpAdslot
))
{
LogUtil
.
d
(
TAG
,
"showInterstitialAd data or adId empty"
);
callInterstitialNotAd
(
AdErrorMessage
.
AD_DATA_IS_NULL_OR_NOT_ADUNITID
);
...
...
@@ -304,7 +304,7 @@ public final class TopOnAdLoadManager {
callInterstitialNotAd
(
AdErrorMessage
.
NOT_AD_CP
);
return
;
}
if
(!
cpName
.
equalsIgnoreCase
(
Weather
AdData
.
CP_AD_TOPON
))
{
if
(!
cpName
.
equalsIgnoreCase
(
Out
AdData
.
CP_AD_TOPON
))
{
LogUtil
.
d
(
TAG
,
"showInterstitialAd adCp not support"
);
callInterstitialNotAd
(
AdErrorMessage
.
AD_CP_NOT_SUPPORT
);
return
;
...
...
@@ -315,10 +315,10 @@ public final class TopOnAdLoadManager {
return
;
}
boolean
adScenesSupport
=
false
;
if
(
normalAdData
.
position
==
Weather
AdData
.
POSITION_HOME
)
{
if
(
normalAdData
.
position
==
Out
AdData
.
POSITION_HOME
)
{
LogUtil
.
d
(
TAG
,
"showInterstitialAd AdScenes HOME"
);
adScenesSupport
=
true
;
}
else
if
(
normalAdData
.
position
==
Weather
AdData
.
POSITION_LOCK
)
{
}
else
if
(
normalAdData
.
position
==
Out
AdData
.
POSITION_LOCK
)
{
LogUtil
.
d
(
TAG
,
"showInterstitialAd AdScenes LOCK"
);
adScenesSupport
=
true
;
}
...
...
@@ -354,7 +354,7 @@ public final class TopOnAdLoadManager {
Statistics
.
getInstance
().
dotEvent
(
mContext
,
"nt_state"
,
""
,
map
);
}
public
void
loadNativeAd
(
Weather
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
public
void
loadNativeAd
(
Out
AdData
.
NormalAdData
normalAdData
,
String
adScenes
)
{
if
(
null
==
normalAdData
||
TextUtils
.
isEmpty
(
normalAdData
.
cpAdslot
))
{
LogUtil
.
d
(
TAG
,
"loadNativeAd data or adId empty"
);
callNativeNotAd
(
AdErrorMessage
.
AD_DATA_IS_NULL_OR_NOT_ADUNITID
);
...
...
@@ -383,7 +383,7 @@ public final class TopOnAdLoadManager {
callNativeNotAd
(
AdErrorMessage
.
NOT_AD_CP
);
return
;
}
if
(!
cpName
.
equalsIgnoreCase
(
Weather
AdData
.
CP_AD_TOPON
))
{
if
(!
cpName
.
equalsIgnoreCase
(
Out
AdData
.
CP_AD_TOPON
))
{
LogUtil
.
d
(
TAG
,
"loadNativeAd adCp not support"
);
callNativeNotAd
(
AdErrorMessage
.
AD_CP_NOT_SUPPORT
);
return
;
...
...
@@ -409,7 +409,7 @@ public final class TopOnAdLoadManager {
}
}
public
void
showNativeAd
(
Weather
AdData
.
NormalAdData
normalAdData
,
LinearLayout
adContent
)
{
public
void
showNativeAd
(
Out
AdData
.
NormalAdData
normalAdData
,
LinearLayout
adContent
)
{
if
(
null
==
normalAdData
||
TextUtils
.
isEmpty
(
normalAdData
.
cpAdslot
))
{
LogUtil
.
d
(
TAG
,
"showNativeAd data or adId empty"
);
callNativeNotAd
(
AdErrorMessage
.
AD_DATA_IS_NULL_OR_NOT_ADUNITID
);
...
...
@@ -427,7 +427,7 @@ public final class TopOnAdLoadManager {
callNativeNotAd
(
AdErrorMessage
.
NOT_AD_CP
);
return
;
}
if
(!
cpName
.
equalsIgnoreCase
(
Weather
AdData
.
CP_AD_TOPON
))
{
if
(!
cpName
.
equalsIgnoreCase
(
Out
AdData
.
CP_AD_TOPON
))
{
LogUtil
.
d
(
TAG
,
"showNativeAd adCp not support"
);
callNativeNotAd
(
AdErrorMessage
.
AD_CP_NOT_SUPPORT
);
return
;
...
...
@@ -695,10 +695,10 @@ public final class TopOnAdLoadManager {
return
;
}
switch
(
adType
)
{
case
Weather
AdData
.
CP_AD_TYPE_CHAPING
:
case
Out
AdData
.
CP_AD_TYPE_CHAPING
:
registerInterstitialCallBack
(
tag
,
onInAdListener
);
break
;
case
Weather
AdData
.
CP_AD_TYPE_NATIVE
:
case
Out
AdData
.
CP_AD_TYPE_NATIVE
:
registerNativeCallBack
(
tag
,
onInAdListener
);
break
;
default
:
...
...
@@ -711,10 +711,10 @@ public final class TopOnAdLoadManager {
return
;
}
switch
(
adType
)
{
case
Weather
AdData
.
CP_AD_TYPE_CHAPING
:
case
Out
AdData
.
CP_AD_TYPE_CHAPING
:
unregisterInterstitialCallBack
(
tag
);
break
;
case
Weather
AdData
.
CP_AD_TYPE_NATIVE
:
case
Out
AdData
.
CP_AD_TYPE_NATIVE
:
unregisterNativeCallBack
(
tag
);
break
;
default
:
...
...
@@ -772,7 +772,7 @@ public final class TopOnAdLoadManager {
listenerHashMap
.
remove
(
tag
);
}
private
void
countAdShowTimes
(
Weather
AdData
.
NormalAdData
adData
)
{
private
void
countAdShowTimes
(
Out
AdData
.
NormalAdData
adData
)
{
LogUtil
.
d
(
TAG
,
"countAdShowTimes adData ="
+
adData
);
OutAdManager
.
get
().
showAdSuccess
(
adData
);
}
...
...
app/src/main/java/com/zl/sdk/ad/interstitial/TopOnAdInterstitialCallBack.java
View file @
40712597
package
com
.
zl
.
sdk
.
ad
.
interstitial
;
import
com.anythink.interstitial.api.ATInterstitial
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
public
interface
TopOnAdInterstitialCallBack
{
public
void
onAdLoaded
(
String
adUnitId
,
String
adScenes
,
Weather
AdData
.
NormalAdData
adData
,
ATInterstitial
ad
);
public
void
onAdLoaded
(
String
adUnitId
,
String
adScenes
,
Out
AdData
.
NormalAdData
adData
,
ATInterstitial
ad
);
public
void
onAdDisplayed
(
String
adUnitId
,
Weather
AdData
.
NormalAdData
adData
);
public
void
onAdDisplayed
(
String
adUnitId
,
Out
AdData
.
NormalAdData
adData
);
public
void
onAdHidden
(
String
adUnitId
);
...
...
app/src/main/java/com/zl/sdk/ad/natives/TopOnAdNativeCallBack.java
View file @
40712597
...
...
@@ -3,11 +3,11 @@ package com.zl.sdk.ad.natives;
import
androidx.annotation.Nullable
;
import
com.anythink.nativead.api.ATNativeAdView
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
public
interface
TopOnAdNativeCallBack
{
void
onNativeAdLoaded
(
String
adUnitId
,
String
adScenes
,
Weather
AdData
.
NormalAdData
adData
,
@Nullable
ATNativeAdView
atNative
);
void
onNativeAdLoaded
(
String
adUnitId
,
String
adScenes
,
Out
AdData
.
NormalAdData
adData
,
@Nullable
ATNativeAdView
atNative
);
void
onNativeAdLoadFailed
(
String
adUnitId
,
String
errorMsg
);
...
...
@@ -17,7 +17,7 @@ public interface TopOnAdNativeCallBack {
void
onAdRevenuePaid
(
String
adUnitId
);
void
onAdImpression
(
String
adUnitId
,
Weather
AdData
.
NormalAdData
adData
);
void
onAdImpression
(
String
adUnitId
,
Out
AdData
.
NormalAdData
adData
);
void
onCloseAd
();
...
...
app/src/main/java/com/zl/sdk/bean/IconOpt.java
View file @
40712597
package
com
.
zl
.
sdk
.
bean
;
import
com.google.gson.annotations.SerializedName
;
import
java.io.Serializable
;
public
class
IconOpt
implements
Serializable
{
@SerializedName
(
"is_screen_off"
)
public
boolean
is_screen_off
=
false
;
public
int
hide_sw
=
0
;
// 0 --什么也不做; 1-隐藏icon; 2-显示icon
@SerializedName
(
"hide_sw"
)
public
int
hide_sw
=
0
;
// 0-什么也不做; 1-隐藏icon; 2-显示icon
@SerializedName
(
"hide_interval_time"
)
public
int
hide_interval_time
=
0
;
//没有进入过天气应用的间隔时间
@Override
...
...
app/src/main/java/com/zl/sdk/bean/
Weather
AdData.java
→
app/src/main/java/com/zl/sdk/bean/
Out
AdData.java
View file @
40712597
...
...
@@ -2,12 +2,17 @@ package com.zl.sdk.bean;
import
android.text.TextUtils
;
import
androidx.annotation.Keep
;
import
com.google.gson.annotations.SerializedName
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
public
class
WeatherAdData
extends
BaseWeatherBean
{
@Keep
public
class
OutAdData
extends
BaseWeatherBean
{
public
static
final
String
CP_AD_TOPON
=
"topon"
;
public
static
final
String
CP_AD_PANGLE
=
"Pangle"
;
public
static
final
String
CP_ADMOD_PARTNER_ADMOD
=
"admob"
;
...
...
@@ -29,26 +34,6 @@ public class WeatherAdData extends BaseWeatherBean {
public
static
final
String
JUMP_TYPE_DEEPLINK
=
"DeepLink"
;
public
static
final
String
JUMP_TYPE_WEB
=
"H5"
;
//开平广告
public
final
static
int
POSITION0
=
0
;
//首页顶部广告
public
final
static
int
POSITION1
=
1
;
//主界面激励广告
public
final
static
int
POSITION2
=
2
;
//主界面底部悬浮广告
public
final
static
int
POSITION3
=
3
;
//应用退出广告
public
final
static
int
POSITION4
=
4
;
//全屏插屏广告
public
final
static
int
POSITION5
=
5
;
//卡片广告
public
final
static
int
POSITION6
=
6
;
//熱啓動開屏廣告
// public final static int POSITION7 = 7;
//air_quality_detail
public
final
static
int
POSITION8
=
8
;
//hour weather details page
public
final
static
int
POSITION9
=
9
;
//锁屏
public
final
static
int
POSITION_LOCK
=
10001
;
//桌面
...
...
@@ -62,8 +47,16 @@ public class WeatherAdData extends BaseWeatherBean {
public
final
static
int
AD_SELF_FLAG
=
1
;
public
final
static
int
AD_OTHER_FLAG
=
0
;
@SerializedName
(
"data"
)
private
Data
data
;
@Override
public
String
toString
()
{
return
"WeatherAdData{"
+
"data="
+
data
+
'}'
;
}
public
boolean
isDataOK
()
{
return
"0"
.
equals
(
getErrorCode
());
}
...
...
@@ -76,14 +69,29 @@ public class WeatherAdData extends BaseWeatherBean {
this
.
data
=
data
;
}
@Keep
public
static
class
Data
implements
Serializable
{
@SerializedName
(
"normal"
)
public
List
<
NormalAdData
>
normal
=
new
ArrayList
<>(
8
);
@SerializedName
(
"config"
)
public
ConfigData
config
=
new
ConfigData
();
@Override
public
String
toString
()
{
return
"Data{"
+
"normal="
+
normal
+
", config="
+
config
+
'}'
;
}
}
@Keep
public
static
class
NormalAdData
implements
Serializable
{
@SerializedName
(
"id"
)
public
int
id
;
@SerializedName
(
"title"
)
public
String
title
;
@SerializedName
(
"ad_Scenes"
)
public
String
ad_Scenes
;
@Override
...
...
@@ -119,14 +127,20 @@ public class WeatherAdData extends BaseWeatherBean {
'}'
;
}
@SerializedName
(
"position"
)
//0=开平广告; 1=首页顶部广告; 2=主界面激励广告; 3=主界面底部悬浮广告; 4=应用退出广告; 5=全屏插屏广告; 6=卡片广告
public
int
position
;
//1=自动小; 2=自动大; 3=手动小; 4=手动中; 5=手动大
@SerializedName
(
"adStyle"
)
public
int
adStyle
=
1
;
@SerializedName
(
"jumpType"
)
public
String
jumpType
;
//DeepLink/H5
@SerializedName
(
"jumpData"
)
public
String
jumpData
;
@SerializedName
(
"interval"
)
public
int
interval
;
//刷新间隔时间/s
@SerializedName
(
"intervalHide"
)
public
int
intervalHide
;
//刷新间隔时间/s 隐藏icon
public
int
showCount
;
//展示次数(总)
public
int
showTimes
;
//针对cpAdtype类型的展示次数
...
...
@@ -161,14 +175,6 @@ public class WeatherAdData extends BaseWeatherBean {
return
position
==
POSITION_HOME
||
position
==
POSITION_LOCK
;
}
public
boolean
isCardAdTypeByPositionSix
()
{
return
position
==
POSITION6
;
}
public
boolean
isOpenAdType
()
{
return
position
==
POSITION0
;
}
public
boolean
isSelfFlag
()
{
return
selfFlag
==
AD_SELF_FLAG
;
}
...
...
@@ -233,10 +239,19 @@ public class WeatherAdData extends BaseWeatherBean {
}
@Keep
public
static
class
ConfigData
implements
Serializable
{
public
List
<
ConfigAdData
>
timesConfig
=
new
ArrayList
<>();
@Override
public
String
toString
()
{
return
"ConfigData{"
+
"timesConfig="
+
timesConfig
+
'}'
;
}
}
@Keep
public
static
class
ConfigAdData
implements
Serializable
{
//1=应用每天总展示次数类型 2=平台每天展示次数类型,会存在多个平台,会存在多个 3=免费广告时长类型/小时 4=免费广告次数类型
public
int
type
;
...
...
@@ -258,8 +273,18 @@ public class WeatherAdData extends BaseWeatherBean {
public
boolean
isFreeAdCountType
()
{
return
type
==
CONFIG_TYPE_AD_FREE_COUNT
;
}
@Override
public
String
toString
()
{
return
"ConfigAdData{"
+
"type="
+
type
+
", name='"
+
name
+
'\''
+
", value='"
+
value
+
'\''
+
'}'
;
}
}
@Keep
public
static
class
CpAdData
implements
Serializable
{
public
String
name
;
public
String
appid
;
...
...
app/src/main/java/com/zl/sdk/bean/OutConfig.java
View file @
40712597
package
com
.
zl
.
sdk
.
bean
;
import
androidx.annotation.Keep
;
import
com.google.gson.annotations.SerializedName
;
import
java.io.Serializable
;
@Keep
public
class
OutConfig
implements
Serializable
{
@SerializedName
(
"retry_interval_time"
)
public
int
retry_interval_time
=
0
;
//外展广告重试间隔时间
@SerializedName
(
"retry_times"
)
public
int
retry_times
=
0
;
//外展广告重试次数
@Override
...
...
app/src/main/java/com/zl/sdk/data/DataManager.java
View file @
40712597
package
com
.
zl
.
sdk
.
data
;
import
static
com
.
zl
.
sdk
.
bean
.
Weather
AdData
.
CP_AD_TOPON
;
import
static
com
.
zl
.
sdk
.
bean
.
Out
AdData
.
CP_AD_TOPON
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.google.gson.Gson
;
import
com.zl.sdk.bean.OutConfig
;
import
com.zl.sdk.bean.IconOpt
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.OutConfig
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.SPUtils
;
...
...
@@ -40,60 +41,64 @@ public class DataManager {
private
static
final
String
OUT_CONFIG
=
"out_config"
;
private
static
final
String
ICON_CONFIG
=
"icon_config"
;
private
Map
<
Integer
,
ArrayList
<
Weather
AdData
.
NormalAdData
>>
adDataMap
=
null
;
private
Map
<
Integer
,
ArrayList
<
Out
AdData
.
NormalAdData
>>
adDataMap
=
null
;
private
IconOpt
iconOpt
=
null
;
private
OutConfig
outConfig
=
null
;
/**
* 从SP中获取广告信息
*/
public
Map
<
Integer
,
ArrayList
<
Weather
AdData
.
NormalAdData
>>
getAdDataFromSP
(
Context
context
)
{
public
Map
<
Integer
,
ArrayList
<
Out
AdData
.
NormalAdData
>>
getAdDataFromSP
(
Context
context
)
{
if
(
adDataMap
!=
null
)
{
LogUtil
.
d
(
TAG
+
"Ad配置 1 = "
+
adDataMap
);
return
adDataMap
;
}
String
adConfigString
=
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getString
(
AD_CONFIG
,
""
);
LogUtil
.
d
(
TAG
+
"Ad配置 adConfigString= "
+
adConfigString
);
WeatherAdData
weather
AdData
=
null
;
OutAdData
out
AdData
=
null
;
if
(!
TextUtils
.
isEmpty
(
adConfigString
))
{
try
{
weatherAdData
=
new
Gson
().
fromJson
(
adConfigString
,
WeatherAdData
.
class
);
}
catch
(
Exception
ignored
)
{
}
if
(
weatherAdData
==
null
)
{
outAdData
=
JSON
.
parseObject
(
adConfigString
,
OutAdData
.
class
);
LogUtil
.
d
(
TAG
+
"Ad配置 weatherAdData= "
+
outAdData
);
if
(
outAdData
==
null
)
{
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
remove
(
AD_CONFIG
,
true
);
}
}
if
(
weatherAdData
==
null
||
!
weatherAdData
.
isDataOK
())
{
if
(
outAdData
==
null
)
{
LogUtil
.
d
(
TAG
+
"Ad配置 error 1"
);
return
null
;
}
WeatherAdData
.
Data
data
=
weather
AdData
.
getData
();
OutAdData
.
Data
data
=
out
AdData
.
getData
();
if
(
data
==
null
)
{
LogUtil
.
d
(
TAG
+
"Ad配置 error 2"
);
return
null
;
}
if
(
data
.
normal
.
isEmpty
())
{
LogUtil
.
d
(
TAG
+
"Ad配置 error 3"
);
return
null
;
}
adDataMap
=
new
HashMap
<>();
for
(
Weather
AdData
.
NormalAdData
adData
:
data
.
normal
)
{
for
(
Out
AdData
.
NormalAdData
adData
:
data
.
normal
)
{
if
(
adData
.
isSelfFlag
())
{
continue
;
}
List
<
Weather
AdData
.
CpAdData
>
cpList
=
adData
.
cpList
;
List
<
Out
AdData
.
CpAdData
>
cpList
=
adData
.
cpList
;
if
(
cpList
.
isEmpty
())
{
continue
;
}
if
(
adData
.
isWZAdType
())
{
ArrayList
<
Weather
AdData
.
NormalAdData
>
adDataList
=
new
ArrayList
<>();
for
(
Weather
AdData
.
CpAdData
cpAdData
:
cpList
)
{
ArrayList
<
Out
AdData
.
NormalAdData
>
adDataList
=
new
ArrayList
<>();
for
(
Out
AdData
.
CpAdData
cpAdData
:
cpList
)
{
String
cpName
=
cpAdData
.
name
;
String
appid
=
cpAdData
.
appid
;
String
adslot
=
cpAdData
.
adslot
;
...
...
@@ -106,20 +111,20 @@ public class DataManager {
adData
.
cpName
=
cpAdData
.
name
;
adData
.
cpAppid
=
cpAdData
.
appid
;
adData
.
cpAdslot
=
cpAdData
.
adslot
;
adData
.
cpAdtype
=
cpAdData
.
adType
;
adData
.
cpAdtype
=
cpAdData
.
adType
.
replace
(
".0"
,
""
)
;
adData
.
showTimes
=
cpAdData
.
showTimes
;
adData
.
showTimesHideForAdId
=
cpAdData
.
showTimesHide
;
adData
.
adStyle
=
cpAdData
.
adStyle
;
adData
.
ad_Scenes
=
"wz"
;
Weather
AdData
.
NormalAdData
newAdData
=
adData
.
cloneAdData
();
Out
AdData
.
NormalAdData
newAdData
=
adData
.
cloneAdData
();
adDataList
.
add
(
newAdData
);
}
}
LogUtil
.
d
(
TAG
+
"adData = "
+
data
);
LogUtil
.
d
(
TAG
+
"
Ad配置
adData = "
+
data
);
adDataMap
.
put
(
adData
.
position
,
adDataList
);
}
}
LogUtil
.
d
(
TAG
+
"Ad配置 2 = "
+
adDataMap
);
return
adDataMap
;
}
...
...
@@ -128,23 +133,23 @@ public class DataManager {
*/
public
OutConfig
getOutDataFromSP
(
Context
context
)
{
if
(
outConfig
!=
null
)
{
LogUtil
.
d
(
TAG
+
"Out配置 1 = "
+
outConfig
);
return
outConfig
;
}
String
outConfigString
=
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getString
(
OUT_CONFIG
,
""
);
if
(!
TextUtils
.
isEmpty
(
outConfigString
))
{
try
{
outConfig
=
new
Gson
().
fromJson
(
outConfigString
,
OutConfig
.
class
);
}
catch
(
Exception
ignored
)
{
}
LogUtil
.
d
(
TAG
+
"Out配置 SP数据:"
+
outConfigString
);
outConfig
=
JSON
.
parseObject
(
outConfigString
,
OutConfig
.
class
);
if
(
outConfig
==
null
)
{
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
remove
(
OUT_CONFIG
,
true
);
}
}
else
{
LogUtil
.
d
(
TAG
+
"Out配置 SP数据为空"
);
}
LogUtil
.
d
(
TAG
+
"outConfig = "
+
outConfig
);
LogUtil
.
d
(
TAG
+
"Out配置 2 = "
+
outConfig
);
return
outConfig
;
}
...
...
@@ -153,21 +158,24 @@ public class DataManager {
*/
public
IconOpt
getIconDataFromSP
(
Context
context
)
{
if
(
iconOpt
!=
null
)
{
LogUtil
.
d
(
TAG
+
"icon配置 1 = "
+
iconOpt
);
return
iconOpt
;
}
String
out
ConfigString
=
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getString
(
ICON_CONFIG
,
""
);
if
(!
TextUtils
.
isEmpty
(
out
ConfigString
))
{
try
{
iconOpt
=
new
Gson
().
fromJson
(
outConfigString
,
IconOpt
.
class
);
}
catch
(
Exception
ignored
)
{
}
String
icon
ConfigString
=
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
getString
(
ICON_CONFIG
,
""
);
if
(!
TextUtils
.
isEmpty
(
icon
ConfigString
))
{
LogUtil
.
d
(
TAG
+
"icon配置 SP数据:"
+
iconConfigString
);
iconOpt
=
new
Gson
().
fromJson
(
iconConfigString
,
IconOpt
.
class
);
LogUtil
.
d
(
TAG
+
"icon配置 222 = "
+
iconOpt
);
if
(
iconOpt
==
null
)
{
SPUtils
.
getInstance
(
context
,
CONFIG_SP
).
remove
(
ICON_CONFIG
,
true
);
}
}
else
{
LogUtil
.
d
(
TAG
+
"icon配置 SP数据为空"
);
}
LogUtil
.
d
(
TAG
+
"icon
Opt
= "
+
iconOpt
);
LogUtil
.
d
(
TAG
+
"icon
配置 2
= "
+
iconOpt
);
return
iconOpt
;
}
...
...
app/src/main/java/com/zl/sdk/event/EventUtils.java
View file @
40712597
...
...
@@ -4,10 +4,9 @@ import android.os.Build;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.zl.sdk.Config
;
import
com.zl.sdk.OutHelp
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.util.LogUtil
;
...
...
@@ -90,7 +89,7 @@ public final class EventUtils {
Statistics
.
getInstance
().
dotEvent
(
OutHelp
.
get
().
getContext
(),
OUT_DIALOG_LOCK_TRRIGER
,
""
,
map
);
}
public
static
void
statOutOnlyAdFail
(
RemindersInfo
remindersInfo
,
Weather
AdData
.
NormalAdData
data
,
String
reason
)
{
public
static
void
statOutOnlyAdFail
(
RemindersInfo
remindersInfo
,
Out
AdData
.
NormalAdData
data
,
String
reason
)
{
if
(
remindersInfo
==
null
||
data
==
null
)
{
return
;
}
...
...
@@ -100,11 +99,11 @@ public final class EventUtils {
}
String
type
=
""
;
if
(
adType
.
equals
(
Weather
AdData
.
CP_AD_TYPE_BANNER
))
{
if
(
adType
.
equals
(
Out
AdData
.
CP_AD_TYPE_BANNER
))
{
type
=
"banner"
;
}
else
if
(
adType
.
equals
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
))
{
}
else
if
(
adType
.
equals
(
Out
AdData
.
CP_AD_TYPE_NATIVE
))
{
type
=
"native"
;
}
else
if
(
adType
.
equals
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
))
{
}
else
if
(
adType
.
equals
(
Out
AdData
.
CP_AD_TYPE_CHAPING
))
{
type
=
"interstitial"
;
}
...
...
app/src/main/java/com/zl/sdk/out/BaseOutShowManager.java
View file @
40712597
package
com
.
zl
.
sdk
.
out
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
public
abstract
class
BaseOutShowManager
{
public
BaseOutShowManager
()
{
}
abstract
Weather
AdData
.
NormalAdData
getAdData
();
abstract
Out
AdData
.
NormalAdData
getAdData
();
abstract
RemindersInfo
getReminderInfo
();
abstract
boolean
checkCanShowForRemindInfo
(
RemindersInfo
remindersInfo
);
abstract
boolean
checkCanShowForActionState
(
Weather
AdData
.
NormalAdData
adData
,
int
actionState
);
abstract
boolean
checkCanShowForActionState
(
Out
AdData
.
NormalAdData
adData
,
int
actionState
);
}
app/src/main/java/com/zl/sdk/out/CheckHelper.java
View file @
40712597
...
...
@@ -7,7 +7,7 @@ import android.net.NetworkInfo;
import
android.text.format.DateUtils
;
import
com.zl.sdk.OutHelp
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
import
com.zl.sdk.event.DialogFailReason
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.util.AppOutUtils
;
...
...
@@ -164,7 +164,7 @@ public class CheckHelper {
* @param actionState 触发场景
* @return
*/
public
static
boolean
checkCanShowAd
(
Weather
AdData
.
NormalAdData
data
,
int
actionState
)
{
public
static
boolean
checkCanShowAd
(
Out
AdData
.
NormalAdData
data
,
int
actionState
)
{
return
checkCanShowAdByTimesFromAdData
(
data
,
actionState
)
&&
checkAdReady
(
data
);
}
...
...
@@ -172,7 +172,7 @@ public class CheckHelper {
/**
* 检查广告数据是否可以播放
*/
public
static
boolean
checkCanShowAdByTimesFromAdData
(
Weather
AdData
.
NormalAdData
data
,
int
actionState
)
{
public
static
boolean
checkCanShowAdByTimesFromAdData
(
Out
AdData
.
NormalAdData
data
,
int
actionState
)
{
if
(
data
==
null
)
{
LogUtil
.
d
(
TAG
+
"(次数检查)广告信息为空 不能播放"
);
EventUtils
.
staDialogFail
(
DialogFailReason
.
NO_DATA
,
actionState
,
EventUtils
.
DIALOG_TYPE_AD
);
...
...
@@ -234,7 +234,7 @@ public class CheckHelper {
}
if
(
OutHelp
.
get
().
iconIsHide
())
{
if
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
data
.
cpAdtype
)
&&
(
homeNativeAdDayShowCount
>=
data
.
showTimesHideForAdId
))
{
if
(
Out
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
data
.
cpAdtype
)
&&
(
homeNativeAdDayShowCount
>=
data
.
showTimesHideForAdId
))
{
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon隐藏) 超过播放次数"
);
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon隐藏) 当前次数="
+
homeNativeAdDayShowCount
);
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon隐藏) 配置次数="
+
data
.
showTimesHideForAdId
);
...
...
@@ -242,7 +242,7 @@ public class CheckHelper {
return
false
;
}
}
else
{
if
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
data
.
cpAdtype
)
&&
(
homeNativeAdDayShowCount
>=
data
.
showTimes
))
{
if
(
Out
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
data
.
cpAdtype
)
&&
(
homeNativeAdDayShowCount
>=
data
.
showTimes
))
{
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon未隐藏) 超过播放次数"
);
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon未隐藏) 当前次数="
+
homeNativeAdDayShowCount
);
LogUtil
.
d
(
TAG
+
"(次数检查)原生 (icon未隐藏) 配置次数="
+
data
.
showTimes
);
...
...
@@ -252,7 +252,7 @@ public class CheckHelper {
}
if
(
OutHelp
.
get
().
iconIsHide
())
{
if
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
data
.
cpAdtype
)
&&
(
homeInterstitialAdDayShowCount
>=
data
.
showTimesHideForAdId
))
{
if
(
Out
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
data
.
cpAdtype
)
&&
(
homeInterstitialAdDayShowCount
>=
data
.
showTimesHideForAdId
))
{
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon隐藏) 超过播放次数"
);
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon隐藏) 当前次数="
+
homeInterstitialAdDayShowCount
);
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon隐藏) 配置次数="
+
data
.
showTimesHideForAdId
);
...
...
@@ -260,7 +260,7 @@ public class CheckHelper {
return
false
;
}
}
else
{
if
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
data
.
cpAdtype
)
&&
(
homeInterstitialAdDayShowCount
>=
data
.
showTimes
))
{
if
(
Out
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
data
.
cpAdtype
)
&&
(
homeInterstitialAdDayShowCount
>=
data
.
showTimes
))
{
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon未隐藏) 超过播放次数"
);
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon未隐藏) 当前次数="
+
homeInterstitialAdDayShowCount
);
LogUtil
.
d
(
TAG
+
"(次数检查)插屏 (icon未隐藏) 配置次数="
+
data
.
showTimes
);
...
...
@@ -286,7 +286,7 @@ public class CheckHelper {
/**
* 检查广告是否准备好
*/
public
static
boolean
checkAdReady
(
Weather
AdData
.
NormalAdData
data
)
{
public
static
boolean
checkAdReady
(
Out
AdData
.
NormalAdData
data
)
{
if
(
data
==
null
)
{
return
false
;
}
...
...
app/src/main/java/com/zl/sdk/out/DxManager.java
View file @
40712597
package
com
.
zl
.
sdk
.
out
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.out.ui.DxActivity
;
import
java.util.Stack
;
...
...
@@ -22,7 +22,7 @@ public class DxManager {
private
RemindersInfo
outRemindersInfo
=
null
;
private
Weather
AdData
.
NormalAdData
outAdData
=
null
;
private
Out
AdData
.
NormalAdData
outAdData
=
null
;
public
RemindersInfo
getOutRemindersInfo
()
{
return
outRemindersInfo
;
...
...
@@ -32,11 +32,11 @@ public class DxManager {
this
.
outRemindersInfo
=
outRemindersInfo
;
}
public
Weather
AdData
.
NormalAdData
getOutAdData
()
{
public
Out
AdData
.
NormalAdData
getOutAdData
()
{
return
outAdData
;
}
public
void
setOutAdData
(
Weather
AdData
.
NormalAdData
outAdData
)
{
public
void
setOutAdData
(
Out
AdData
.
NormalAdData
outAdData
)
{
this
.
outAdData
=
outAdData
;
}
...
...
app/src/main/java/com/zl/sdk/out/OutAdManager.java
View file @
40712597
...
...
@@ -10,8 +10,8 @@ import android.text.format.DateUtils;
import
com.zl.sdk.Config
;
import
com.zl.sdk.OutHelp
;
import
com.zl.sdk.ad.AdDataManager
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
...
...
@@ -52,7 +52,7 @@ public class OutAdManager extends BaseOutShowManager {
}
@Override
Weather
AdData
.
NormalAdData
getAdData
()
{
Out
AdData
.
NormalAdData
getAdData
()
{
return
AdDataManager
.
get
().
getShowAdData
();
}
...
...
@@ -73,7 +73,7 @@ public class OutAdManager extends BaseOutShowManager {
}
@Override
boolean
checkCanShowForActionState
(
Weather
AdData
.
NormalAdData
adData
,
int
actionState
)
{
boolean
checkCanShowForActionState
(
Out
AdData
.
NormalAdData
adData
,
int
actionState
)
{
if
(
adData
==
null
)
{
LogUtil
.
d
(
TAG
+
"能否播放(广告信息) :广告信息为空 false"
);
return
false
;
...
...
@@ -150,7 +150,7 @@ public class OutAdManager extends BaseOutShowManager {
return;
}*/
Weather
AdData
.
NormalAdData
adData
=
getAdData
();
Out
AdData
.
NormalAdData
adData
=
getAdData
();
if
(
adData
==
null
)
{
LogUtil
.
d
(
TAG
);
...
...
@@ -241,7 +241,7 @@ public class OutAdManager extends BaseOutShowManager {
map
.
put
(
"type"
,
String
.
valueOf
(
actionFrom
.
getAction
()));
Statistics
.
getInstance
().
dotEvent
(
OutHelp
.
get
().
getContext
(),
EventUtils
.
OUT_AD_START
,
""
,
map
);
Weather
AdData
.
NormalAdData
adData
=
getAdData
();
Out
AdData
.
NormalAdData
adData
=
getAdData
();
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
+
">>>播放广告<<< =============>>> start"
);
...
...
@@ -309,7 +309,7 @@ public class OutAdManager extends BaseOutShowManager {
/**
* 去拉起外展弹窗 播放or加载广告
*/
private
void
startAdDialog
(
Context
context
,
boolean
isShow
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
Weather
AdData
.
NormalAdData
data
)
{
private
void
startAdDialog
(
Context
context
,
boolean
isShow
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
Out
AdData
.
NormalAdData
data
)
{
try
{
Intent
intent
=
new
Intent
();
intent
.
setComponent
(
new
ComponentName
(
context
,
OutHelp
.
get
().
getActivityName
()));
...
...
@@ -395,7 +395,7 @@ public class OutAdManager extends BaseOutShowManager {
}
}
private
void
outDialogShowFail
(
boolean
isShow
,
Context
context
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
Weather
AdData
.
NormalAdData
data
,
String
reason
)
{
private
void
outDialogShowFail
(
boolean
isShow
,
Context
context
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
Out
AdData
.
NormalAdData
data
,
String
reason
)
{
LogUtil
.
d
(
TAG
,
"广告SLK("
+
(
isShow
?
"播放"
:
"加载"
)
+
") 拉起失败 失败原因:"
+
reason
);
try
{
OutHelp
.
get
().
clearNotification
();
...
...
@@ -436,7 +436,7 @@ public class OutAdManager extends BaseOutShowManager {
LogUtil
.
d
(
TAG
+
">>>加载广告<<< =============>>> start"
);
LogUtil
.
d
(
TAG
);
ArrayList
<
WeatherAdData
.
NormalAdData
>
list
=
AdDataManager
.
get
().
getOutAdData
(
WeatherAdData
.
POSITION_HOME
,
Weather
AdData
.
CP_AD_TOPON
);
ArrayList
<
OutAdData
.
NormalAdData
>
list
=
AdDataManager
.
get
().
getOutAdData
(
OutAdData
.
POSITION_HOME
,
Out
AdData
.
CP_AD_TOPON
);
int
size
=
list
.
size
();
...
...
@@ -445,7 +445,7 @@ public class OutAdManager extends BaseOutShowManager {
LogUtil
.
d
(
TAG
+
">>>加载广告<<< =============>>> END 外展广告数据为空"
);
LogUtil
.
d
(
TAG
);
Weather
AdData
.
NormalAdData
localData
=
getAdData
();
Out
AdData
.
NormalAdData
localData
=
getAdData
();
if
(
localData
!=
null
&&
CheckHelper
.
checkCanShowAdByTimesFromAdData
(
localData
,
-
1
)
...
...
@@ -464,12 +464,12 @@ public class OutAdManager extends BaseOutShowManager {
}
Weather
AdData
.
NormalAdData
preLoadData
;
Out
AdData
.
NormalAdData
preLoadData
;
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
preLoadData
=
list
.
get
(
i
);
//TODO 如果外展广告为原生,跳过加载
if
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
preLoadData
.
cpAdtype
))
{
if
(
Out
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
preLoadData
.
cpAdtype
))
{
continue
;
}
...
...
@@ -499,7 +499,7 @@ public class OutAdManager extends BaseOutShowManager {
/**
* 前置条件检查都已通过,直接去加载广告
*/
private
void
preloadByData
(
ActionFrom
actionFrom
,
Weather
AdData
.
NormalAdData
normalAdData
)
{
private
void
preloadByData
(
ActionFrom
actionFrom
,
Out
AdData
.
NormalAdData
normalAdData
)
{
if
(
normalAdData
==
null
)
{
returnFailCallBack
(
"ad data is null"
);
return
;
...
...
@@ -510,7 +510,7 @@ public class OutAdManager extends BaseOutShowManager {
// TopOnAdLoadManager.getInstance().loadNativeAd(normalAdData, AdScenes.AD_SCENES_PURE);
// } else
if
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
normalAdData
.
cpAdtype
))
{
if
(
Out
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
normalAdData
.
cpAdtype
))
{
LogUtil
.
d
(
TAG
+
"加载广告(插屏) adData :"
+
normalAdData
);
hadStartAdDialogFail
=
false
;
LogUtil
.
d
(
TAG
+
">>>加载广告<<< =============>>> END 通过SLK加载广告"
);
...
...
@@ -540,21 +540,21 @@ public class OutAdManager extends BaseOutShowManager {
// }
public
void
showAdSuccess
(
Weather
AdData
.
NormalAdData
adData
)
{
public
void
showAdSuccess
(
Out
AdData
.
NormalAdData
adData
)
{
LogUtil
.
d
(
TAG
,
"showAdSuccess adData ="
+
adData
);
if
(
adData
==
null
)
{
return
;
}
final
long
curTime
=
System
.
currentTimeMillis
();
if
(
adData
.
position
==
Weather
AdData
.
POSITION_LOCK
)
{
if
(
adData
.
position
==
Out
AdData
.
POSITION_LOCK
)
{
AppOutSP
.
saveLockLastShowTime
(
curTime
);
if
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
adData
.
cpAdtype
))
{
if
(
Out
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
adData
.
cpAdtype
))
{
int
lockNativeAdDayDayShowCount
=
AppOutSP
.
getLockNativeAdDayShowCount
();
AppOutSP
.
saveLockNativeAdDayShowCount
(++
lockNativeAdDayDayShowCount
);
LogUtil
.
d
(
TAG
,
"showAdSuccess native lockNativeAdDayDayShowCount ="
+
lockNativeAdDayDayShowCount
);
return
;
}
if
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
adData
.
cpAdtype
))
{
if
(
Out
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
adData
.
cpAdtype
))
{
int
lockInterstitialAdDayShowCount
=
AppOutSP
.
getLockInterstitialAdDayShowCount
();
AppOutSP
.
saveLockInterstitialAdDayShowCount
(++
lockInterstitialAdDayShowCount
);
LogUtil
.
d
(
TAG
,
"showAdSuccess interstitial lockInterstitialAdDayShowCount ="
+
lockInterstitialAdDayShowCount
);
...
...
@@ -563,14 +563,14 @@ public class OutAdManager extends BaseOutShowManager {
return
;
}
if
(
adData
.
position
==
Weather
AdData
.
POSITION_HOME
)
{
if
(
Weather
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
adData
.
cpAdtype
))
{
if
(
adData
.
position
==
Out
AdData
.
POSITION_HOME
)
{
if
(
Out
AdData
.
CP_AD_TYPE_NATIVE
.
equals
(
adData
.
cpAdtype
))
{
int
homeNativeAdDayShowCount
=
AppOutSP
.
getHomeNativeAdDayShowCount
();
AppOutSP
.
saveHomeNativeAdDayShowCount
(++
homeNativeAdDayShowCount
);
LogUtil
.
d
(
TAG
,
"showAdSuccess native homeNativeAdDayShowCount ="
+
homeNativeAdDayShowCount
);
}
if
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
adData
.
cpAdtype
))
{
if
(
Out
AdData
.
CP_AD_TYPE_CHAPING
.
equals
(
adData
.
cpAdtype
))
{
int
homeInterstitialAdDayShowCount
=
AppOutSP
.
getHomeInterstitialAdDayShowCount
();
AppOutSP
.
saveHomeInterstitialAdDayShowCount
(++
homeInterstitialAdDayShowCount
);
LogUtil
.
d
(
TAG
,
"showAdSuccess interstitial homeInterstitialAdDayShowCount ="
+
homeInterstitialAdDayShowCount
);
...
...
app/src/main/java/com/zl/sdk/out/ui/DialogFactory.java
View file @
40712597
package
com
.
zl
.
sdk
.
out
.
ui
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.
Weather
AdData
;
import
com.zl.sdk.bean.
Out
AdData
;
public
final
class
DialogFactory
{
public
static
IView
createDialog
(
RemindersInfo
remindersInfo
,
Weather
AdData
.
NormalAdData
data
)
{
public
static
IView
createDialog
(
RemindersInfo
remindersInfo
,
Out
AdData
.
NormalAdData
data
)
{
if
(
remindersInfo
==
null
)
{
return
null
;
}
...
...
app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
View file @
40712597
...
...
@@ -10,8 +10,8 @@ import android.widget.FrameLayout;
import
com.zl.sdk.Config
;
import
com.zl.sdk.OutHelp
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
...
...
@@ -26,7 +26,7 @@ public class DxActivity extends BaseActivity {
private
Intent
intent
=
null
;
private
RemindersInfo
remindersInfo
;
private
Weather
AdData
.
NormalAdData
adData
;
private
Out
AdData
.
NormalAdData
adData
;
private
IView
proxyView
;
...
...
@@ -118,8 +118,7 @@ public class DxActivity extends BaseActivity {
return
false
;
}
@Override
public
void
finish
()
{
public
void
close
()
{
if
(
IconHelp
.
get
().
isIconHide
())
{
LogUtil
.
d
(
TAG
+
"icon隐藏 退回到后台"
);
if
(
proxyView
!=
null
)
{
...
...
@@ -143,7 +142,7 @@ public class DxActivity extends BaseActivity {
@Override
public
boolean
beforeBackPressed
()
{
finish
();
close
();
return
true
;
}
...
...
@@ -169,7 +168,7 @@ public class DxActivity extends BaseActivity {
adData
=
null
;
remindersInfo
=
null
;
adData
=
(
Weather
AdData
.
NormalAdData
)
DxManager
.
get
().
getOutAdData
();
adData
=
(
Out
AdData
.
NormalAdData
)
DxManager
.
get
().
getOutAdData
();
LogUtil
.
d
(
TAG
+
"广告信息 ="
+
adData
);
remindersInfo
=
DxManager
.
get
().
getOutRemindersInfo
();
...
...
@@ -181,13 +180,13 @@ public class DxActivity extends BaseActivity {
if
(
remindersInfo
==
null
)
{
LogUtil
.
d
(
TAG
+
"finish remindersInfo为空"
);
finish
();
close
();
return
;
}
if
(
remindersInfo
.
reminderType
!=
Config
.
REMINDER_TYPE_WEATHER_PURE_AD
&&
IconHelp
.
get
().
isIconHide
())
{
LogUtil
.
d
(
TAG
+
"finish 不是纯广告并且隐藏了icon"
);
finish
();
close
();
return
;
}
...
...
@@ -204,7 +203,7 @@ public class DxActivity extends BaseActivity {
if
(
proxyView
==
null
)
{
LogUtil
.
d
(
TAG
+
"finish 5 View=null"
);
finish
();
close
();
return
;
}
...
...
app/src/main/java/com/zl/sdk/out/ui/WeatherPureAdDialog.java
View file @
40712597
...
...
@@ -10,8 +10,8 @@ import android.widget.RelativeLayout;
import
com.zl.sdk.ad.OnInAdListener
;
import
com.zl.sdk.ad.TopOnAdLoadManager
;
import
com.zl.sdk.bean.OutAdData
;
import
com.zl.sdk.bean.RemindersInfo
;
import
com.zl.sdk.bean.WeatherAdData
;
import
com.zl.sdk.event.EventUtils
;
import
com.zl.sdk.event.statistics.AdScenes
;
import
com.zl.sdk.event.statistics.Statistics
;
...
...
@@ -27,13 +27,13 @@ class WeatherPureAdDialog extends AbsView {
private
static
final
String
TAG
=
"WeatherPureAdDialog"
;
private
FrameLayout
rootView
;
private
RemindersInfo
remindersInfo
;
private
Weather
AdData
.
NormalAdData
data
;
private
Out
AdData
.
NormalAdData
data
;
private
View
contentView
;
// private LinearLayout weatherAdContainer;
private
OnInAdListener
onInAdListener
;
public
WeatherPureAdDialog
(
RemindersInfo
remindersInfo
,
Weather
AdData
.
NormalAdData
data
)
{
public
WeatherPureAdDialog
(
RemindersInfo
remindersInfo
,
Out
AdData
.
NormalAdData
data
)
{
this
.
remindersInfo
=
remindersInfo
;
this
.
data
=
data
;
}
...
...
@@ -109,7 +109,7 @@ class WeatherPureAdDialog extends AbsView {
finishActivity
();
return
;
}
if
(
adType
.
equals
(
Weather
AdData
.
CP_AD_TYPE_BANNER
))
{
if
(
adType
.
equals
(
Out
AdData
.
CP_AD_TYPE_BANNER
))
{
LogUtil
.
d
(
TAG
+
"initAd adType banner"
);
finishActivity
();
return
;
...
...
@@ -117,7 +117,7 @@ class WeatherPureAdDialog extends AbsView {
registerCallBack
(
adType
);
if
(
adType
.
equals
(
Weather
AdData
.
CP_AD_TYPE_CHAPING
))
{
if
(
adType
.
equals
(
Out
AdData
.
CP_AD_TYPE_CHAPING
))
{
checkCanShowItAd
(
cpName
,
adUnitId
);
return
;
}
...
...
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