Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
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
swiftcleanerphonehelper
Commits
1220ff27
Commit
1220ff27
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e053855e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
25 deletions
+26
-25
MainActivity.java
.../main/java/com/swiftcleaner/chovey/view/MainActivity.java
+12
-12
CustomScoreDialog.java
...om/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
+1
-0
AdmobHelper.kt
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
+10
-9
PermanentNotifyService.kt
...rc/main/java/com/zxdemo/service/PermanentNotifyService.kt
+3
-4
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/MainActivity.java
View file @
1220ff27
...
...
@@ -79,18 +79,18 @@ public class MainActivity extends AppCompatActivity {
});
});
binding
.
ivSetting
.
setOnClickListener
(
v
->
{
AdmobHelper
.
INSTANCE
.
showInterstitialAd
(
this
,
()
->
{
// AdmobHelper.INSTANCE.showInterstitialAd(this, () -> {
// initSetting();
// return null;
// },
// () -> {
// return null;
// },
// () -> {
// initSetting();
// return null;
// });
initSetting
();
return
null
;
},
()
->
{
return
null
;
},
()
->
{
initSetting
();
return
null
;
});
});
binding
.
cl3CleanJunk
.
setOnClickListener
(
v
->
{
...
...
app/src/main/java/com/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
View file @
1220ff27
...
...
@@ -35,6 +35,7 @@ public class CustomScoreDialog extends Dialog {
NativeView
nativeView
=
findViewById
(
R
.
id
.
fl_ad
);
AdmobHelper
.
INSTANCE
.
showNativeAd
(
activity
,
(
nativeAd
)
->
{
nativeView
.
removeAllViews
();
nativeView
.
setNativeAd
(
nativeAd
,
R
.
layout
.
layout_ad_native
);
return
null
;
},
null
,
null
);
...
...
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
View file @
1220ff27
...
...
@@ -547,33 +547,34 @@ object AdmobHelper {
maxCompleted
:
((
nativeAdLoader
:
MaxNativeAdLoader
,
nativeMaxAd
:
MaxAd
)
->
Unit
)?
=
null
,
failed
:
(()
->
Unit
?)?
=
null
)
{
if
(!
isShowAdNative
()
||
isBlacklist
())
{
failed
?.
invoke
()
return
}
Log
.
d
(
TAG
,
"native Ad load.
"
)
//
if (!isShowAdNative() || isBlacklist()) {
//
failed?.invoke()
//
return
//
}
Log
.
e
(
TAG
,
"showNativeAd
"
)
if
(
useAdmob
)
{
var
nativeAd
:
NativeAd
?
=
null
val
adLoader
=
AdLoader
.
Builder
(
activity
,
NATIVE_AD_UNIT_ID
)
.
forNativeAd
{
ad
:
NativeAd
->
completed
?.
invoke
(
ad
)
Log
.
e
(
TAG
,
"forNativeAd"
)
ReportAdUtils
.
showAd
(
ad
.
responseInfo
,
NATIVE_AD_UNIT
,
activity
)
ad
.
setOnPaidEventListener
(
ReportAdUtils
.
EventOnPaidEventListener
(
ad
))
nativeAd
=
ad
completed
?.
invoke
(
ad
)
}
.
withAdListener
(
object
:
AdListener
()
{
override
fun
onAdClicked
()
{
Log
.
d
(
TAG
,
"native Ad clicked."
)
Log
.
e
(
TAG
,
"native Ad clicked."
)
ReportAdUtils
.
clickAd
(
nativeAd
?.
responseInfo
,
NATIVE_AD_UNIT
)
}
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
Log
.
d
(
TAG
,
"native Ad failed to load. ${loadAdError.message}"
)
Log
.
e
(
TAG
,
"native Ad failed to load. ${loadAdError.message}"
)
failed
?.
invoke
()
}
override
fun
onAdLoaded
()
{
Log
.
d
(
TAG
,
"native Ad loaded."
)
Log
.
e
(
TAG
,
"native Ad loaded."
)
}
})
.
withNativeAdOptions
(
NativeAdOptions
.
Builder
().
build
())
...
...
app/src/main/java/com/zxdemo/service/PermanentNotifyService.kt
View file @
1220ff27
...
...
@@ -20,7 +20,6 @@ import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_APP_MANAGER
import
com.swiftcleaner.chovey.model.bean.Global.FUNCTION_BATTERY
import
com.swiftcleaner.chovey.model.bean.Global.FUNCTION_CLEAN
import
com.swiftcleaner.chovey.model.bean.Global.FUNCTION_LARGE_FILE
import
com.swiftcleaner.chovey.view.MainActivity
import
com.swiftcleaner.chovey.view.activity.StartActivity
class
PermanentNotifyService
:
Service
()
{
...
...
@@ -31,9 +30,9 @@ class PermanentNotifyService : Service() {
var
isRunning
=
false
fun
Context
.
startOmgNotification
()
{
val
intent
=
Intent
(
this
,
PermanentNotifyService
::
class
.
java
)
//
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
//
return
//
}
if
(
Build
.
VERSION
.
SDK_INT
>
Build
.
VERSION_CODES
.
TIRAMISU
)
{
return
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
startForegroundService
(
intent
)
...
...
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