Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner 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
PDF Viewer Scanner White
Commits
eacf3173
Commit
eacf3173
authored
Oct 08, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
4bcf42c8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
307 deletions
+235
-307
AdDisplayUtils.kt
...java/com/base/pdfviewerscannerwhite/ads/AdDisplayUtils.kt
+175
-251
FirebaseDatabase.kt
...va/com/base/pdfviewerscannerwhite/ads/FirebaseDatabase.kt
+52
-48
AdmobInterstitialUtils.kt
...pdfviewerscannerwhite/ads/admob/AdmobInterstitialUtils.kt
+4
-4
AdmobNativeUtils.kt
.../base/pdfviewerscannerwhite/ads/admob/AdmobNativeUtils.kt
+2
-2
AdmobOpenUtils.kt
...om/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
+2
-2
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ads/AdDisplayUtils.kt
View file @
eacf3173
This diff is collapsed.
Click to expand it.
app/src/main/java/com/base/pdfviewerscannerwhite/ads/FirebaseDatabase.kt
View file @
eacf3173
package
com.base.pdfviewerscannerwhite.ads
package
com.base.pdfviewerscannerwhite.ads
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.google.firebase.database.DataSnapshot
import
com.google.firebase.database.DataSnapshot
import
com.google.firebase.database.DatabaseError
import
com.google.firebase.database.DatabaseError
...
@@ -27,7 +28,7 @@ object FirebaseDatabase {
...
@@ -27,7 +28,7 @@ object FirebaseDatabase {
const
val
inter_limit_show
=
"inter_limit_show"
const
val
inter_limit_show
=
"inter_limit_show"
const
val
inter_limit_click
=
"inter_limit_click"
const
val
inter_limit_click
=
"inter_limit_click"
//原生广告
现在
//原生广告
限制
const
val
native_limit_request
=
"native_limit_request"
const
val
native_limit_request
=
"native_limit_request"
const
val
native_limit_show
=
"native_limit_show"
const
val
native_limit_show
=
"native_limit_show"
const
val
native_limit_click
=
"native_limit_click"
const
val
native_limit_click
=
"native_limit_click"
...
@@ -90,60 +91,63 @@ object FirebaseDatabase {
...
@@ -90,60 +91,63 @@ object FirebaseDatabase {
//可请求时间段间隔时间
//可请求时间段间隔时间
const
val
ad_request_period_interval
=
"ad_request_period_interval"
const
val
ad_request_period_interval
=
"ad_request_period_interval"
fun
saveDatabase2Sp
()
{
fun
saveDatabase2Sp
()
{
add
(
open_limit_request
,
"15"
)
//
add(open_limit_request, "15")
add
(
open_limit_show
,
"10"
)
//
add(open_limit_show, "10")
add
(
open_limit_click
,
"1"
)
//
add(open_limit_click, "1")
//
//
add
(
inter_limit_request
,
"15"
)
//
add(inter_limit_request, "15")
add
(
inter_limit_show
,
"10"
)
//
add(inter_limit_show, "10")
add
(
inter_limit_click
,
"1"
)
//
add(inter_limit_click, "1")
//
add
(
native_limit_request
,
"15"
)
//
add(native_limit_request, "15")
add
(
native_limit_show
,
"10"
)
//
add(native_limit_show, "10")
add
(
native_limit_click
,
"1"
)
//
add(native_limit_click, "1")
//
add
(
popup_count
,
"0"
)
//
add(popup_count, "0")
add
(
popup_status
,
"1"
)
//
add(popup_status, "1")
//
add
(
popup_style1_start
,
"7"
)
//
add(popup_style1_start, "7")
add
(
popup_style1_end
,
"11"
)
//
add(popup_style1_end, "11")
add
(
popup_style1_count
,
"0"
)
//
add(popup_style1_count, "0")
add
(
popup_style1_status
,
"1"
)
//
add(popup_style1_status, "1")
add
(
popup_style1_interval
,
"120"
)
//
add(popup_style1_interval, "120")
//
add
(
popup_style2_start
,
"12"
)
//
add(popup_style2_start, "12")
add
(
popup_style2_end
,
"17"
)
//
add(popup_style2_end, "17")
add
(
popup_style2_count
,
"0"
)
//
add(popup_style2_count, "0")
add
(
popup_style2_status
,
"1"
)
//
add(popup_style2_status, "1")
add
(
popup_style2_interval
,
"120"
)
//
add(popup_style2_interval, "120")
//
add
(
popup_style3_start
,
"18"
)
//
add(popup_style3_start, "18")
add
(
popup_style3_end
,
"24"
)
//
add(popup_style3_end, "24")
add
(
popup_style3_count
,
"0"
)
//
add(popup_style3_count, "0")
add
(
popup_style3_status
,
"1"
)
//
add(popup_style3_status, "1")
add
(
popup_style3_interval
,
"120"
)
//
add(popup_style3_interval, "120")
//
add
(
showLanPage
,
"1"
)
//
add(showLanPage, "1")
//
add
(
open_ad_loading
,
"8000"
)
//
add(open_ad_loading, "8000")
add
(
create_pdf_loading
,
"8000"
)
//
add(create_pdf_loading, "8000")
add
(
delete_loading
,
"8000"
)
//
add(delete_loading, "8000")
add
(
open_file_loading
,
"8000"
)
//
add(open_file_loading, "8000")
add
(
merge_loading
,
"8000"
)
//
add(merge_loading, "8000")
add
(
split_loading
,
"8000"
)
//
add(split_loading, "8000")
//
add
(
ad_request_period
,
"1"
)
//
add(ad_request_period, "1")
add
(
ad_period_max_request
,
"10"
)
//
add(ad_period_max_request, "10")
add
(
ad_request_period_interval
,
"60"
)
//
add(ad_request_period_interval, "60")
rootRef
.
addListenerForSingleValueEvent
(
object
:
ValueEventListener
{
rootRef
.
addListenerForSingleValueEvent
(
object
:
ValueEventListener
{
override
fun
onDataChange
(
dataSnapshot
:
DataSnapshot
)
{
override
fun
onDataChange
(
dataSnapshot
:
DataSnapshot
)
{
var
i
=
0
for
(
snapshot
in
dataSnapshot
.
getChildren
())
{
for
(
snapshot
in
dataSnapshot
.
getChildren
())
{
val
key1
=
snapshot
.
key
val
key1
=
snapshot
.
key
val
value1
=
snapshot
.
value
val
value1
=
snapshot
.
value
LogEx
.
logDebug
(
"Database"
,
"Key: $key1, Value: $value1"
)
i
++
LogEx
.
logDebug
(
"Database"
,
"Key: $key1, Value: $value1 $i"
)
AppPreferences
.
getInstance
().
put
(
key1
,
value1
)
}
}
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobInterstitialUtils.kt
View file @
eacf3173
...
@@ -55,7 +55,7 @@ object AdmobInterstitialUtils {
...
@@ -55,7 +55,7 @@ object AdmobInterstitialUtils {
return
return
}
}
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"interAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowInterAd
(
))
{
onHidden
?.
invoke
(
false
)
onHidden
?.
invoke
(
false
)
return
return
}
}
...
@@ -79,7 +79,7 @@ object AdmobInterstitialUtils {
...
@@ -79,7 +79,7 @@ object AdmobInterstitialUtils {
onLoad
?.
invoke
()
onLoad
?.
invoke
()
return
return
}
}
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"interAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowInterAd
(
))
{
onLoad
?.
invoke
()
onLoad
?.
invoke
()
return
return
}
}
...
@@ -152,7 +152,7 @@ object AdmobInterstitialUtils {
...
@@ -152,7 +152,7 @@ object AdmobInterstitialUtils {
thisInterAd
?.
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
thisInterAd
?.
fullScreenContentCallback
=
object
:
FullScreenContentCallback
()
{
override
fun
onAdClicked
()
{
override
fun
onAdClicked
()
{
clickAd
(
thisInterAd
?.
responseInfo
,
"interAd"
)
clickAd
(
thisInterAd
?.
responseInfo
,
"interAd"
)
AdDisplayUtils
.
getInstance
().
increment
AdClickCount
()
AdDisplayUtils
.
incrementInter
AdClickCount
()
}
}
override
fun
onAdDismissedFullScreenContent
()
{
override
fun
onAdDismissedFullScreenContent
()
{
...
@@ -172,7 +172,7 @@ object AdmobInterstitialUtils {
...
@@ -172,7 +172,7 @@ object AdmobInterstitialUtils {
override
fun
onAdShowedFullScreenContent
()
{
override
fun
onAdShowedFullScreenContent
()
{
dialog
?.
dismiss
()
dialog
?.
dismiss
()
showAd
(
thisInterAd
?.
responseInfo
,
"interAd"
,
activity
)
showAd
(
thisInterAd
?.
responseInfo
,
"interAd"
,
activity
)
AdDisplayUtils
.
getInstance
().
increment
AdDisplayCount
()
AdDisplayUtils
.
incrementInter
AdDisplayCount
()
adLastDisplayTime
=
System
.
currentTimeMillis
()
/
1000
adLastDisplayTime
=
System
.
currentTimeMillis
()
/
1000
}
}
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobNativeUtils.kt
View file @
eacf3173
...
@@ -40,7 +40,7 @@ object AdmobNativeUtils {
...
@@ -40,7 +40,7 @@ object AdmobNativeUtils {
return
return
}
}
isLoading
=
true
isLoading
=
true
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"nativeAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowNative
(
))
{
return
return
}
}
...
@@ -88,7 +88,7 @@ object AdmobNativeUtils {
...
@@ -88,7 +88,7 @@ object AdmobNativeUtils {
val
obj
=
JSONObject
()
val
obj
=
JSONObject
()
obj
.
put
(
"ad_unit"
,
"NativeAd"
)
obj
.
put
(
"ad_unit"
,
"NativeAd"
)
EventUtils
.
event
(
"ad_prepare_show_native"
,
ext
=
obj
)
EventUtils
.
event
(
"ad_prepare_show_native"
,
ext
=
obj
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"nativeAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowNative
(
))
{
return
return
}
}
loadingListener
=
{
loadingListener
=
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ads/admob/AdmobOpenUtils.kt
View file @
eacf3173
...
@@ -32,7 +32,7 @@ object AdmobOpenUtils {
...
@@ -32,7 +32,7 @@ object AdmobOpenUtils {
onLoad
?.
invoke
(
1
)
onLoad
?.
invoke
(
1
)
return
return
}
}
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"openAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowOpenAd
(
))
{
onLoad
?.
invoke
(
2
)
onLoad
?.
invoke
(
2
)
return
return
}
}
...
@@ -75,7 +75,7 @@ object AdmobOpenUtils {
...
@@ -75,7 +75,7 @@ object AdmobOpenUtils {
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
{
return
return
}
}
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
(
"openAd"
))
{
if
(!
AdDisplayUtils
.
shouldShowOpenAd
(
))
{
onHidden
?.
invoke
(
false
)
onHidden
?.
invoke
(
false
)
return
return
}
}
...
...
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