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