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
4764fd73
Commit
4764fd73
authored
Jul 22, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...开屏广告
parent
cb086dda
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
30 deletions
+35
-30
SplashActivity.kt
...ain/java/com/base/datarecovery/activity/SplashActivity.kt
+11
-29
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+22
-1
AdMaxInit.kt
app/src/main/java/com/base/datarecovery/ads/max/AdMaxInit.kt
+1
-0
AdMaxOpenUtils.kt
...main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
+1
-0
No files found.
app/src/main/java/com/base/datarecovery/activity/SplashActivity.kt
View file @
4764fd73
...
@@ -84,19 +84,9 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -84,19 +84,9 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
if
(
ifAgreePrivacy
)
{
if
(
ifAgreePrivacy
)
{
LogEx
.
logDebug
(
TAG
,
"ifAgreePrivacy=$ifAgreePrivacy"
)
LogEx
.
logDebug
(
TAG
,
"ifAgreePrivacy=$ifAgreePrivacy"
)
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
LogEx
.
logDebug
(
TAG
,
"load admob"
)
AdmobMaxHelper
.
preloadAd
(
this
)
AdmobNativeUtils
.
loadNativeAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
this
)
}
else
{
LogEx
.
logDebug
(
TAG
,
"load max"
)
maxInitAction
=
{
Log
.
d
(
TAG
,
"max init suc"
)
AdMaxOpenUtils
.
loadAppOpenAd
(
this
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
this
)
maxInitAction
=
null
}
}
job
=
startProgress
()
job
=
startProgress
()
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
...
@@ -130,7 +120,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -130,7 +120,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
progressFlow
.
collectLatest
{
progressFlow
.
collectLatest
{
if
(
it
>=
100
)
{
if
(
it
>=
100
)
{
job
?.
cancel
()
job
?.
cancel
()
LogEx
.
logDebug
(
TAG
,
"jumpNext"
)
LogEx
.
logDebug
(
TAG
,
"jumpNext"
)
jumpNext
()
jumpNext
()
this
.
cancel
()
this
.
cancel
()
}
}
...
@@ -139,7 +129,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -139,7 +129,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
}
}
private
fun
jumpNext
()
{
private
fun
jumpNext
()
{
LogEx
.
logDebug
(
TAG
,
" when (actionId) {:jumpNext: "
+
actionId
)
LogEx
.
logDebug
(
TAG
,
" when (actionId) {:jumpNext: "
+
actionId
)
when
(
actionId
)
{
when
(
actionId
)
{
ID_JUNK_CLEAN_PUSH
->
{
ID_JUNK_CLEAN_PUSH
->
{
...
@@ -212,15 +202,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -212,15 +202,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
oneClickStart
=
true
oneClickStart
=
true
ifAgreePrivacy
=
true
ifAgreePrivacy
=
true
(
application
as
MyApplication
).
initApp
()
(
application
as
MyApplication
).
initApp
()
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobMaxHelper
.
preloadAd
(
this
)
AdmobNativeUtils
.
loadNativeAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
this
)
}
else
{
maxInitAction
=
{
AdMaxOpenUtils
.
loadAppOpenAd
(
this
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
this
)
}
}
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llStart
.
visibility
=
View
.
GONE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
binding
.
llProgress
.
visibility
=
View
.
VISIBLE
job
=
startProgress
()
job
=
startProgress
()
...
@@ -235,18 +217,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
...
@@ -235,18 +217,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
val
value
=
binding
.
pb
.
progress
+
2
val
value
=
binding
.
pb
.
progress
+
2
binding
.
pb
.
setProgress
(
value
,
true
)
binding
.
pb
.
setProgress
(
value
,
true
)
progress
.
emit
(
value
)
progress
.
emit
(
value
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" progress.emit(value)"
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" progress.emit(value)"
)
val
delayTime
=
450L
val
delayTime
=
450L
delay
(
delayTime
)
delay
(
delayTime
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" delay(delayTime)"
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" delay(delayTime)"
)
processTime
+=
delayTime
processTime
+=
delayTime
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" processTime += delayTime"
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" processTime += delayTime"
)
if
(
processTime
>=
Random
.
nextLong
(
3000
,
4000
))
{
if
(
processTime
>=
Random
.
nextLong
(
3000
,
4000
))
{
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" Random.nextLong(3000, 4000)"
)
LogEx
.
logDebug
(
TAG
,
"startProgress:"
+
isActive
+
" Random.nextLong(3000, 4000)"
)
if
(!
outTimeAdStart
)
{
if
(!
outTimeAdStart
)
{
outTimeAdStart
=
true
outTimeAdStart
=
true
LogEx
.
logDebug
(
TAG
,
"outTimeAd:"
+
isActive
)
LogEx
.
logDebug
(
TAG
,
"outTimeAd:"
+
isActive
)
outTimeAd
()
outTimeAd
()
}
}
}
}
...
...
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
4764fd73
...
@@ -2,12 +2,15 @@ package com.base.datarecovery.ads
...
@@ -2,12 +2,15 @@ package com.base.datarecovery.ads
import
AdMaxNativeUtils
import
AdMaxNativeUtils
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.util.Log
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
com.base.datarecovery.R
import
com.base.datarecovery.R
import
com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import
com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import
com.base.datarecovery.ads.admob.AdmobNativeUtils
import
com.base.datarecovery.ads.admob.AdmobNativeUtils
import
com.base.datarecovery.ads.admob.AdmobOpenUtils
import
com.base.datarecovery.ads.admob.AdmobOpenUtils
import
com.base.datarecovery.ads.max.AdMaxInit
import
com.base.datarecovery.ads.max.AdMaxInit.initAdMax
import
com.base.datarecovery.ads.max.AdMaxInit.initAdMax
import
com.base.datarecovery.ads.max.AdMaxInterstitialUtils
import
com.base.datarecovery.ads.max.AdMaxInterstitialUtils
import
com.base.datarecovery.ads.max.AdMaxOpenUtils
import
com.base.datarecovery.ads.max.AdMaxOpenUtils
...
@@ -69,7 +72,7 @@ object AdmobMaxHelper {
...
@@ -69,7 +72,7 @@ object AdmobMaxHelper {
}
}
}
}
fun
initAdmobMaxAd
()
{
fun
initAdmobMaxAd
(
activity
:
Activity
?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(!
isAdInit
.
get
())
{
if
(!
isAdInit
.
get
())
{
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
...
@@ -83,4 +86,22 @@ object AdmobMaxHelper {
...
@@ -83,4 +86,22 @@ object AdmobMaxHelper {
}
}
}
}
fun
preloadAd
(
activity
:
Activity
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
loadAppOpenAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
else
{
if
(
isAdInit
.
get
())
{
AdMaxOpenUtils
.
loadAppOpenAd
(
activity
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
else
{
AdMaxInit
.
maxInitAction
=
{
Log
.
d
(
TAG
,
"max init suc"
)
AdMaxOpenUtils
.
loadAppOpenAd
(
activity
)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/datarecovery/ads/max/AdMaxInit.kt
View file @
4764fd73
...
@@ -46,6 +46,7 @@ object AdMaxInit {
...
@@ -46,6 +46,7 @@ object AdMaxInit {
LogEx
.
logDebug
(
TAG
,
"max init"
)
LogEx
.
logDebug
(
TAG
,
"max init"
)
isAdInit
.
set
(
true
)
isAdInit
.
set
(
true
)
maxInitAction
?.
invoke
()
maxInitAction
?.
invoke
()
maxInitAction
=
null
}
}
executor
.
shutdown
()
executor
.
shutdown
()
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxOpenUtils.kt
View file @
4764fd73
...
@@ -165,6 +165,7 @@ object AdMaxOpenUtils {
...
@@ -165,6 +165,7 @@ object AdMaxOpenUtils {
}
}
if
(
AdmobMaxHelper
.
isAdInit
.
get
())
{
if
(
AdmobMaxHelper
.
isAdInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"appOpenAd loadAd"
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
...
...
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