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
dacc956c
Commit
dacc956c
authored
Jul 30, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用内信息流添加关闭按钮
parent
3198ee14
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
46 deletions
+55
-46
AppOutScreenGroMoreCarrierExpressManager.kt
...ts/flowbox/ad/AppOutScreenGroMoreCarrierExpressManager.kt
+0
-5
AppOutSimpleGroMoreCarrierExpressManager.kt
...ts/flowbox/ad/AppOutSimpleGroMoreCarrierExpressManager.kt
+0
-3
BannerManager.kt
...rc/main/java/com/mints/flowbox/ad/banner/BannerManager.kt
+18
-7
GroMoreCarrierExpressManager.kt
.../mints/flowbox/ad/express/GroMoreCarrierExpressManager.kt
+21
-17
ScreenObserver.kt
...java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
+4
-1
SpeedFastActivity.kt
.../java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
+6
-9
ScreenActivity.kt
...om/mints/flowbox/ui/activitys/keepalive/ScreenActivity.kt
+1
-3
MyFragment.kt
...src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
+5
-1
No files found.
app/src/main/java/com/mints/flowbox/ad/AppOutScreenGroMoreCarrierExpressManager.kt
View file @
dacc956c
package
com.mints.flowbox.ad
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.LayoutInflater
...
...
@@ -182,9 +180,6 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback {
val
isOversped
=
TimeRender
.
isOversped45Min
(
adLoadTime
,
45
)
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
getAdView
(
callback
)
},
1000
)
return
}
...
...
app/src/main/java/com/mints/flowbox/ad/AppOutSimpleGroMoreCarrierExpressManager.kt
View file @
dacc956c
...
...
@@ -182,9 +182,6 @@ class AppOutSimpleGroMoreCarrierExpressManager : TTSettingConfigCallback {
val
isOversped
=
TimeRender
.
isOversped45Min
(
adLoadTime
,
45
)
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
getAdView
(
callback
)
},
1000
)
return
}
...
...
app/src/main/java/com/mints/flowbox/ad/banner/BannerManager.kt
View file @
dacc956c
package
com.mints.flowbox.ad.banner
import
android.app.Activity
import
android.view.View
import
android.widget.FrameLayout
import
com.bytedance.sdk.openadsdk.AdSlot
import
com.bytedance.sdk.openadsdk.TTAdNative
import
com.bytedance.sdk.openadsdk.TTAdSdk
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.bytedance.sdk.openadsdk.*
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.manager.TtCsjAdManager
import
com.mints.flowbox.ui.activitys.MainActivity
import
com.mints.flowbox.utils.LogUtil
/**
...
...
@@ -47,7 +46,7 @@ class BannerManager {
/**
* 获取穿山甲banner
*/
fun
getTtBanner
(
codeId
:
String
,
frameLayout
:
FrameLayout
?)
{
fun
getTtBanner
(
codeId
:
String
,
frameLayout
:
FrameLayout
?
,
activity
:
Activity
)
{
this
.
frameLayout
=
frameLayout
var
expressViewAcceptedSizeWidth
=
getViewWidth
()
var
expressViewAcceptedSizeHeight
=
0f
...
...
@@ -78,7 +77,7 @@ class BannerManager {
frameLayout
?.
let
{
mTTAd
=
ads
[
0
]
bindAdListener
()
bindAdListener
(
activity
)
mTTAd
?.
render
()
}
}
...
...
@@ -90,8 +89,20 @@ class BannerManager {
}
}
private
fun
bindAdListener
()
{
private
fun
bindAdListener
(
activity
:
Activity
)
{
mTTAd
?.
let
{
it
.
setDislikeCallback
(
activity
,
object
:
TTAdDislike
.
DislikeInteractionCallback
{
override
fun
onShow
()
{
}
override
fun
onSelected
(
p0
:
Int
,
p1
:
String
?,
p2
:
Boolean
)
{
frameLayout
?.
removeAllViews
()
}
override
fun
onCancel
()
{
}
})
it
.
setExpressInteractionListener
(
object
:
TTNativeExpressAd
.
ExpressAdInteractionListener
{
override
fun
onAdClicked
(
p0
:
View
?,
p1
:
Int
)
{
...
...
app/src/main/java/com/mints/flowbox/ad/express/GroMoreCarrierExpressManager.kt
View file @
dacc956c
...
...
@@ -19,6 +19,7 @@ import com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.CsjGroMoreManager
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import
com.mints.flowbox.utils.ForegroundOrBackground
import
com.mints.flowbox.utils.LogUtil
import
com.mints.flowbox.utils.VideoOptionUtil
import
java.util.*
...
...
@@ -247,23 +248,26 @@ class GroMoreCarrierExpressManager : TTSettingConfigCallback {
convertView
.
tag
=
adViewHolder
//判断是否存在dislike按钮
// if (ad.hasDislike()) {
// ad.setDislikeCallback(MintsApplication.getContext() as Activity?, object : TTDislikeCallback {
// override fun onSelected(position: Int, value: String) {
// //用户选择不喜欢原因后,移除广告展示
// }
//
// override fun onCancel() {
// LogUtil.d(TAG, "dislike 点击了取消")
// }
//
// /**
// * 拒绝再次提交
// */
// override fun onRefuse() {}
// override fun onShow() {}
// })
// }
if
(
ad
.
hasDislike
()
&&
ForegroundOrBackground
.
getApp_activity
()
!=
null
)
{
ad
.
setDislikeCallback
(
ForegroundOrBackground
.
getApp_activity
(),
object
:
TTDislikeCallback
{
override
fun
onSelected
(
position
:
Int
,
value
:
String
)
{
//用户选择不喜欢原因后,移除广告展示
frameLayout
?.
removeAllViews
()
}
override
fun
onCancel
()
{
LogUtil
.
d
(
TAG
,
"dislike 点击了取消"
)
}
/**
* 拒绝再次提交
*/
override
fun
onRefuse
()
{}
override
fun
onShow
()
{}
})
}
//设置点击展示回调监听
ad
.
setTTNativeAdListener
(
object
:
TTNativeExpressAdListener
{
...
...
app/src/main/java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
View file @
dacc956c
...
...
@@ -263,7 +263,10 @@ class ScreenLockerObserver(private val context: Context) {
}
private
fun
onHandleScreenOff
(
context
:
Context
,
isPowerDisconnected
:
Boolean
=
false
)
{
if
(
IntentUtils
.
isRunningForeground
(
context
)
&&
ForegroundOrBackground
.
getApp_activity
()
!=
null
&&
ForegroundOrBackground
.
getApp_activity
()
!
is
ScreenActivity
)
{
if
(
IntentUtils
.
isRunningForeground
(
context
)
&&
ForegroundOrBackground
.
getApp_activity
()
!=
null
&&
ForegroundOrBackground
.
getApp_activity
()
!
is
ScreenActivity
)
{
ForegroundOrBackground
.
getApp_activity
().
moveTaskToBack
(
true
)
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
View file @
dacc956c
...
...
@@ -48,6 +48,12 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
override
fun
adClose
()
{}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
wifi_speed
,
iv_gif
)
tv_tab
.
text
=
topStr
[
1
]
btn
.
visibility
=
View
.
INVISIBLE
tv_progress
.
visibility
=
View
.
VISIBLE
startTimer
()
}
fun
startTimer
()
{
...
...
@@ -117,15 +123,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
}
R
.
id
.
btn
->
{
when
{
mStep
==
0
->
{
startTimer
()
btn
.
visibility
=
View
.
INVISIBLE
tv_progress
.
visibility
=
View
.
VISIBLE
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
wifi_speed
,
iv_gif
)
tv_tab
.
text
=
topStr
[
1
]
}
mStep
>=
4
->
{
finish
()
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/ScreenActivity.kt
View file @
dacc956c
...
...
@@ -37,8 +37,6 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
initExpress
()
ForegroundOrBackground
.
getMain_activity
().
moveTaskToBack
(
true
)
tvBoost
.
setOnClickListener
(
this
)
tvClean
.
setOnClickListener
(
this
)
tvSaveBattery
.
setOnClickListener
(
this
)
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
View file @
dacc956c
...
...
@@ -120,7 +120,11 @@ class MyFragment : BaseFragment(),
// 防止banner刷新太快
if
(
AntiShake
.
check
(
fl_my_banner
?.
id
))
return
BannerManager
.
instance
.
getTtBanner
(
TtCsjAdManager
.
TT_AD_BANNER_MY
,
fl_my_banner
)
BannerManager
.
instance
.
getTtBanner
(
TtCsjAdManager
.
TT_AD_BANNER_MY
,
fl_my_banner
,
requireActivity
()
)
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager
.
getInstance
().
loadTtFrameLayout
()
...
...
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