Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser 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
Browser White
Commits
c2ab1805
Commit
c2ab1805
authored
Sep 18, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
9c58d64f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
739 additions
and
739 deletions
+739
-739
AdmobMaxHelper.kt
...src/main/java/com/base/browserwhite/ads/AdmobMaxHelper.kt
+17
-17
AdMaxEvent.kt
...src/main/java/com/base/browserwhite/ads/max/AdMaxEvent.kt
+144
-144
AdMaxInit.kt
app/src/main/java/com/base/browserwhite/ads/max/AdMaxInit.kt
+47
-47
AdMaxInterstitialUtils.kt
...a/com/base/browserwhite/ads/max/AdMaxInterstitialUtils.kt
+194
-194
AdMaxNativeUtils.kt
...in/java/com/base/browserwhite/ads/max/AdMaxNativeUtils.kt
+158
-158
AdMaxOpenUtils.kt
...main/java/com/base/browserwhite/ads/max/AdMaxOpenUtils.kt
+179
-179
No files found.
app/src/main/java/com/base/browserwhite/ads/AdmobMaxHelper.kt
View file @
c2ab1805
...
...
@@ -8,11 +8,11 @@ import com.base.browserwhite.R
import
com.base.browserwhite.ads.admob.AdmobInterstitialUtils
import
com.base.browserwhite.ads.admob.AdmobNativeUtils
import
com.base.browserwhite.ads.admob.AdmobOpenUtils
import
com.base.browserwhite.ads.max.AdMaxInit
import
com.base.browserwhite.ads.max.AdMaxInit.initAdMax
import
com.base.browserwhite.ads.max.AdMaxInterstitialUtils
import
com.base.browserwhite.ads.max.AdMaxNativeUtils
import
com.base.browserwhite.ads.max.AdMaxOpenUtils
//
import com.base.browserwhite.ads.max.AdMaxInit
//
import com.base.browserwhite.ads.max.AdMaxInit.initAdMax
//
import com.base.browserwhite.ads.max.AdMaxInterstitialUtils
//
import com.base.browserwhite.ads.max.AdMaxNativeUtils
//
import com.base.browserwhite.ads.max.AdMaxOpenUtils
import
com.base.browserwhite.help.EventUtils
import
com.base.browserwhite.utils.AppPreferences
import
com.base.browserwhite.utils.LogEx
...
...
@@ -87,7 +87,7 @@ object AdmobMaxHelper {
}
else
{
if
(!
isAdInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"init sp AdMax"
)
MyApplication
.
context
.
initAdMax
()
//
MyApplication.context.initAdMax()
}
}
}
...
...
@@ -119,9 +119,9 @@ object AdmobMaxHelper {
onHidden
?.
invoke
(
it
)
}
}
else
{
AdMaxInterstitialUtils
.
showInterstitialAd
(
activity
)
{
onHidden
?.
invoke
(
true
)
}
//
AdMaxInterstitialUtils.showInterstitialAd(activity) {
//
onHidden?.invoke(true)
//
}
}
}
...
...
@@ -137,9 +137,9 @@ object AdmobMaxHelper {
if
(
getSpAdmobTrueMaxFalse
())
{
AdmobOpenUtils
.
showAppOpenAd
(
activity
,
showBefore
=
showBeforeAction
,
onHidden
=
onHidden
)
}
else
{
AdMaxOpenUtils
.
showAppOpenAd
(
activity
,
loadCallBack
=
showBeforeAction
)
{
onHidden
?.
invoke
(
true
)
}
//
AdMaxOpenUtils.showAppOpenAd(activity, loadCallBack = showBeforeAction) {
//
onHidden?.invoke(true)
//
}
}
}
...
...
@@ -166,7 +166,7 @@ object AdmobMaxHelper {
// if (where == 2) {
// layout = R.layout.layout_max_native_big_2
// }
AdMaxNativeUtils
.
showNativeAd
(
activity
,
parent
,
layout
)
//
AdMaxNativeUtils.showNativeAd(activity, parent, layout)
}
}
...
...
@@ -182,13 +182,13 @@ object AdmobMaxHelper {
}
else
{
if
(
isAdInit
.
get
())
{
// com.base.browserwhite.ads.max.AdMaxOpenUtils.loadAppOpenAd(activity)
AdMaxInterstitialUtils
.
loadInterstitialAd
(
activity
)
//
AdMaxInterstitialUtils.loadInterstitialAd(activity)
}
else
{
AdMaxInit
.
maxInitAction
=
{
//
AdMaxInit.maxInitAction = {
Log
.
d
(
TAG
,
"max init suc"
)
// com.base.browserwhite.ads.max.AdMaxOpenUtils.loadAppOpenAd(activity)
// com.base.browserwhite.ads.max.AdMaxInterstitialUtils.loadInterstitialAd(activity)
}
//
}
}
}
}
...
...
app/src/main/java/com/base/browserwhite/ads/max/AdMaxEvent.kt
View file @
c2ab1805
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/browserwhite/ads/max/AdMaxInit.kt
View file @
c2ab1805
package
com.base.browserwhite.ads.max
import
android.content.Context
import
com.applovin.sdk.AppLovinMediationProvider
import
com.applovin.sdk.AppLovinSdk
import
com.applovin.sdk.AppLovinSdkInitializationConfiguration
import
com.base.browserwhite.ads.AdmobMaxHelper.isAdInit
import
com.base.browserwhite.help.EventUtils
import
com.base.browserwhite.utils.LogEx
import
java.util.concurrent.Executors
object
AdMaxInit
{
private
const
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.browserwhite.ads.max
//
//import android.content.Context
//import com.applovin.sdk.AppLovinMediationProvider
//import com.applovin.sdk.AppLovinSdk
//import com.applovin.sdk.AppLovinSdkInitializationConfiguration
//import com.base.browserwhite.ads.AdmobMaxHelper.isAdInit
//import com.base.browserwhite.help.EventUtils
//import com.base.browserwhite.utils.LogEx
//import java.util.concurrent.Executors
//
//object AdMaxInit {
//
// private const 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/browserwhite/ads/max/AdMaxInterstitialUtils.kt
View file @
c2ab1805
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/browserwhite/ads/max/AdMaxNativeUtils.kt
View file @
c2ab1805
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/browserwhite/ads/max/AdMaxOpenUtils.kt
View file @
c2ab1805
This diff is collapsed.
Click to expand it.
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