Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White ago
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
kuxulei
PDF Viewer Scanner White ago
Commits
b098b9ca
Commit
b098b9ca
authored
Oct 10, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
bc34ac4c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
AdmobOpenUtils.kt
...om/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
+5
-5
SplashActivity.kt
...om/base/pdfviewerscannerwhite/ui/splash/SplashActivity.kt
+21
-14
UmpUtils.kt
...ain/java/com/base/pdfviewerscannerwhite/utils/UmpUtils.kt
+4
-4
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
View file @
b098b9ca
...
@@ -30,14 +30,14 @@ object AdmobOpenUtils {
...
@@ -30,14 +30,14 @@ object AdmobOpenUtils {
}
}
fun
loadAppOpenAd
(
onLoad
:
((
where
:
Int
)
->
Unit
)?
=
null
)
{
fun
loadAppOpenAd
(
onLoad
:
((
loaded
:
Boolean
)
->
Unit
)?
=
null
)
{
if
(
mOpenAd
!=
null
)
{
if
(
mOpenAd
!=
null
)
{
onLoad
?.
invoke
(
1
)
onLoad
?.
invoke
(
false
)
return
return
}
}
if
(!
AdDisplayUtils
.
shouldShowOpenAd
())
{
if
(!
AdDisplayUtils
.
shouldShowOpenAd
())
{
onLoad
?.
invoke
(
2
)
onLoad
?.
invoke
(
false
)
return
return
}
}
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
...
@@ -54,7 +54,7 @@ object AdmobOpenUtils {
...
@@ -54,7 +54,7 @@ object AdmobOpenUtils {
LogEx
.
logDebug
(
TAG
,
"onAdLoaded"
)
LogEx
.
logDebug
(
TAG
,
"onAdLoaded"
)
openLoadTime
=
System
.
currentTimeMillis
()
openLoadTime
=
System
.
currentTimeMillis
()
mOpenAd
=
ad
mOpenAd
=
ad
onLoad
?.
invoke
(
3
)
onLoad
?.
invoke
(
true
)
pullAd
(
ad
.
responseInfo
,
"openAd"
,
reqId
=
reqId
)
pullAd
(
ad
.
responseInfo
,
"openAd"
,
reqId
=
reqId
)
ad
.
onPaidEventListener
=
AdmobEvent
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
AdmobEvent
.
EventOnPaidEventListener
(
ad
)
}
}
...
@@ -62,7 +62,7 @@ object AdmobOpenUtils {
...
@@ -62,7 +62,7 @@ object AdmobOpenUtils {
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
LogEx
.
logDebug
(
TAG
,
"LoadAdError ${p0.message}"
)
LogEx
.
logDebug
(
TAG
,
"LoadAdError ${p0.message}"
)
mOpenAd
=
null
mOpenAd
=
null
onLoad
?.
invoke
(
4
)
onLoad
?.
invoke
(
false
)
pullAd
(
p0
.
responseInfo
,
"openAd"
,
p0
.
message
,
reqId
=
reqId
)
pullAd
(
p0
.
responseInfo
,
"openAd"
,
p0
.
message
,
reqId
=
reqId
)
}
}
})
})
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/splash/SplashActivity.kt
View file @
b098b9ca
...
@@ -52,7 +52,7 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
...
@@ -52,7 +52,7 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
)
)
}
}
splashPresenter
=
SplashPresenter
(
this
)
splashPresenter
=
SplashPresenter
(
this
)
startStayNotification
()
// 获取当前日期
// 获取当前日期
val
calendar
:
Calendar
=
Calendar
.
getInstance
()
val
calendar
:
Calendar
=
Calendar
.
getInstance
()
...
@@ -103,7 +103,7 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
...
@@ -103,7 +103,7 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
agreePrivacy
()
agreePrivacy
()
}
else
{
}
else
{
UmpUtils
.
callback
=
{
UmpUtils
.
callback
=
{
LogEx
.
logDebug
(
TAG
,
"UmpUtils.callback"
)
LogEx
.
logDebug
(
TAG
,
"UmpUtils.callback
$it
"
)
umpCanAd
=
it
umpCanAd
=
it
agreePrivacy
()
agreePrivacy
()
}
}
...
@@ -114,7 +114,10 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
...
@@ -114,7 +114,10 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
override
fun
showAd
()
{
override
fun
showAd
()
{
AdmobOpenUtils
.
loadAppOpenAd
{
LogEx
.
logDebug
(
TAG
,
"showAd"
)
AdmobOpenUtils
.
loadAppOpenAd
{
loaded
->
LogEx
.
logDebug
(
TAG
,
"loadAppOpenAd loaded=$loaded"
)
if
(
loaded
)
{
AdmobOpenUtils
.
showAppOpenAd
(
this
,
showBefore
=
{
AdmobOpenUtils
.
showAppOpenAd
(
this
,
showBefore
=
{
if
(
it
)
{
if
(
it
)
{
splashPresenter
.
pauseJumpJob
()
splashPresenter
.
pauseJumpJob
()
...
@@ -123,18 +126,22 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
...
@@ -123,18 +126,22 @@ class SplashActivity : BaseActivity<ActivitySplash2Binding>(), SplashView {
LogEx
.
logDebug
(
TAG
,
"ad jumpNext"
)
LogEx
.
logDebug
(
TAG
,
"ad jumpNext"
)
jumpNext
()
jumpNext
()
})
})
}
else
{
LogEx
.
logDebug
(
TAG
,
"no load ad jumpNext"
)
jumpNext
()
}
}
}
}
}
override
fun
agreePrivacy
()
{
override
fun
agreePrivacy
()
{
startStayNotification
()
if
(
umpCanAd
)
{
if
(
umpCanAd
)
{
initAdmobAd
()
initAdmobAd
()
showAd
()
showAd
()
}
splashPresenter
.
startJumpJob
=
true
splashPresenter
.
startJumpJob
=
true
splashPresenter
.
startJumpJob
(
lifecycleScope
)
splashPresenter
.
startJumpJob
(
lifecycleScope
)
}
else
{
jumpNext
()
}
}
}
override
fun
onPause
()
{
override
fun
onPause
()
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/utils/UmpUtils.kt
View file @
b098b9ca
...
@@ -27,7 +27,7 @@ object UmpUtils {
...
@@ -27,7 +27,7 @@ object UmpUtils {
return
debugSettings
.
build
()
return
debugSettings
.
build
()
}
}
var
callback
:
((
flag
:
Boolean
)
->
Unit
)?
=
null
var
callback
:
((
canAd
:
Boolean
)
->
Unit
)?
=
null
private
val
TAG
=
"UmpUtils"
private
val
TAG
=
"UmpUtils"
...
@@ -59,13 +59,13 @@ object UmpUtils {
...
@@ -59,13 +59,13 @@ object UmpUtils {
loadAndShowConsentFormIfRequired
(
activity
,
consentInformation
)
loadAndShowConsentFormIfRequired
(
activity
,
consentInformation
)
}
}
}
else
{
}
else
{
callback
?.
invoke
(
fals
e
)
callback
?.
invoke
(
tru
e
)
callback
=
null
callback
=
null
}
}
}
}
val
updateFailureListener
=
ConsentInformation
.
OnConsentInfoUpdateFailureListener
{
val
updateFailureListener
=
ConsentInformation
.
OnConsentInfoUpdateFailureListener
{
LogEx
.
logDebug
(
TAG
,
"message=${it.message} errorCode=${it.errorCode}"
)
LogEx
.
logDebug
(
TAG
,
"message=${it.message} errorCode=${it.errorCode}"
)
callback
?.
invoke
(
fals
e
)
callback
?.
invoke
(
tru
e
)
callback
=
null
callback
=
null
}
}
...
@@ -90,7 +90,7 @@ object UmpUtils {
...
@@ -90,7 +90,7 @@ object UmpUtils {
override
fun
onConsentFormLoadFailure
(
p0
:
FormError
)
{
override
fun
onConsentFormLoadFailure
(
p0
:
FormError
)
{
//https://groups.google.com/g/google-admob-ads-sdk/c/x-fyDOfMSqU/m/MeZX3mO4AAAJ
//https://groups.google.com/g/google-admob-ads-sdk/c/x-fyDOfMSqU/m/MeZX3mO4AAAJ
LogEx
.
logDebug
(
TAG
,
"onConsentFormLoadFailure ${p0.message} ${p0.errorCode}"
)
LogEx
.
logDebug
(
TAG
,
"onConsentFormLoadFailure ${p0.message} ${p0.errorCode}"
)
callback
?.
invoke
(
consentInformation
.
canRequestAds
()
)
callback
?.
invoke
(
true
)
callback
=
null
callback
=
null
}
}
})
})
...
...
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