Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
fdf059cd
Commit
fdf059cd
authored
Nov 25, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...移除max
parent
02ba2215
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
764 additions
and
770 deletions
+764
-770
build.gradle
app/build.gradle
+2
-2
AdmobMaxHelper.kt
...ava/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
+36
-41
AdMaxEvent.kt
...ava/com/base/filerecoveryrecyclebin/ads/max/AdMaxEvent.kt
+144
-144
AdMaxInit.kt
...java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInit.kt
+47
-47
AdMaxInterstitialUtils.kt
.../filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
+196
-196
AdMaxNativeUtils.kt
...m/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
+160
-160
AdMaxOpenUtils.kt
...com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
+179
-179
layout_max_native_custom.xml
app/src/main/res/layout/layout_max_native_custom.xml
+0
-1
No files found.
app/build.gradle
View file @
fdf059cd
...
...
@@ -92,13 +92,13 @@ dependencies {
//广告
implementation
(
"com.google.android.gms:play-services-ads:23.1.0"
)
implementation
'com.google.ads.mediation:applovin:12.4.3.0'
//
implementation 'com.google.ads.mediation:applovin:12.4.3.0'
implementation
'com.google.ads.mediation:facebook:6.17.0.0'
implementation
'com.google.ads.mediation:mintegral:16.7.21.0'
implementation
'com.google.ads.mediation:pangle:5.9.0.4.0'
//max
implementation
'com.applovin:applovin-sdk:+'
//
implementation 'com.applovin:applovin-sdk:+'
// implementation 'com.applovin.mediation:google-adapter:+'
// implementation 'com.applovin.mediation:facebook-adapter:+'
// implementation 'com.applovin.mediation:mintegral-adapter:+'
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/AdmobMaxHelper.kt
View file @
fdf059cd
...
...
@@ -3,15 +3,9 @@ package com.base.filerecoveryrecyclebin.ads
import
android.app.Activity
import
android.util.Log
import
android.view.ViewGroup
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInit
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInit.initAdMax
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxOpenUtils
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.EventUtils
...
...
@@ -51,7 +45,7 @@ object AdmobMaxHelper {
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
()
)
{
if
(
true
)
{
if
(!
isAdInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"init sp Admob"
)
MobileAds
.
initialize
(
BaseApplication
.
context
)
{
initializationStatus
->
...
...
@@ -59,20 +53,21 @@ object AdmobMaxHelper {
}
}
}
else
{
if
(!
isAdInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"init sp AdMax"
)
BaseApplication
.
context
.
initAdMax
()
}
//
if (!isAdInit.get()) {
//
LogEx.logDebug(TAG, "init sp AdMax")
//
BaseApplication.context.initAdMax()
//
}
}
}
//End end
fun
isOpenAdLoaded
():
Boolean
{
return
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobOpenUtils
.
isOpenAdLoaded
()
}
else
{
AdMaxOpenUtils
.
isOpenAdLoaded
()
}
// if (getSpAdmobTrueMaxFalse()) {
//
// } else {
// AdMaxOpenUtils.isOpenAdLoaded()
// }
return
AdmobOpenUtils
.
isOpenAdLoaded
()
}
//展示广告关闭时赋值
...
...
@@ -96,14 +91,14 @@ object AdmobMaxHelper {
return
}
if
(
getSpAdmobTrueMaxFalse
()
)
{
if
(
true
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
()
}
}
else
{
AdMaxInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
()
}
//
AdMaxInterstitialUtils.showInterstitialAd(activity) {
//
onHidden?.invoke()
//
}
}
}
...
...
@@ -116,14 +111,14 @@ object AdmobMaxHelper {
onHidden
?.
invoke
()
return
}
if
(
getSpAdmobTrueMaxFalse
()
)
{
if
(
true
)
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
)
{
onHidden
?.
invoke
()
}
}
else
{
AdMaxOpenUtils
.
showAppOpenAd
(
activity
,
loadCallBack
=
showBeforeAction
)
{
onHidden
?.
invoke
()
}
//
AdMaxOpenUtils.showAppOpenAd(activity, loadCallBack = showBeforeAction) {
//
onHidden?.invoke()
//
}
}
}
...
...
@@ -131,20 +126,20 @@ object AdmobMaxHelper {
if
(
isBlack
)
{
return
}
if
(
getSpAdmobTrueMaxFalse
()
)
{
if
(
true
)
{
AdmobNativeUtils
.
showNativeAd
(
activity
,
parent
)
}
else
{
var
layout
=
R
.
layout
.
layout_max_native_small
if
(
where
==
0
)
{
layout
=
R
.
layout
.
layout_max_native_small_f8f8f8
}
if
(
where
==
1
)
{
layout
=
R
.
layout
.
layout_max_native_big
}
if
(
where
==
2
)
{
layout
=
R
.
layout
.
layout_max_native_big_2
}
AdMaxNativeUtils
.
showNativeAd
(
activity
,
parent
,
layout
)
//
var layout = R.layout.layout_max_native_small
//
if (where == 0) {
//
layout = R.layout.layout_max_native_small_f8f8f8
//
}
//
if (where == 1) {
//
layout = R.layout.layout_max_native_big
//
}
//
if (where == 2) {
//
layout = R.layout.layout_max_native_big_2
//
}
//
AdMaxNativeUtils.showNativeAd(activity, parent, layout)
}
}
...
...
@@ -153,19 +148,19 @@ object AdmobMaxHelper {
return
}
if
(
getSpAdmobTrueMaxFalse
()
)
{
if
(
true
)
{
// AdmobOpenUtils.loadAppOpenAd()
AdmobInterstitialUtils
.
loadInterstitialAd
(
activity
)
}
else
{
if
(
isAdInit
.
get
())
{
// AdMaxOpenUtils.loadAppOpenAd(activity)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
//
AdMaxInterstitialUtils.loadInterstitialAd(activity)
}
else
{
AdMaxInit
.
maxInitAction
=
{
//
AdMaxInit.maxInitAction = {
Log
.
d
(
TAG
,
"max init suc"
)
// AdMaxOpenUtils.loadAppOpenAd(activity)
// AdMaxInterstitialUtils.loadInterstitialAd(activity)
}
//
}
}
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxEvent.kt
View file @
fdf059cd
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInit.kt
View file @
fdf059cd
package
com.base.filerecoveryrecyclebin.ads.max
import
android.content.Context
import
com.applovin.sdk.AppLovinMediationProvider
import
com.applovin.sdk.AppLovinSdk
import
com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper.isAdInit
import
com.base.filerecoveryrecyclebin.utils.EventUtils
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
java.util.concurrent.Executors
object
AdMaxInit
{
private
val
TAG
=
"AdMaxInit"
var
maxInitAction
:
(()
->
Unit
)?
=
null
fun
Context
.
initAdMax
()
{
// If you want to test your own AppLovin SDK key, change the value here and update the package name in the build.gradle
// val YOUR_SDK_KEY = "05TMDQ5tZabpXQ45_UTbmEGNUtVAzSTzT6KmWQc5_CuWdzccS4DCITZoL3yIWUG3bbq60QC_d4WF28tUC4gVTF"
val
YOUR_SDK_KEY
=
"GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
val
executor
=
Executors
.
newSingleThreadExecutor
();
executor
.
execute
{
val
initConfigBuilder
=
AppLovinSdkInitializationConfiguration
.
builder
(
YOUR_SDK_KEY
,
this
)
initConfigBuilder
.
mediationProvider
=
AppLovinMediationProvider
.
MAX
// Enable test mode by default for the current device. Cannot be run on the main thread.
// val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id
// if (currentGaid != null) {
// initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid)
//package com.base.filerecoveryrecyclebin.ads.max
//
//import android.content.Context
//import com.applovin.sdk.AppLovinMediationProvider
//import com.applovin.sdk.AppLovinSdk
//import com.applovin.sdk.AppLovinSdkInitializationConfiguration
//import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper.isAdInit
//import com.base.filerecoveryrecyclebin.utils.EventUtils
//import com.base.filerecoveryrecyclebin.utils.LogEx
//import java.util.concurrent.Executors
//
//object AdMaxInit {
//
// private val TAG = "AdMaxInit"
// var maxInitAction: (() -> Unit)? = null
//
// fun Context.initAdMax() {
// // If you want to test your own AppLovin SDK key, change the value here and update the package name in the build.gradle
//// val YOUR_SDK_KEY = "05TMDQ5tZabpXQ45_UTbmEGNUtVAzSTzT6KmWQc5_CuWdzccS4DCITZoL3yIWUG3bbq60QC_d4WF28tUC4gVTF"
// val YOUR_SDK_KEY = "GGPreND6SRmCt1zJgn5faiLGD8c2PVGPLgPpSg7cHanVTud1DhtuI9MmteTqlEviaJ57WnxW68kQDaATJ5z3cW"
//
// val executor = Executors.newSingleThreadExecutor();
// executor.execute {
//
// val initConfigBuilder = AppLovinSdkInitializationConfiguration.builder(YOUR_SDK_KEY, this)
// initConfigBuilder.mediationProvider = AppLovinMediationProvider.MAX
//
// // Enable test mode by default for the current device. Cannot be run on the main thread.
//// val currentGaid = AdvertisingIdClient.getAdvertisingIdInfo(this).id
//// if (currentGaid != null) {
//// initConfigBuilder.testDeviceAdvertisingIds = Collections.singletonList(currentGaid)
//// }
//
//
// // Initialize the AppLovin SDK
// val sdk = AppLovinSdk.getInstance(this)
// sdk.initialize(initConfigBuilder.build()) {
// LogEx.logDebug(TAG, "max init")
// isAdInit.set(true)
// maxInitAction?.invoke()
// maxInitAction = null
// EventUtils.event("MaxInit", "MaxInit")
// }
// Initialize the AppLovin SDK
val
sdk
=
AppLovinSdk
.
getInstance
(
this
)
sdk
.
initialize
(
initConfigBuilder
.
build
())
{
LogEx
.
logDebug
(
TAG
,
"max init"
)
isAdInit
.
set
(
true
)
maxInitAction
?.
invoke
()
maxInitAction
=
null
EventUtils
.
event
(
"MaxInit"
,
"MaxInit"
)
}
executor
.
shutdown
()
}
}
}
\ No newline at end of file
//
// executor.shutdown()
// }
// }
//}
\ No newline at end of file
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
View file @
fdf059cd
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxNativeUtils.kt
View file @
fdf059cd
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
View file @
fdf059cd
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/layout_max_native_custom.xml
View file @
fdf059cd
...
...
@@ -104,7 +104,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:backgroundTint=
"@color/applovin_sdk_brand_color"
android:textColor=
"@android:color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/ad_media"
...
...
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