Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
appzxhy
Commits
c8667d0e
Commit
c8667d0e
authored
Jun 06, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[新增]插页广告倒计时逻辑
parent
756e25c0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
AdCountDownDialog.kt
...n/java/com/base/appzxhy/business/ads/AdCountDownDialog.kt
+6
-2
AdState.kt
app/src/main/java/com/base/appzxhy/business/ads/AdState.kt
+0
-1
AdInterMgr.kt
...in/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
+7
-2
No files found.
app/src/main/java/com/base/appzxhy/business/ads/AdCountDownDialog.kt
View file @
c8667d0e
...
...
@@ -45,8 +45,12 @@ object AdCountDownDialog {
fun
createUICountdownTimer
(
dialog
:
Dialog
?,
onFinish
:
()
->
Unit
)
{
if
(
dialog
==
null
)
{
onFinish
.
invoke
()
return
}
val
tvCountdown
=
dialog
?
.
findViewById
<
TextView
>(
R
.
id
.
tvCountdown
)
val
tvCountdown
=
dialog
.
findViewById
<
TextView
>(
R
.
id
.
tvCountdown
)
val
countDownTimer
=
object
:
CountDownTimer
(
4000
,
1000
)
{
@SuppressLint
(
"SetTextI18n"
)
...
...
@@ -57,7 +61,7 @@ object AdCountDownDialog {
override
fun
onFinish
()
{
kotlin
.
runCatching
{
dialog
?
.
dismiss
()
dialog
.
dismiss
()
}
onFinish
.
invoke
()
}
...
...
app/src/main/java/com/base/appzxhy/business/ads/AdState.kt
View file @
c8667d0e
...
...
@@ -3,7 +3,6 @@ package com.base.appzxhy.business.ads
import
android.app.Activity
import
android.app.Dialog
import
com.base.appzxhy.business.ads.LimitUtils.openInterLastShowTime
import
com.base.appzxhy.utils.AppPreferences
import
java.lang.ref.WeakReference
...
...
app/src/main/java/com/base/appzxhy/business/ads/admob/AdInterMgr.kt
View file @
c8667d0e
...
...
@@ -4,6 +4,7 @@ import android.app.Activity
import
android.content.Context
import
com.base.appzxhy.GlobalConfig
import
com.base.appzxhy.MyApplication
import
com.base.appzxhy.business.ads.AdCountDownDialog.createUICountdownTimer
import
com.base.appzxhy.business.ads.AdCountDownDialog.showAdCountDownDialog
import
com.base.appzxhy.business.ads.AdEvent
import
com.base.appzxhy.business.ads.AdState
...
...
@@ -45,7 +46,7 @@ class AdInterMgr {
showCallBack
?.
failed
(
2
)
return
}
if
(
LimitUtils
.
isIntervalLimited
(
adEvent
))
{
if
(
LimitUtils
.
isIntervalLimited
(
adEvent
))
{
showCallBack
?.
failed
(
3
)
return
}
...
...
@@ -114,7 +115,11 @@ class AdInterMgr {
}
}
val
activity
=
adState
.
activityRef
?.
get
()
activity
?.
let
{
show
(
it
)
}
activity
?.
let
{
createUICountdownTimer
(
adState
.
adDialog
)
{
show
(
it
)
}
}
}
}
...
...
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