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
5a1a8a98
Commit
5a1a8a98
authored
Jul 24, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...广告限制类型
parent
d577cc54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
AdmobMaxHelper.kt
...src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
+11
-10
ConfigHelper.kt
app/src/main/java/com/base/datarecovery/help/ConfigHelper.kt
+1
-1
No files found.
app/src/main/java/com/base/datarecovery/ads/AdmobMaxHelper.kt
View file @
5a1a8a98
...
...
@@ -2,9 +2,7 @@ package com.base.datarecovery.ads
import
AdMaxNativeUtils
import
android.app.Activity
import
android.content.Context
import
android.util.Log
import
android.view.View
import
android.view.ViewGroup
import
com.base.datarecovery.R
import
com.base.datarecovery.ads.admob.AdmobInterstitialUtils
...
...
@@ -17,7 +15,6 @@ import com.base.datarecovery.ads.max.AdMaxOpenUtils
import
com.base.datarecovery.help.BaseApplication
import
com.base.datarecovery.help.ConfigHelper
import
com.base.datarecovery.utils.AppPreferences
import
com.base.datarecovery.utils.LogEx
import
com.google.android.gms.ads.MobileAds
import
java.util.concurrent.atomic.AtomicBoolean
...
...
@@ -27,7 +24,7 @@ object AdmobMaxHelper {
var
isAdInit
=
AtomicBoolean
(
false
)
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
return
if
(
getSpAdmobTrueMaxFalse
()
)
{
AdmobOpenUtils
.
isOpenAdLoaded
()
}
else
{
AdMaxOpenUtils
.
isOpenAdLoaded
()
...
...
@@ -35,7 +32,7 @@ object AdmobMaxHelper {
}
fun
admobMaxShowInterstitialAd
(
activity
:
Activity
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
getSpAdmobTrueMaxFalse
()
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
()
}
...
...
@@ -47,7 +44,7 @@ object AdmobMaxHelper {
}
fun
admobMaxShowOpenAd
(
activity
:
Activity
,
showBeforeAction
:
()
->
Unit
,
onHidden
:
(()
->
Unit
)?
=
null
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
getSpAdmobTrueMaxFalse
()
)
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
onHidden
?.
invoke
()
}
...
...
@@ -59,7 +56,7 @@ object AdmobMaxHelper {
}
fun
admobMaxShowNativeAd
(
activity
:
Activity
,
parent
:
ViewGroup
,
where
:
Int
=
0
)
{
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
if
(
getSpAdmobTrueMaxFalse
()
)
{
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
else
{
var
layout
=
R
.
layout
.
layout_max_native_small
...
...
@@ -73,9 +70,13 @@ object AdmobMaxHelper {
}
}
private
fun
getSpAdmobTrueMaxFalse
():
Boolean
{
val
ss
=
AppPreferences
.
getInstance
().
getInt
(
"admobTrueMaxFalse"
,
0
)
return
ss
==
1
}
fun
initAdmobMaxAd
(
activity
:
Activity
?
=
null
)
{
val
ss
=
AppPreferences
.
getInstance
().
getInt
(
"admobTrueMaxFlase"
,
0
)
if
(
ss
==
1
)
{
if
(
getSpAdmobTrueMaxFalse
())
{
if
(!
isAdInit
.
get
())
{
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
isAdInit
.
set
(
true
)
...
...
@@ -89,7 +90,7 @@ object AdmobMaxHelper {
}
fun
preloadAd
(
activity
:
Activity
)
{
if
(
ConfigHelper
.
admobTrueMaxF
la
se
)
{
if
(
ConfigHelper
.
admobTrueMaxF
al
se
)
{
AdmobOpenUtils
.
loadAppOpenAd
()
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
else
{
...
...
app/src/main/java/com/base/datarecovery/help/ConfigHelper.kt
View file @
5a1a8a98
...
...
@@ -11,7 +11,7 @@ object ConfigHelper {
const
val
eventUrl
=
"https://rp.rocioxyn.xyz"
const
val
apiUrl
=
"https://api.rocioxyn.xyz"
const
val
admobTrueMaxF
la
se
=
false
const
val
admobTrueMaxF
al
se
=
false
// admob广告id
const
val
interAdmobId
=
"ca-app-pub-3640696756167444/7394845374"
...
...
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