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
f3a9d15e
Commit
f3a9d15e
authored
Oct 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
c3417193
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
3 deletions
+25
-3
AdmobHelper.kt
...in/java/com/base/pdfviewerscannerwhite/ads/AdmobHelper.kt
+10
-0
AdmobInterstitialUtils.kt
...pdfviewerscannerwhite/ads/admob/AdmobInterstitialUtils.kt
+1
-0
AdmobNativeUtils.kt
.../base/pdfviewerscannerwhite/ads/admob/AdmobNativeUtils.kt
+2
-0
AdmobOpenUtils.kt
...om/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
+4
-0
PdfActivity.kt
...base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
+2
-1
DocumentPageFragment.kt
...ase/pdfviewerscannerwhite/ui/main/DocumentPageFragment.kt
+4
-1
DialogView.kt
...java/com/base/pdfviewerscannerwhite/ui/view/DialogView.kt
+2
-1
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ads/AdmobHelper.kt
View file @
f3a9d15e
...
@@ -131,5 +131,15 @@ object AdmobHelper {
...
@@ -131,5 +131,15 @@ object AdmobHelper {
return
System
.
currentTimeMillis
()
-
lastCloseDocumentShowAd
>
interval
*
1000L
return
System
.
currentTimeMillis
()
-
lastCloseDocumentShowAd
>
interval
*
1000L
}
}
fun
isShowCloseDocument
():
Boolean
{
val
status
=
AppPreferences
.
getInstance
().
getString
(
"close_document_ad_show"
,
"0"
).
toInt
()
return
status
==
1
}
fun
isShowRvNativeAd
():
Boolean
{
val
status
=
AppPreferences
.
getInstance
().
getString
(
"rv_native_ad_show"
,
"0"
).
toInt
()
return
status
==
1
}
}
}
\ No newline at end of file
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobInterstitialUtils.kt
View file @
f3a9d15e
...
@@ -112,6 +112,7 @@ object AdmobInterstitialUtils {
...
@@ -112,6 +112,7 @@ object AdmobInterstitialUtils {
interLoadTime
=
System
.
currentTimeMillis
()
interLoadTime
=
System
.
currentTimeMillis
()
pullAd
(
ad
.
responseInfo
,
"interAd"
,
reqId
=
reqId
)
pullAd
(
ad
.
responseInfo
,
"interAd"
,
reqId
=
reqId
)
ad
.
onPaidEventListener
=
AdmobEvent
.
EventOnPaidEventListener
(
ad
)
ad
.
onPaidEventListener
=
AdmobEvent
.
EventOnPaidEventListener
(
ad
)
AdDisplayUtils
.
incrementInterRequestCount
()
}
}
})
})
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobNativeUtils.kt
View file @
f3a9d15e
...
@@ -66,10 +66,12 @@ object AdmobNativeUtils {
...
@@ -66,10 +66,12 @@ object AdmobNativeUtils {
super
.
onAdLoaded
()
super
.
onAdLoaded
()
onAdLoaded
?.
invoke
()
onAdLoaded
?.
invoke
()
onAdLoaded
=
null
onAdLoaded
=
null
AdDisplayUtils
.
incrementNativeRequestCount
()
}
}
override
fun
onAdClicked
()
{
override
fun
onAdClicked
()
{
clickAd
(
nativeAd
?.
responseInfo
,
"nativeAd"
)
clickAd
(
nativeAd
?.
responseInfo
,
"nativeAd"
)
AdDisplayUtils
.
incrementNativeClickCount
()
}
}
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
View file @
f3a9d15e
...
@@ -57,6 +57,7 @@ object AdmobOpenUtils {
...
@@ -57,6 +57,7 @@ object AdmobOpenUtils {
onLoad
?.
invoke
(
true
)
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
)
AdDisplayUtils
.
incrementOpenRequestCount
()
}
}
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
p0
:
LoadAdError
)
{
...
@@ -108,6 +109,7 @@ object AdmobOpenUtils {
...
@@ -108,6 +109,7 @@ object AdmobOpenUtils {
thisMOpenAd
?.
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
thisMOpenAd
?.
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
override
fun
onAdClicked
()
{
override
fun
onAdClicked
()
{
clickAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
)
clickAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
)
AdDisplayUtils
.
incrementClickShow
()
}
}
override
fun
onAdDismissedFullScreenContent
()
{
override
fun
onAdDismissedFullScreenContent
()
{
...
@@ -129,6 +131,8 @@ object AdmobOpenUtils {
...
@@ -129,6 +131,8 @@ object AdmobOpenUtils {
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
showBefore
?.
invoke
(
true
)
showBefore
?.
invoke
(
true
)
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
AdDisplayUtils
.
incrementOpenShow
()
}
}
}
}
thisMOpenAd
?.
show
(
activity
)
thisMOpenAd
?.
show
(
activity
)
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
View file @
f3a9d15e
...
@@ -26,6 +26,7 @@ import com.artifex.mupdfdemo.SearchTask
...
@@ -26,6 +26,7 @@ import com.artifex.mupdfdemo.SearchTask
import
com.artifex.mupdfdemo.SearchTaskResult
import
com.artifex.mupdfdemo.SearchTaskResult
import
com.base.pdfviewerscannerwhite.R
import
com.base.pdfviewerscannerwhite.R
import
com.base.pdfviewerscannerwhite.ads.AdmobHelper
import
com.base.pdfviewerscannerwhite.ads.AdmobHelper
import
com.base.pdfviewerscannerwhite.ads.AdmobHelper.isShowCloseDocument
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobInterstitialUtils
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobInterstitialUtils
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobNativeUtils
import
com.base.pdfviewerscannerwhite.ads.admob.AdmobNativeUtils
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_SAVE_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_SAVE_PDF
...
@@ -166,7 +167,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
...
@@ -166,7 +167,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
return
@addCallback
return
@addCallback
}
}
if
(
AdmobHelper
.
isShowCloseDocumentInter
())
{
if
(
AdmobHelper
.
isShowCloseDocumentInter
()
&&
isShowCloseDocument
()
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
this
@PdfActivity
)
{
AdmobInterstitialUtils
.
showInterstitialAd
(
this
@PdfActivity
)
{
if
(
it
)
{
if
(
it
)
{
AdmobHelper
.
lastCloseDocumentShowAd
=
System
.
currentTimeMillis
()
AdmobHelper
.
lastCloseDocumentShowAd
=
System
.
currentTimeMillis
()
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/DocumentPageFragment.kt
View file @
f3a9d15e
...
@@ -83,8 +83,11 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
...
@@ -83,8 +83,11 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
binding
.
flAd
.
visibility
=
View
.
VISIBLE
binding
.
flAd
.
visibility
=
View
.
VISIBLE
AdmobNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
,
R
.
layout
.
layout_admob_document
)
AdmobNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
,
R
.
layout
.
layout_admob_document
)
}
else
{
}
else
{
binding
.
flAd
.
visibility
=
View
.
GONE
binding
.
flAd
.
visibility
=
View
.
GONE
arrayList
.
add
(
1
,
DocumentBean
().
apply
{
isAd
=
true
})
if
(
AdmobHelper
.
isShowRvNativeAd
())
{
arrayList
.
add
(
1
,
DocumentBean
().
apply
{
isAd
=
true
})
}
}
}
adapter
.
submitList
(
arrayList
)
adapter
.
submitList
(
arrayList
)
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/view/DialogView.kt
View file @
f3a9d15e
...
@@ -57,6 +57,7 @@ import com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatSize
...
@@ -57,6 +57,7 @@ import com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatSize
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime2
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime2
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime3
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime3
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime4
import
com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatTime4
import
com.base.pdfviewerscannerwhite.utils.PermissionUtils.checkNotificationPermission
import
com.base.pdfviewerscannerwhite.utils.PermissionUtils.requestStoragePermission
import
com.base.pdfviewerscannerwhite.utils.PermissionUtils.requestStoragePermission
import
com.base.pdfviewerscannerwhite.utils.SpStringUtils
import
com.base.pdfviewerscannerwhite.utils.SpStringUtils
import
com.base.pdfviewerscannerwhite.utils.SpStringUtils.LAST_VIEW_KEY
import
com.base.pdfviewerscannerwhite.utils.SpStringUtils.LAST_VIEW_KEY
...
@@ -495,7 +496,7 @@ object DialogView {
...
@@ -495,7 +496,7 @@ object DialogView {
fun
Activity
.
showNotificationDialog
(
launcher
:
ActivityLauncher
)
{
fun
Activity
.
showNotificationDialog
(
launcher
:
ActivityLauncher
)
{
//
if (checkNotificationPermission()) return
if
(
checkNotificationPermission
())
return
val
dialog
=
AlertDialog
.
Builder
(
this
).
create
()
val
dialog
=
AlertDialog
.
Builder
(
this
).
create
()
val
binding
=
DialogNotificationEnableBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
val
binding
=
DialogNotificationEnableBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
...
...
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