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
b75e9002
Commit
b75e9002
authored
Jul 17, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
max广告
parent
eb1ce437
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
39 deletions
+59
-39
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+32
-1
SplashActivity.kt
...om/base/filerecoveryrecyclebin/activity/SplashActivity.kt
+7
-20
FileRecoveryActivity.kt
...overyrecyclebin/activity/recovery/FileRecoveryActivity.kt
+6
-4
AdmobOpenUtils.kt
...m/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
+1
-0
AdMaxInterstitialUtils.kt
.../filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
+3
-3
AdMaxOpenUtils.kt
...com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
+4
-5
HomeFragment.kt
.../com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
+2
-5
InstallHelps.kt
...ava/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
+3
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
b75e9002
...
...
@@ -4,8 +4,10 @@ import android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Intent
import
android.os.Bundle
import
android.text.TextUtils
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxInit.initAdMax
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ifAgreePrivacy
import
com.base.filerecoveryrecyclebin.fcm.FCMManager
import
com.base.filerecoveryrecyclebin.fcm.RecoveryTimerManager
...
...
@@ -18,10 +20,17 @@ import com.base.filerecoveryrecyclebin.utils.InstallHelps
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.NewComUtils
import
com.google.android.gms.ads.MobileAds
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.async
import
kotlinx.coroutines.launch
import
java.util.UUID
class
MyApplication
:
BaseApplication
()
{
private
val
TAG
=
"MyApplication"
var
uuid
=
""
companion
object
{
@JvmField
...
...
@@ -29,9 +38,18 @@ class MyApplication : BaseApplication() {
}
override
fun
init
()
{
initUUid
()
initApp
()
}
private
fun
initUUid
()
{
uuid
=
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
)
if
(
TextUtils
.
isEmpty
(
uuid
))
{
uuid
=
UUID
.
randomUUID
().
toString
()
+
System
.
currentTimeMillis
()
AppPreferences
.
getInstance
().
put
(
"uuid"
,
uuid
)
}
}
fun
initApp
()
{
val
topic
=
ConfigHelper
.
packageName
+
"_push"
FCMManager
.
initFirebase
(
this
)
...
...
@@ -53,8 +71,8 @@ class MyApplication : BaseApplication() {
}
}
}
InstallHelps
.
init
()
if
(
ifAgreePrivacy
)
{
InstallHelps
.
init
()
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
MobileAds
.
initialize
(
this
)
{
initializationStatus
->
...
...
@@ -63,6 +81,19 @@ class MyApplication : BaseApplication() {
initAdMax
()
}
MainScope
().
launch
(
Dispatchers
.
Main
)
{
val
deferred
=
async
(
Dispatchers
.
IO
)
{
try
{
AdvertisingIdClient
.
getAdvertisingIdInfo
(
context
).
id
}
catch
(
_
:
Exception
)
{
"unknown"
}
}
val
gid
=
deferred
.
await
()
?:
""
AppPreferences
.
getInstance
().
put
(
"gid"
,
gid
)
}
}
initLifeListener
()
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SplashActivity.kt
View file @
b75e9002
...
...
@@ -16,6 +16,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobInterstitialUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobOpenUtils
...
...
@@ -228,27 +229,13 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
private
fun
outTimeAd
()
{
LogEx
.
logDebug
(
TAG
,
"outTimeAd"
)
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobOpenUtils
.
loadAppOpenAd
{
LogEx
.
logDebug
(
TAG
,
"load where=$it"
)
job
?.
cancel
()
AdmobOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
)
{
LogEx
.
logDebug
(
TAG
,
"adCallBack=$it"
)
binding
.
pb
.
progress
=
100
jumpNext
()
}
}
}
else
{
AdMaxOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
,
loaded
=
{
job
?.
cancel
()
},
onHidden
=
{
binding
.
pb
.
progress
=
100
jumpNext
()
})
}
AdmobMaxHelper
.
admobMaxShowOpenAd
(
this
,
showBeforeAction
=
{
job
?.
cancel
()
},
onHidden
=
{
binding
.
pb
.
progress
=
100
jumpNext
()
})
}
override
fun
onResume
()
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/recovery/FileRecoveryActivity.kt
View file @
b75e9002
...
...
@@ -75,10 +75,12 @@ class FileRecoveryActivity : BaseActivity<ActivityFileRecoveryBinding>() {
SCAN_PHOTOS
->
{
var
size
=
0
folderBean
?.
recoveryList
?.
forEach
{
val
bitmap
=
BitmapFactory
.
decodeFile
(
it
.
path
)
if
(
bitmap
.
height
<
256
||
bitmap
.
width
<
256
)
{
size
++
it
.
isThumbnails
=
true
runCatching
{
val
bitmap
=
BitmapFactory
.
decodeFile
(
it
.
path
)
if
(
bitmap
.
height
<
256
||
bitmap
.
width
<
256
)
{
size
++
it
.
isThumbnails
=
true
}
}
}
binding
.
tvThumbnails
.
text
=
"Hide thumbnails (${size})"
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/admob/AdmobOpenUtils.kt
View file @
b75e9002
...
...
@@ -114,6 +114,7 @@ object AdmobOpenUtils {
}
override
fun
onAdShowedFullScreenContent
()
{
showBefore
?.
invoke
()
showAd
(
thisMOpenAd
?.
responseInfo
,
"openAd"
,
activity
)
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxInterstitialUtils.kt
View file @
b75e9002
...
...
@@ -150,13 +150,13 @@ object AdMaxInterstitialUtils {
}
fun
loadInterstitialAd
(
activity
:
Activity
)
{
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
return
}
setListener
(
activity
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
return
}
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"loadInterstitialAd"
)
interstitialAd
?.
loadAd
()
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/ads/max/AdMaxOpenUtils.kt
View file @
b75e9002
package
com.base.filerecoveryrecyclebin.ads.max
import
android.app.Activity
import
android.content.Context
import
com.applovin.mediation.MaxAd
...
...
@@ -128,18 +129,16 @@ object AdMaxOpenUtils {
}
fun
loadAppOpenAd
(
activity
:
Activity
)
{
setListener
(
activity
)
if
(!
AdDisplayUtils
.
getInstance
().
shouldShowAd
())
{
LogEx
.
logDebug
(
TAG
,
"!shouldShowAd"
)
return
}
setListener
(
activity
)
LogEx
.
logDebug
(
TAG
,
"loadAppOpenAd1"
)
if
(
AdMaxInit
.
isAdMaxInit
.
get
())
{
LogEx
.
logDebug
(
TAG
,
"
loadAppOpenAd2
"
)
LogEx
.
logDebug
(
TAG
,
"
appOpenAd load
"
)
appOpenAd
?.
loadAd
()
}
else
{
LogEx
.
logDebug
(
TAG
,
"loadAppOpenAd3"
)
}
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/HomeFragment.kt
View file @
b75e9002
...
...
@@ -13,6 +13,7 @@ import com.base.filerecoveryrecyclebin.activity.privacyspace.PrivacySpaceActivit
import
com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import
com.base.filerecoveryrecyclebin.activity.repeat.RepeatAnimationActivity
import
com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.ads.admob.AdmobNativeUtils
import
com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import
com.base.filerecoveryrecyclebin.bean.ConstObject.SCAN_DOCUMENTS
...
...
@@ -33,11 +34,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override
fun
setView
()
{
animatorSet
=
createHeartbeatAnimation
(
binding
.
flScan
)
if
(
ConfigHelper
.
admobTrueMaxFlase
)
{
AdmobNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
)
}
else
{
AdMaxNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
)
}
AdmobMaxHelper
.
admobMaxShowNativeAd
(
requireActivity
(),
binding
.
flAd
,
0
)
}
override
fun
setListener
()
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/utils/InstallHelps.kt
View file @
b75e9002
...
...
@@ -5,6 +5,9 @@ import com.android.installreferrer.api.InstallReferrerStateListener
import
com.base.filerecoveryrecyclebin.help.BaseApplication
import
org.json.JSONObject
/**
* call before agree
*/
object
InstallHelps
{
fun
init
()
{
val
referrerClient
=
InstallReferrerClient
.
newBuilder
(
BaseApplication
.
context
).
build
()
...
...
app/src/main/res/values/strings.xml
View file @
b75e9002
<resources>
<string
name=
"app_name"
>
File Recovery
&
RecycleBin
</string>
<string
name=
"app_name"
>
Photo/Video Recovery
</string>
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"facebook_app_id"
>
1141667540450666
</string>
...
...
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