Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
SuperEasyClean
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
songjianyu
SuperEasyClean
Commits
00cfa807
Commit
00cfa807
authored
Jun 11, 2025
by
wanglei
Committed by
songjianyu
Jun 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修复】 广告问题
parent
ad432fec
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
277 additions
and
210 deletions
+277
-210
AdEvent.kt
app/src/main/java/com/easy/clean/business/ads/AdEvent.kt
+2
-0
AdsMgr.kt
app/src/main/java/com/easy/clean/business/ads/AdsMgr.kt
+5
-3
AdBannerMgr.kt
...ain/java/com/easy/clean/business/ads/admob/AdBannerMgr.kt
+1
-1
AdInterMgr.kt
...main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
+4
-1
AdNativeMgr.kt
...ain/java/com/easy/clean/business/ads/admob/AdNativeMgr.kt
+1
-1
AdOpenMgr.kt
.../main/java/com/easy/clean/business/ads/admob/AdOpenMgr.kt
+20
-14
AdmobEvent.kt
...main/java/com/easy/clean/business/ads/admob/AdmobEvent.kt
+240
-187
SettingsFragment.kt
app/src/main/java/com/easy/clean/ui/set/SettingsFragment.kt
+1
-1
zhanwei1.png
app/src/main/res/drawable-xxhdpi/zhanwei1.png
+0
-0
fragment_settings.xml
app/src/main/res/layout/fragment_settings.xml
+3
-2
No files found.
app/src/main/java/com/easy/clean/business/ads/AdEvent.kt
View file @
00cfa807
...
@@ -23,6 +23,8 @@ abstract class AdEvent {
...
@@ -23,6 +23,8 @@ abstract class AdEvent {
var
adUnit
:
String
=
""
var
adUnit
:
String
=
""
var
from
:
String
=
""
var
from
:
String
=
""
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
var
isUnLimit
:
Boolean
=
false
fun
adPrepareShow
()
{
fun
adPrepareShow
()
{
val
obj1
=
JSONObject
()
val
obj1
=
JSONObject
()
...
...
app/src/main/java/com/easy/clean/business/ads/AdsMgr.kt
View file @
00cfa807
...
@@ -8,6 +8,7 @@ import androidx.annotation.LayoutRes
...
@@ -8,6 +8,7 @@ import androidx.annotation.LayoutRes
import
com.applovin.sdk.AppLovinMediationProvider
import
com.applovin.sdk.AppLovinMediationProvider
import
com.applovin.sdk.AppLovinSdk
import
com.applovin.sdk.AppLovinSdk
import
com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.base.appzxhy.business.ads.admob.AdOpenMgr
import
com.easy.clean.BuildConfig
import
com.easy.clean.BuildConfig
import
com.easy.clean.GlobalConfig
import
com.easy.clean.GlobalConfig
import
com.easy.clean.MyApplication
import
com.easy.clean.MyApplication
...
@@ -16,7 +17,6 @@ import com.easy.clean.bean.config.ConfigBean.Companion.configBean
...
@@ -16,7 +17,6 @@ import com.easy.clean.bean.config.ConfigBean.Companion.configBean
import
com.easy.clean.business.ads.admob.AdBannerMgr
import
com.easy.clean.business.ads.admob.AdBannerMgr
import
com.easy.clean.business.ads.admob.AdInterMgr
import
com.easy.clean.business.ads.admob.AdInterMgr
import
com.easy.clean.business.ads.admob.AdNativeMgr
import
com.easy.clean.business.ads.admob.AdNativeMgr
import
com.easy.clean.business.ads.admob.AdOpenMgr
import
com.easy.clean.business.ads.admob.AdmobEvent
import
com.easy.clean.business.ads.admob.AdmobEvent
import
com.easy.clean.business.ads.applovin.AdMaxEvent
import
com.easy.clean.business.ads.applovin.AdMaxEvent
import
com.easy.clean.business.ads.applovin.MaxInsertMgr
import
com.easy.clean.business.ads.applovin.MaxInsertMgr
...
@@ -181,12 +181,14 @@ object AdsMgr {
...
@@ -181,12 +181,14 @@ object AdsMgr {
val
from
=
activity
::
class
.
java
.
simpleName
val
from
=
activity
::
class
.
java
.
simpleName
if
(
adsConfigBean
.
adSwitch
)
{
if
(
adsConfigBean
.
adSwitch
)
{
val
admobEvent
=
AdmobEvent
(
"openAd"
,
from
)
admobEvent
.
isUnLimit
=
isUnLimit
if
(
isAdmobInit
)
{
if
(
isAdmobInit
)
{
adOpenMgr
.
show
(
activity
,
isUnLimit
,
AdmobEvent
(
"openAd"
,
from
)
,
showCallBack
)
adOpenMgr
.
show
(
activity
,
admobEvent
,
showCallBack
)
}
else
{
}
else
{
admobInitCallBack
=
{
admobInitCallBack
=
{
}
}
adOpenMgr
.
show
(
activity
,
isUnLimit
,
AdmobEvent
(
"openAd"
,
from
)
,
showCallBack
)
adOpenMgr
.
show
(
activity
,
admobEvent
,
showCallBack
)
}
}
}
else
{
}
else
{
if
(
isMaxInit
)
{
if
(
isMaxInit
)
{
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdBannerMgr.kt
View file @
00cfa807
...
@@ -42,7 +42,7 @@ class AdBannerMgr {
...
@@ -42,7 +42,7 @@ class AdBannerMgr {
adView
=
AdView
(
parent
.
context
)
adView
=
AdView
(
parent
.
context
)
parent
.
addView
(
adView
)
parent
.
addView
(
adView
)
adView
?.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
adView
)
adView
?.
onPaidEventListener
=
Admob
OnPaidEventListener
(
adView
,
admobEvent
.
scope
)
listener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
listener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
val
screenPixelDensity
=
parent
.
context
.
resources
.
displayMetrics
.
density
val
screenPixelDensity
=
parent
.
context
.
resources
.
displayMetrics
.
density
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdInterMgr.kt
View file @
00cfa807
...
@@ -18,6 +18,9 @@ import com.google.android.gms.ads.LoadAdError
...
@@ -18,6 +18,9 @@ import com.google.android.gms.ads.LoadAdError
import
com.google.android.gms.ads.interstitial.InterstitialAd
import
com.google.android.gms.ads.interstitial.InterstitialAd
import
com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
import
com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback
import
java.lang.ref.WeakReference
import
java.lang.ref.WeakReference
import
kotlin.div
import
kotlin.text.get
import
kotlin.text.toInt
/**
/**
...
@@ -150,7 +153,7 @@ class AdInterMgr {
...
@@ -150,7 +153,7 @@ class AdInterMgr {
}
}
(
adEvent
as
AdmobEvent
).
pullAd
(
ad
.
responseInfo
)
(
adEvent
as
AdmobEvent
).
pullAd
(
ad
.
responseInfo
)
LimitUtils
.
addRequestNum
()
LimitUtils
.
addRequestNum
()
ad
.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
Admob
OnPaidEventListener
(
adEvent
.
scope
)
}
}
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdNativeMgr.kt
View file @
00cfa807
...
@@ -52,7 +52,7 @@ class AdNativeMgr {
...
@@ -52,7 +52,7 @@ class AdNativeMgr {
).
forNativeAd
{
nativeAd
->
).
forNativeAd
{
nativeAd
->
lastTime
=
System
.
currentTimeMillis
()
lastTime
=
System
.
currentTimeMillis
()
nativeAd
.
setOnPaidEventListener
(
Admob
Event
.
EventOnPaidEventListener
(
nativeAd
))
nativeAd
.
setOnPaidEventListener
(
Admob
OnPaidEventListener
(
nativeAd
,
admobEvent
.
scope
))
currentNativeAd
=
nativeAd
currentNativeAd
=
nativeAd
admobEvent
.
pullAd
(
nativeAd
.
responseInfo
)
admobEvent
.
pullAd
(
nativeAd
.
responseInfo
)
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdOpenMgr.kt
View file @
00cfa807
package
com.
easy.clean
.business.ads.admob
package
com.
base.appzxhy
.business.ads.admob
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
...
@@ -9,6 +9,9 @@ import com.easy.clean.business.ads.AdState
...
@@ -9,6 +9,9 @@ import com.easy.clean.business.ads.AdState
import
com.easy.clean.business.ads.AdsShowCallBack
import
com.easy.clean.business.ads.AdsShowCallBack
import
com.easy.clean.business.ads.AdsType
import
com.easy.clean.business.ads.AdsType
import
com.easy.clean.business.ads.LimitUtils
import
com.easy.clean.business.ads.LimitUtils
import
com.easy.clean.business.ads.admob.AdmobEvent
import
com.easy.clean.business.ads.admob.AdmobOnPaidEventListener
import
com.easy.clean.utils.LogEx
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdError
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.AdRequest
import
com.google.android.gms.ads.FullScreenContentCallback
import
com.google.android.gms.ads.FullScreenContentCallback
...
@@ -27,11 +30,11 @@ class AdOpenMgr {
...
@@ -27,11 +30,11 @@ class AdOpenMgr {
private
var
showCallBack
:
AdsShowCallBack
?
=
null
private
var
showCallBack
:
AdsShowCallBack
?
=
null
fun
show
(
activity
:
Activity
,
isUnLimit
:
Boolean
,
adEvent
:
AdEvent
,
showCallBack
:
AdsShowCallBack
?)
{
fun
show
(
activity
:
Activity
,
adEvent
:
AdEvent
,
showCallBack
:
AdsShowCallBack
?)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
return
return
}
}
if
(!
isUnLimit
)
{
if
(!
adEvent
.
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
OPEN
,
adEvent
))
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
OPEN
,
adEvent
))
{
showCallBack
?.
failed
()
showCallBack
?.
failed
()
return
return
...
@@ -53,7 +56,9 @@ class AdOpenMgr {
...
@@ -53,7 +56,9 @@ class AdOpenMgr {
val
needLoad
=
adState
.
currentAd
==
null
||
!
adAvailable
()
val
needLoad
=
adState
.
currentAd
==
null
||
!
adAvailable
()
if
(
needLoad
)
{
if
(
needLoad
)
{
if
(!
adState
.
loadingAd
)
{
if
(!
adState
.
loadingAd
)
{
loadAd
(
activity
,
adEvent
,
isUnLimit
,
true
)
loadAd
(
activity
,
adEvent
)
{
showReadyAd
(
adEvent
)
}
}
}
}
else
{
}
else
{
showReadyAd
(
adEvent
)
showReadyAd
(
adEvent
)
...
@@ -62,10 +67,16 @@ class AdOpenMgr {
...
@@ -62,10 +67,16 @@ class AdOpenMgr {
private
fun
showReadyAd
(
adEvent
:
AdEvent
)
{
private
fun
showReadyAd
(
adEvent
:
AdEvent
)
{
val
ac
=
adState
.
activityRef
?.
get
()
if
(
ac
==
null
||
ac
.
isFinishing
||
ac
.
isDestroyed
)
{
LogEx
.
logDebug
(
TAG
,
"showReadyAd ac=null isFinishing isDestroyed"
)
return
}
adState
.
currentAd
?.
run
{
adState
.
currentAd
?.
run
{
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
val
ac
=
adState
.
activityRef
?.
get
()
(
adEvent
as
AdmobEvent
).
showAd
(
this
@run
.
responseInfo
,
ac
)
(
adEvent
as
AdmobEvent
).
showAd
(
this
@run
.
responseInfo
,
ac
)
showCallBack
?.
show
()
showCallBack
?.
show
()
...
@@ -114,11 +125,10 @@ class AdOpenMgr {
...
@@ -114,11 +125,10 @@ class AdOpenMgr {
fun
loadAd
(
fun
loadAd
(
context
:
Context
,
context
:
Context
,
adEvent
:
AdEvent
,
adEvent
:
AdEvent
,
isUnLimit
:
Boolean
=
false
,
loadCallBack
:
(()
->
Unit
)?
=
null
isShow
:
Boolean
=
false
,
)
{
)
{
if
(!
isUnLimit
)
{
if
(!
adEvent
.
isUnLimit
)
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
OPEN
,
adEvent
))
{
if
(!
LimitUtils
.
isAdShow
(
AdsType
.
OPEN
,
adEvent
))
{
this
.
showCallBack
?.
close
()
this
.
showCallBack
?.
close
()
this
.
showCallBack
=
null
this
.
showCallBack
=
null
...
@@ -127,7 +137,6 @@ class AdOpenMgr {
...
@@ -127,7 +137,6 @@ class AdOpenMgr {
}
}
}
}
adEvent
.
adPulStart
()
adEvent
.
adPulStart
()
AppOpenAd
.
load
(
AppOpenAd
.
load
(
...
@@ -137,13 +146,10 @@ class AdOpenMgr {
...
@@ -137,13 +146,10 @@ class AdOpenMgr {
object
:
AppOpenAd
.
AppOpenAdLoadCallback
()
{
object
:
AppOpenAd
.
AppOpenAdLoadCallback
()
{
override
fun
onAdLoaded
(
appOpenAd
:
AppOpenAd
)
{
override
fun
onAdLoaded
(
appOpenAd
:
AppOpenAd
)
{
adState
.
onAdLoaded
(
appOpenAd
)
adState
.
onAdLoaded
(
appOpenAd
)
if
(
this
@AdOpenMgr
.
showCallBack
!=
null
||
isShow
)
{
loadCallBack
?.
invoke
()
showReadyAd
(
adEvent
)
}
(
adEvent
as
AdmobEvent
).
pullAd
(
appOpenAd
.
responseInfo
)
(
adEvent
as
AdmobEvent
).
pullAd
(
appOpenAd
.
responseInfo
)
appOpenAd
.
onPaidEventListener
=
Admob
Event
.
EventOnPaidEventListener
(
appOpenAd
)
appOpenAd
.
onPaidEventListener
=
Admob
OnPaidEventListener
(
appOpenAd
,
adEvent
.
scope
)
LimitUtils
.
addRequestNum
()
LimitUtils
.
addRequestNum
()
}
}
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
...
...
app/src/main/java/com/easy/clean/business/ads/admob/AdmobEvent.kt
View file @
00cfa807
...
@@ -25,25 +25,34 @@ import com.google.android.gms.ads.rewarded.RewardedAd
...
@@ -25,25 +25,34 @@ import com.google.android.gms.ads.rewarded.RewardedAd
import
com.google.firebase.analytics.FirebaseAnalytics
import
com.google.firebase.analytics.FirebaseAnalytics
import
com.google.firebase.analytics.ktx.analytics
import
com.google.firebase.analytics.ktx.analytics
import
com.google.firebase.ktx.Firebase
import
com.google.firebase.ktx.Firebase
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.SupervisorJob
import
kotlinx.coroutines.launch
import
org.json.JSONObject
import
org.json.JSONObject
import
java.math.BigDecimal
import
java.math.BigDecimal
import
java.util.Currency
import
java.util.Currency
import
kotlin.Any
import
kotlin.div
import
kotlin.random.Random
import
kotlin.random.Random
import
kotlin.text.toFloat
class
AdmobEvent
:
AdEvent
{
class
AdmobEvent
:
AdEvent
{
override
val
TAG
:
String
=
"AdmobEvent"
override
val
TAG
:
String
=
"AdmobEvent"
val
scope
=
CoroutineScope
(
SupervisorJob
()
+
Dispatchers
.
IO
)
constructor
(
adUnit
:
String
,
from
:
String
)
:
super
()
{
constructor
(
adUnit
:
String
,
from
:
String
)
:
super
()
{
this
.
adUnit
=
adUnit
this
.
adUnit
=
adUnit
this
.
from
=
from
this
.
from
=
from
}
}
fun
pullAd
(
fun
pullAd
(
responseInfo
:
ResponseInfo
?,
responseInfo
:
ResponseInfo
?,
error
:
LoadAdError
?
=
null
,
error
:
LoadAdError
?
=
null
,
)
{
)
=
scope
.
launch
{
var
key
=
"ad_pull"
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
if
(
responseInfo
!=
null
)
{
if
(
responseInfo
!=
null
)
{
...
@@ -63,21 +72,18 @@ class AdmobEvent : AdEvent {
...
@@ -63,21 +72,18 @@ class AdmobEvent : AdEvent {
obj
.
put
(
"networkname"
,
responseInfo
?.
mediationAdapterClassName
)
obj
.
put
(
"networkname"
,
responseInfo
?.
mediationAdapterClassName
)
obj
.
put
(
"ad_unit"
,
adUnit
)
obj
.
put
(
"ad_unit"
,
adUnit
)
obj
.
put
(
"from"
,
from
)
obj
.
put
(
"from"
,
from
)
var
key
:
String
?
=
null
if
(
error
==
null
)
{
if
(
error
==
null
)
{
obj
.
put
(
"status"
,
"1"
)
obj
.
put
(
"status"
,
"1"
)
key
=
"ad_pull"
}
else
{
}
else
{
obj
.
put
(
"errMsg"
,
error
.
toString
())
obj
.
put
(
"errMsg"
,
error
.
toString
())
obj
.
put
(
"status"
,
"2"
)
obj
.
put
(
"status"
,
"2"
)
key
=
"ad_pull_error"
key
=
"ad_pull_error"
}
}
EventUtils
.
event
(
"ad_pull"
,
ext
=
obj
)
EventUtils
.
event
(
key
,
ext
=
obj
)
LogEx
.
logDebug
(
TAG
,
"
ad_pull
obj=$obj"
)
LogEx
.
logDebug
(
TAG
,
"
$key
obj=$obj"
)
}
}
fun
clickAd
(
responseInfo
:
ResponseInfo
?)
=
scope
.
launch
{
fun
clickAd
(
responseInfo
:
ResponseInfo
?)
{
val
response
=
responseInfo
?.
adapterResponses
?.
getOrNull
(
0
)
val
response
=
responseInfo
?.
adapterResponses
?.
getOrNull
(
0
)
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
...
@@ -101,7 +107,7 @@ class AdmobEvent : AdEvent {
...
@@ -101,7 +107,7 @@ class AdmobEvent : AdEvent {
}
}
}
}
fun
showAd
(
responseInfo
:
ResponseInfo
?,
activity
:
Activity
?
=
null
)
{
fun
showAd
(
responseInfo
:
ResponseInfo
?,
activity
:
Activity
?
=
null
)
=
scope
.
launch
{
val
response
=
responseInfo
?.
adapterResponses
?.
getOrNull
(
0
)
val
response
=
responseInfo
?.
adapterResponses
?.
getOrNull
(
0
)
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"req_id"
,
reqId
)
...
@@ -124,158 +130,242 @@ class AdmobEvent : AdEvent {
...
@@ -124,158 +130,242 @@ class AdmobEvent : AdEvent {
LogEx
.
logDebug
(
TAG
,
"ad_show $obj"
)
LogEx
.
logDebug
(
TAG
,
"ad_show $obj"
)
}
}
class
EventOnPaidEventListener
(
private
val
ad
:
Any
?)
:
OnPaidEventListener
{
fun
adShowError
(
adError
:
AdError
)
=
scope
.
launch
{
override
fun
onPaidEvent
(
adValue
:
AdValue
)
{
val
obj
=
JSONObject
()
ad
?:
return
obj
.
put
(
"req_id"
,
reqId
)
SolarEngineEvent
.
eventSolar
(
ad
,
adValue
.
valueMicros
)
obj
.
put
(
"reason"
,
adError
.
message
)
val
adRatio
=
AdConfigBean
.
adsConfigBean
.
adRatio
obj
.
put
(
"code"
,
adError
.
code
)
val
random
=
Random
.
Default
.
nextInt
(
1
,
100
)
obj
.
put
(
"from"
,
from
)
if
(
random
>
adRatio
)
{
obj
.
put
(
"ad_unit"
,
"openAd"
)
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
0f
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj
)
taichiSharedPreferencesEditor
.
commit
()
LogEx
.
logDebug
(
TAG
,
"ad_show_error $obj"
)
EventUtils
.
event
(
"ad_price_limit"
)
}
return
}
}
val
valueMicros
=
adValue
.
valueMicros
val
currencyCode
=
adValue
.
currencyCode
class
AdmobOnPaidEventListener
(
val
precision
=
adValue
.
precisionType
private
val
ad
:
Any
?,
private
val
coroutineScope
:
CoroutineScope
=
CoroutineScope
(
SupervisorJob
()
+
Dispatchers
.
IO
)
val
fbLogger
=
AppEventsLogger
.
newLogger
(
MyApplication
.
appContext
)
)
:
OnPaidEventListener
{
fbLogger
.
logPurchase
(
BigDecimal
.
valueOf
(
valueMicros
/
1000000
),
Currency
.
getInstance
(
currencyCode
))
override
fun
onPaidEvent
(
adValue
:
AdValue
)
{
val
obj
=
JSONObject
()
ad
?:
return
obj
.
put
(
"valueMicros"
,
valueMicros
)
onPaidEvent2
(
ad
,
adValue
)
obj
.
put
(
"currencyCode"
,
currencyCode
)
}
obj
.
put
(
"precision"
,
precision
)
fun
onPaidEvent2
(
ad
:
Any
?,
adValue
:
AdValue
)
{
Firebase
.
analytics
.
logEvent
(
"ad_price"
,
Bundle
().
apply
{
coroutineScope
.
launch
{
putDouble
(
"valueMicros"
,
valueMicros
/
1000000.0
)
try
{
})
val
flag
=
eventAdRatio
()
if
(
flag
)
{
val
params
=
Bundle
()
SolarEngineEvent
.
eventSolar
(
ad
,
adValue
.
valueMicros
)
val
currentImpressionRevenue
=
adValue
.
valueMicros
.
toDouble
()
/
1000000.0
eventFireBase
(
adValue
)
params
.
putDouble
(
FirebaseAnalytics
.
Param
.
VALUE
,
currentImpressionRevenue
)
eventEvent
(
adValue
)
params
.
putString
(
FirebaseAnalytics
.
Param
.
CURRENCY
,
"USD"
)
}
LogEx
.
logDebug
(
"EventOnPaidEventListener"
,
"precisionType=${adValue.precisionType}"
)
}
catch
(
e
:
Exception
)
{
val
precisionType
=
when
(
adValue
.
precisionType
)
{
EventUtils
.
event
(
"onPaidEvent_Error"
)
0
->
"UNKNOWN"
1
->
"ESTIMATED"
2
->
"PUBLISHER_PROVIDED"
3
->
"PRECISE"
else
->
"Invalid"
}
params
.
putString
(
"precisionType"
,
precisionType
)
Firebase
.
analytics
.
logEvent
(
"Ad_Impression_Revenue"
,
params
)
val
previousTaichiTroasCache
=
taichiPref
.
getFloat
(
"TaichiTroasCache"
,
0f
)
val
currentTaichiTroasCache
=
(
previousTaichiTroasCache
+
currentImpressionRevenue
).
toFloat
()
val
taichiAdValue
=
AdConfigBean
.
adsConfigBean
.
taichiAdValue
/
100f
if
(
currentTaichiTroasCache
>=
taichiAdValue
)
{
//如果超过0.01就触发一次tROAS taichi事件
val
roasbundle
=
Bundle
()
roasbundle
.
putDouble
(
FirebaseAnalytics
.
Param
.
VALUE
,
currentTaichiTroasCache
.
toDouble
()
)
roasbundle
.
putString
(
FirebaseAnalytics
.
Param
.
CURRENCY
,
"USD"
)
Firebase
.
analytics
.
logEvent
(
"Total_Ads_Revenue_001"
,
roasbundle
)
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
0f
)
//重新清零,开始计算
val
logger
=
AppEventsLogger
.
newLogger
(
MyApplication
.
appContext
)
val
parameters
=
Bundle
()
parameters
.
putString
(
AppEventsConstants
.
EVENT_PARAM_CURRENCY
,
"USD"
)
logger
.
logEvent
(
"ad_value"
,
currentTaichiTroasCache
.
toDouble
(),
parameters
)
}
else
{
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
currentTaichiTroasCache
)
}
}
}
}
fun
eventAdRatio
():
Boolean
{
val
adRatio
=
AdConfigBean
.
Companion
.
adsConfigBean
.
adRatio
val
random
=
Random
.
Default
.
nextInt
(
1
,
100
)
if
(
random
>
adRatio
)
{
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
0f
)
taichiSharedPreferencesEditor
.
commit
()
taichiSharedPreferencesEditor
.
commit
()
EventUtils
.
event
(
"ad_price_limit"
)
return
false
}
return
true
}
var
key
=
"ad_price"
/**
when
(
ad
)
{
* 上报给firebase
is
AppOpenAd
->
{
*/
val
adUnitId
=
ad
.
adUnitId
fun
eventFireBase
(
adValue
:
AdValue
)
{
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
InterstitialAd
->
{
val
valueMicros
=
adValue
.
valueMicros
val
adUnitId
=
ad
.
adUnitId
val
currencyCode
=
adValue
.
currencyCode
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
currentImpressionRevenue
=
adValue
.
valueMicros
.
toDouble
()
/
1000000.0
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
RewardedAd
->
{
//sp里面的价格值
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
previousTaichiTroasCache
=
taichiPref
.
getFloat
(
"TaichiTroasCache"
,
0f
)
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
NativeAd
->
{
//当前缓存加个值
key
=
"ad_price"
val
currentTaichiTroasCache
=
(
previousTaichiTroasCache
+
currentImpressionRevenue
).
toFloat
()
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
?.
loadedAdapterResponseInfo
//价值上报阀值
val
taichiAdValue
=
AdConfigBean
.
Companion
.
adsConfigBean
.
taichiAdValue
/
100f
val
params
=
Bundle
()
params
.
putDouble
(
FirebaseAnalytics
.
Param
.
VALUE
,
currentImpressionRevenue
)
params
.
putString
(
FirebaseAnalytics
.
Param
.
CURRENCY
,
"USD"
)
LogEx
.
logDebug
(
"EventOnPaidEventListener"
,
"precisionType=${adValue.precisionType}"
)
val
precisionType
=
when
(
adValue
.
precisionType
)
{
0
->
"UNKNOWN"
1
->
"ESTIMATED"
2
->
"PUBLISHER_PROVIDED"
3
->
"PRECISE"
else
->
"Invalid"
}
params
.
putString
(
"precisionType"
,
precisionType
)
val
fbLogger
=
AppEventsLogger
.
newLogger
(
MyApplication
.
Companion
.
appContext
)
//上报
fbLogger
.
logPurchase
(
BigDecimal
.
valueOf
(
currentImpressionRevenue
),
Currency
.
getInstance
(
currencyCode
))
//上报ad_price
Firebase
.
analytics
.
logEvent
(
"ad_price"
,
Bundle
().
apply
{
putDouble
(
"valueMicros"
,
valueMicros
/
1000000.0
)
})
//上报Ad_Impression_Revenue
Firebase
.
analytics
.
logEvent
(
"Ad_Impression_Revenue"
,
params
)
//上报Total_Ads_Revenue_001
if
(
currentTaichiTroasCache
>=
taichiAdValue
)
{
//如果超过0.01就触发一次tROAS taichi事件
val
roasbundle
=
Bundle
()
roasbundle
.
putDouble
(
FirebaseAnalytics
.
Param
.
VALUE
,
currentTaichiTroasCache
.
toDouble
())
roasbundle
.
putString
(
FirebaseAnalytics
.
Param
.
CURRENCY
,
"USD"
)
Firebase
.
analytics
.
logEvent
(
"Total_Ads_Revenue_001"
,
roasbundle
)
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
0f
)
//重新清零,开始计算
val
parameters
=
Bundle
()
parameters
.
putString
(
AppEventsConstants
.
EVENT_PARAM_CURRENCY
,
"USD"
)
fbLogger
.
logEvent
(
"ad_value"
,
currentTaichiTroasCache
.
toDouble
(),
parameters
)
}
else
{
taichiSharedPreferencesEditor
.
putFloat
(
"TaichiTroasCache"
,
currentTaichiTroasCache
)
}
taichiSharedPreferencesEditor
.
commit
()
}
/**
* 上报给服务器
*/
fun
eventEvent
(
adValue
:
AdValue
)
{
val
valueMicros
=
adValue
.
valueMicros
val
currencyCode
=
adValue
.
currencyCode
val
precision
=
adValue
.
precisionType
val
obj
=
JSONObject
()
obj
.
put
(
"valueMicros"
,
valueMicros
)
obj
.
put
(
"currencyCode"
,
currencyCode
)
obj
.
put
(
"precision"
,
precision
)
var
key
=
"ad_price"
when
(
ad
)
{
is
AppOpenAd
->
{
val
adUnitId
=
ad
.
adUnitId
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
InterstitialAd
->
{
val
adUnitId
=
ad
.
adUnitId
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"interAd"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
RewardedAd
->
{
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
.
responseId
val
extras
=
ad
.
responseInfo
.
responseExtras
val
mediationGroupName
=
extras
.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
is
NativeAd
->
{
key
=
"ad_price"
val
loadedAdapterResponseInfo
=
ad
.
responseInfo
?.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
?.
responseId
val
extras
=
ad
.
responseInfo
?.
responseExtras
val
mediationGroupName
=
extras
?.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
?.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
?.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"nativeAd"
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
else
->
{
runCatching
{
val
adView
=
ad
as
AdView
val
adUnitId
=
adView
.
adUnitId
val
loadedAdapterResponseInfo
=
adView
.
responseInfo
?.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
ad
.
responseInfo
?.
responseId
val
sessionId
=
ad
View
.
responseInfo
?.
responseId
val
extras
=
ad
.
responseInfo
?.
responseExtras
val
extras
=
ad
View
.
responseInfo
?.
responseExtras
val
mediationGroupName
=
extras
?.
getString
(
"mediation_group_name"
)
val
mediationGroupName
=
extras
?.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
?.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestName
=
extras
?.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
?.
getString
(
"mediation_ab_test_variant"
)
val
mediationABTestVariant
=
extras
?.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"nativeAd"
)
obj
.
put
(
"ad_unit"
,
"banner"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
...
@@ -285,46 +375,9 @@ class AdmobEvent : AdEvent {
...
@@ -285,46 +375,9 @@ class AdmobEvent : AdEvent {
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
obj
.
put
(
"session_id"
,
sessionId
)
}
}
else
->
{
runCatching
{
val
adView
=
ad
as
AdView
val
adUnitId
=
adView
.
adUnitId
val
loadedAdapterResponseInfo
=
adView
.
responseInfo
?.
loadedAdapterResponseInfo
val
adSourceName
=
loadedAdapterResponseInfo
?.
adSourceName
val
adSourceId
=
loadedAdapterResponseInfo
?.
adSourceId
val
adSourceInstanceName
=
loadedAdapterResponseInfo
?.
adSourceInstanceName
val
adSourceInstanceId
=
loadedAdapterResponseInfo
?.
adSourceInstanceId
val
sessionId
=
adView
.
responseInfo
?.
responseId
val
extras
=
adView
.
responseInfo
?.
responseExtras
val
mediationGroupName
=
extras
?.
getString
(
"mediation_group_name"
)
val
mediationABTestName
=
extras
?.
getString
(
"mediation_ab_test_name"
)
val
mediationABTestVariant
=
extras
?.
getString
(
"mediation_ab_test_variant"
)
obj
.
put
(
"ad_unit"
,
"banner"
)
obj
.
put
(
"adUnitId"
,
adUnitId
)
obj
.
put
(
"adSourceName"
,
adSourceName
)
obj
.
put
(
"adSourceId"
,
adSourceId
)
obj
.
put
(
"adSourceInstanceName"
,
adSourceInstanceName
)
obj
.
put
(
"adSourceInstanceId"
,
adSourceInstanceId
)
obj
.
put
(
"mediationGroupName"
,
mediationGroupName
)
obj
.
put
(
"mediationABTestName"
,
mediationABTestName
)
obj
.
put
(
"mediationABTestVariant"
,
mediationABTestVariant
)
obj
.
put
(
"session_id"
,
sessionId
)
}
}
}
}
EventUtils
.
event
(
key
,
ext
=
obj
)
}
}
}
EventUtils
.
event
(
key
,
ext
=
obj
)
fun
adShowError
(
adError
:
AdError
)
{
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"reason"
,
adError
.
message
)
obj
.
put
(
"code"
,
adError
.
code
)
obj
.
put
(
"from"
,
from
)
obj
.
put
(
"ad_unit"
,
"openAd"
)
EventUtils
.
event
(
"ad_show_error"
,
ext
=
obj
)
LogEx
.
logDebug
(
TAG
,
"ad_show_error $obj"
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/easy/clean/ui/set/SettingsFragment.kt
View file @
00cfa807
...
@@ -40,7 +40,7 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
...
@@ -40,7 +40,7 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
binding
.
tvCleanedUp
.
text
=
cleanedSize
.
toFormatSize
()
binding
.
tvCleanedUp
.
text
=
cleanedSize
.
toFormatSize
()
binding
.
tvVersion
.
text
=
"v${BuildConfig.VERSION_NAME}"
binding
.
tvVersion
.
text
=
"v${BuildConfig.VERSION_NAME}"
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_native_
mediu
m
)
AdsMgr
.
showNative
(
binding
.
flAd
,
R
.
layout
.
layout_admob_native_
custo
m
)
if
(
BuildConfig
.
DEBUG
)
{
if
(
BuildConfig
.
DEBUG
)
{
binding
.
tvToken
.
visibility
=
View
.
VISIBLE
binding
.
tvToken
.
visibility
=
View
.
VISIBLE
...
...
app/src/main/res/drawable-xxhdpi/zhanwei1.png
View replaced file @
ad432fec
View file @
00cfa807
16.4 KB
|
W:
|
H:
12.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/layout/fragment_settings.xml
View file @
00cfa807
...
@@ -65,15 +65,16 @@
...
@@ -65,15 +65,16 @@
<com.easy.clean.business.ads.NativeParentView
<com.easy.clean.business.ads.NativeParentView
android:id=
"@+id/flAd"
android:id=
"@+id/flAd"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
180dp
"
android:layout_height=
"
wrap_content
"
android:layout_marginTop=
"12dp"
android:layout_marginTop=
"12dp"
android:layout_marginHorizontal=
"12dp"
app:layout_constraintTop_toBottomOf=
"@id/cl_top"
>
app:layout_constraintTop_toBottomOf=
"@id/cl_top"
>
<androidx.appcompat.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:scaleType=
"fitXY"
android:scaleType=
"fitXY"
android:src=
"@drawable/
img_ad_medium_zhanwei
"
android:src=
"@drawable/
zhanwei1
"
tools:ignore=
"ContentDescription,ImageContrastCheck"
/>
tools:ignore=
"ContentDescription,ImageContrastCheck"
/>
</com.easy.clean.business.ads.NativeParentView>
</com.easy.clean.business.ads.NativeParentView>
...
...
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