Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_flowbox
Commits
df5f72b2
Commit
df5f72b2
authored
Jul 08, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加插屏广告关闭事件监听
parent
75dcdd43
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
36 deletions
+71
-36
FullGroManager.java
...c/main/java/com/mints/flowbox/ad/full/FullGroManager.java
+10
-2
InsertScreenAdManager.kt
...va/com/mints/flowbox/ad/inscreen/InsertScreenAdManager.kt
+22
-12
InterstitialGroManager.java
...com/mints/flowbox/ad/inscreen/InterstitialGroManager.java
+8
-7
InterstitialYlhManager.java
...com/mints/flowbox/ad/inscreen/InterstitialYlhManager.java
+6
-10
WifiAdManager.kt
app/src/main/java/com/mints/flowbox/ad/wifi/WifiAdManager.kt
+19
-0
WifiAdStatusListener.kt
...in/java/com/mints/flowbox/ad/wifi/WifiAdStatusListener.kt
+4
-2
TurnTableFragment.kt
...n/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
+2
-3
No files found.
app/src/main/java/com/mints/flowbox/ad/full/FullGroManager.java
View file @
df5f72b2
...
...
@@ -6,7 +6,6 @@ import android.util.Log;
import
com.bytedance.msdk.api.AdError
;
import
com.bytedance.msdk.api.AdSlot
;
import
com.bytedance.msdk.api.GDTExtraOption
;
import
com.bytedance.msdk.api.TTAdConstant
;
import
com.bytedance.msdk.api.TTMediationAdSdk
;
import
com.bytedance.msdk.api.TTSettingConfigCallback
;
...
...
@@ -15,7 +14,7 @@ import com.bytedance.msdk.api.fullVideo.TTFullVideoAd;
import
com.bytedance.msdk.api.fullVideo.TTFullVideoAdListener
;
import
com.bytedance.msdk.api.fullVideo.TTFullVideoAdLoadCallback
;
import
com.mints.flowbox.BuildConfig
;
import
com.mints.flowbox.ad.
inscreen.InterstitialGroManag
er
;
import
com.mints.flowbox.ad.
wifi.WifiAdStatusListen
er
;
import
com.mints.flowbox.common.Constant
;
import
com.mints.flowbox.manager.CsjGroMoreManager
;
import
com.mints.flowbox.manager.TrackManager
;
...
...
@@ -32,6 +31,8 @@ public class FullGroManager {
private
static
final
String
TAG
=
FullGroManager
.
class
.
getSimpleName
();
private
WifiAdStatusListener
wifiAdStatusListener
;
private
TTFullVideoAd
mTTFullVideoAd
;
private
Activity
activity
;
private
boolean
isLoadSuccess
=
false
;
...
...
@@ -149,6 +150,9 @@ public class FullGroManager {
@Override
public
void
onFullVideoAdClosed
()
{
if
(
wifiAdStatusListener
!=
null
){
wifiAdStatusListener
.
adClose
();
}
Log
.
d
(
TAG
,
"onFullVideoAdClosed"
);
}
...
...
@@ -167,4 +171,8 @@ public class FullGroManager {
Log
.
d
(
TAG
,
"onSkippedVideo"
);
}
};
public
void
setWifiAdStatusListener
(
WifiAdStatusListener
wifiAdStatusListener
)
{
this
.
wifiAdStatusListener
=
wifiAdStatusListener
;
}
}
app/src/main/java/com/mints/flowbox/ad/inscreen/InsertScreenAdManager.kt
View file @
df5f72b2
package
com.mints.flowbox.ad.inscreen
import
android.app.Activity
import
com.mints.flowbox.ad.wifi.WifiAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.utils.LogUtil
/**
* 插屏广告管理
*/
class
InsertScreenAdManager
{
var
insertScreenAdStatusListener2
:
InsertScreen
AdStatusListener
?
=
null
var
wifiAdStatusListener
:
Wifi
AdStatusListener
?
=
null
// groMore
private
var
interstitialGroManager
:
InterstitialGroManager
?
=
null
...
...
@@ -40,16 +40,20 @@ class InsertScreenAdManager {
}
interstitialGroManager
=
InterstitialGroManager
()
interstitialGroManager
?.
loadInsertScreenAd
(
activity
)
interstitialGroManager
?.
set
InsertScreen
AdStatusListener
(
object
:
InsertScreen
AdStatusListener
{
interstitialGroManager
?.
set
Wifi
AdStatusListener
(
object
:
Wifi
AdStatusListener
{
override
fun
adSuccess
()
{
insertScreenAdStatusListener2
?.
adSuccess
()
wifiAdStatusListener
?.
adSuccess
()
}
override
fun
adFail
()
{
insertScreenAdStatusListener2
?.
adFail
()
wifiAdStatusListener
?.
adFail
()
preLoadYlh
(
activity
)
}
override
fun
adClose
()
{
}
})
}
...
...
@@ -61,14 +65,18 @@ class InsertScreenAdManager {
}
interstitialYlhManager
=
InterstitialYlhManager
()
interstitialYlhManager
?.
loadYlhInteractionAd
(
activity
)
interstitialYlhManager
?.
set
InsertScreen
AdStatusListener
(
object
:
InsertScreen
AdStatusListener
{
interstitialYlhManager
?.
set
Wifi
AdStatusListener
(
object
:
Wifi
AdStatusListener
{
override
fun
adSuccess
()
{
insertScreenAdStatusListener2
?.
adSuccess
()
wifiAdStatusListener
?.
adSuccess
()
}
override
fun
adFail
()
{
insertScreenAdStatusListener2
?.
adFail
()
wifiAdStatusListener
?.
adFail
()
}
override
fun
adClose
()
{
}
})
}
...
...
@@ -89,13 +97,15 @@ class InsertScreenAdManager {
fun
onDestroy
()
{
interstitialGroManager
?.
onDestroy
()
interstitialGroManager
?.
setWifiAdStatusListener
(
null
)
interstitialGroManager
=
null
interstitialYlhManager
?.
onDestroy
()
interstitialYlhManager
?.
setWifiAdStatusListener
(
null
)
interstitialYlhManager
=
null
}
fun
setInsertScreenAdStatusListener
(
insertScreenAdStatusListener
:
InsertScreen
AdStatusListener
?)
{
this
.
insertScreenAdStatusListener2
=
insertScreenAdStatusListener
fun
setInsertScreenAdStatusListener
(
insertScreenAdStatusListener
:
Wifi
AdStatusListener
?)
{
this
.
wifiAdStatusListener
=
insertScreenAdStatusListener
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ad/inscreen/InterstitialGroManager.java
View file @
df5f72b2
...
...
@@ -11,6 +11,7 @@ import com.bytedance.msdk.api.interstitial.TTInterstitialAd;
import
com.bytedance.msdk.api.interstitial.TTInterstitialAdListener
;
import
com.bytedance.msdk.api.interstitial.TTInterstitialAdLoadCallback
;
import
com.mints.flowbox.BuildConfig
;
import
com.mints.flowbox.ad.wifi.WifiAdStatusListener
;
import
com.mints.flowbox.common.AppConfig
;
import
com.mints.flowbox.common.Constant
;
import
com.mints.flowbox.manager.CsjGroMoreManager
;
...
...
@@ -27,7 +28,7 @@ public class InterstitialGroManager {
private
static
final
String
TAG
=
InterstitialGroManager
.
class
.
getSimpleName
();
private
InsertScreenAdStatusListener
insertScreen
AdStatusListener
;
private
WifiAdStatusListener
wifi
AdStatusListener
;
private
TTInterstitialAd
mInterstitialAd
;
private
Activity
activity
;
...
...
@@ -87,8 +88,8 @@ public class InterstitialGroManager {
mInterstitialAd
.
loadAd
(
adSlot
,
new
TTInterstitialAdLoadCallback
()
{
@Override
public
void
onInterstitialLoadFail
(
AdError
adError
)
{
if
(
insertScreen
AdStatusListener
!=
null
)
{
insertScreen
AdStatusListener
.
adFail
();
if
(
wifi
AdStatusListener
!=
null
)
{
wifi
AdStatusListener
.
adFail
();
}
LogUtil
.
d
(
TAG
,
"code="
+
adError
.
code
+
"message="
+
adError
.
message
);
...
...
@@ -148,8 +149,8 @@ public class InterstitialGroManager {
*/
@Override
public
void
onInterstitialClosed
()
{
if
(
insertScreen
AdStatusListener
!=
null
)
{
insertScreen
AdStatusListener
.
adSuccess
();
if
(
wifi
AdStatusListener
!=
null
)
{
wifi
AdStatusListener
.
adSuccess
();
}
AppConfig
.
isShowInsertScreen
=
false
;
}
...
...
@@ -173,7 +174,7 @@ public class InterstitialGroManager {
}
};
public
void
set
InsertScreenAdStatusListener
(
InsertScreenAdStatusListener
insertScreen
AdStatusListener
)
{
this
.
insertScreenAdStatusListener
=
insertScreen
AdStatusListener
;
public
void
set
WifiAdStatusListener
(
WifiAdStatusListener
wifi
AdStatusListener
)
{
this
.
wifiAdStatusListener
=
wifi
AdStatusListener
;
}
}
app/src/main/java/com/mints/flowbox/ad/inscreen/InterstitialYlhManager.java
View file @
df5f72b2
...
...
@@ -2,13 +2,9 @@ package com.mints.flowbox.ad.inscreen;
import
android.app.Activity
;
import
com.mints.flowbox.
BuildConfig
;
import
com.mints.flowbox.
ad.wifi.WifiAdStatusListener
;
import
com.mints.flowbox.common.AppConfig
;
import
com.mints.flowbox.common.Constant
;
import
com.mints.flowbox.manager.TrackManager
;
import
com.mints.flowbox.manager.TtCsjAdManager
;
import
com.mints.flowbox.manager.ad.YlhAdManager
;
import
com.mints.flowbox.mvp.model.WeightBean
;
import
com.mints.flowbox.utils.LogUtil
;
import
com.qq.e.ads.interstitial3.ExpressInterstitialAD
;
import
com.qq.e.ads.interstitial3.ExpressInterstitialAdListener
;
...
...
@@ -23,7 +19,7 @@ public class InterstitialYlhManager {
private
static
final
String
TAG
=
InterstitialYlhManager
.
class
.
getSimpleName
();
private
InsertScreenAdStatusListener
insertScreen
AdStatusListener
;
private
WifiAdStatusListener
wifi
AdStatusListener
;
private
Activity
activity
;
private
ExpressInterstitialAD
mExpressInterstitialAD
;
...
...
@@ -79,8 +75,8 @@ public class InterstitialYlhManager {
@Override
public
void
onClose
()
{
if
(
insertScreen
AdStatusListener
!=
null
)
{
insertScreen
AdStatusListener
.
adSuccess
();
if
(
wifi
AdStatusListener
!=
null
)
{
wifi
AdStatusListener
.
adSuccess
();
}
AppConfig
.
isShowInsertScreen
=
false
;
}
...
...
@@ -134,7 +130,7 @@ public class InterstitialYlhManager {
}
}
public
void
set
InsertScreenAdStatusListener
(
InsertScreenAdStatusListener
insertScreen
AdStatusListener
)
{
this
.
insertScreenAdStatusListener
=
insertScreen
AdStatusListener
;
public
void
set
WifiAdStatusListener
(
WifiAdStatusListener
wifi
AdStatusListener
)
{
this
.
wifiAdStatusListener
=
wifi
AdStatusListener
;
}
}
app/src/main/java/com/mints/flowbox/ad/wifi/WifiAdManager.kt
View file @
df5f72b2
...
...
@@ -14,6 +14,8 @@ import java.util.*
*/
class
WifiAdManager
{
private
var
wifiAdStatusListener
:
WifiAdStatusListener
?
=
null
// groMore插屏
private
var
interstitialGroManager
:
InterstitialGroManager
?
=
null
...
...
@@ -83,6 +85,19 @@ class WifiAdManager {
fun
showInterstitial
()
{
when
(
currentAdType
)
{
Constant
.
GROMORE_INSERTSCREEN_AD
->
{
interstitialGroManager
?.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{
}
override
fun
adFail
()
{
}
override
fun
adClose
()
{
wifiAdStatusListener
?.
adClose
()
}
})
interstitialGroManager
?.
showInteractionAd
()
}
Constant
.
GROMORE_FULL_AD
->
{
...
...
@@ -93,10 +108,14 @@ class WifiAdManager {
fun
onDestroy
()
{
interstitialGroManager
?.
onDestroy
()
interstitialGroManager
?.
setWifiAdStatusListener
(
null
)
interstitialGroManager
=
null
fullGroManager
?.
onDestroy
()
fullGroManager
=
null
}
fun
setWifiAdStatusListener
(
listener
:
WifiAdStatusListener
?)
{
this
.
wifiAdStatusListener
=
listener
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ad/
inscreen/InsertScreen
AdStatusListener.kt
→
app/src/main/java/com/mints/flowbox/ad/
wifi/Wifi
AdStatusListener.kt
View file @
df5f72b2
package
com.mints.flowbox.ad.
inscreen
package
com.mints.flowbox.ad.
wifi
/**
* 广告状态触发事件
*/
interface
InsertScreen
AdStatusListener
{
interface
Wifi
AdStatusListener
{
/**
* 广告加载成功
...
...
@@ -11,4 +11,6 @@ interface InsertScreenAdStatusListener {
fun
adSuccess
()
fun
adFail
()
fun
adClose
()
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
View file @
df5f72b2
...
...
@@ -22,7 +22,7 @@ import com.daimajia.androidanimations.library.YoYo
import
com.github.iielse.switchbutton.SwitchView
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.inscreen.InsertScreenAdManager
import
com.mints.flowbox.ad.
inscreen.InsertScreen
AdStatusListener
import
com.mints.flowbox.ad.
wifi.Wifi
AdStatusListener
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
...
...
@@ -49,7 +49,6 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import
com.umeng.analytics.MobclickAgent
import
kotlinx.android.synthetic.main.fragment_main_turntable.*
import
kotlinx.android.synthetic.main.layout_turn_btn.*
import
java.util.*
import
kotlin.collections.ArrayList
/**
...
...
@@ -120,7 +119,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
insertScreenAdManager
=
InsertScreenAdManager
()
insertScreenAdManager
?.
setInsertScreenAdStatusListener
(
object
:
InsertScreen
AdStatusListener
{
Wifi
AdStatusListener
{
override
fun
adSuccess
()
{
try
{
if
(
turnTableData
?.
surplus
!!
<=
0
)
{
...
...
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