Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
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
Data Recovery White
Commits
e321cc31
Commit
e321cc31
authored
Jul 16, 2024
by
leichao.gao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
倒计时delete
parent
9762c394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
AdmobInterstitialUtils.kt
...com/base/datarecovery/ads/admob/AdmobInterstitialUtils.kt
+26
-26
No files found.
app/src/main/java/com/base/datarecovery/ads/admob/AdmobInterstitialUtils.kt
View file @
e321cc31
...
...
@@ -133,33 +133,33 @@ object AdmobInterstitialUtils {
onHidden
:
(()
->
Unit
)?,
interval
:
Int
)
{
if
(!
isShowDialog
)
{
displayInterstitialAd
(
activity
,
onHidden
)
return
}
if
(
customDialog
!=
null
&&
customDialog
?.
isShowing
==
true
)
{
return
// 如果对话框已经显示,则不再显示
}
customDialog
=
CustomDialog
(
activity
,
R
.
layout
.
dialog_ad_loading
)
customDialog
?.
setCountdownText
(
R
.
id
.
dialog_ad_loading_text
)
val
countdownTimer
=
object
:
CountDownTimer
((
interval
*
1000
).
toLong
(),
1000
)
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
val
seconds
=
(
millisUntilFinished
/
1000
).
toInt
()
customDialog
?.
updateCountdownText
(
"Advertising in preparation ($seconds"
+
"s)..."
)
}
override
fun
onFinish
()
{
//
if (!isShowDialog) {
//
displayInterstitialAd(activity, onHidden)
//
return
//
}
//
//
if (customDialog != null && customDialog?.isShowing == true) {
//
return // 如果对话框已经显示,则不再显示
//
}
//
//
customDialog = CustomDialog(activity, R.layout.dialog_ad_loading)
//
customDialog?.setCountdownText(R.id.dialog_ad_loading_text)
//
val countdownTimer = object : CountDownTimer((interval * 1000).toLong(), 1000) {
//
override fun onTick(millisUntilFinished: Long) {
//
val seconds = (millisUntilFinished / 1000).toInt()
//
customDialog?.updateCountdownText("Advertising in preparation ($seconds" + "s)...")
//
}
//
//
override fun onFinish() {
displayInterstitialAd
(
activity
,
onHidden
)
if
(!
activity
.
isDestroyed
&&
!
activity
.
isFinishing
)
{
customDialog
?.
dismiss
()
}
customDialog
=
null
}
}
countdownTimer
.
start
()
customDialog
?.
show
()
//
if (!activity.isDestroyed && !activity.isFinishing) {
//
customDialog?.dismiss()
//
}
//
customDialog = null
//
}
//
}
//
countdownTimer.start()
//
customDialog?.show()
}
private
fun
showAdDialogAndLoadInterstitial
(
...
...
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