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
3b62acf3
Commit
3b62acf3
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
05a2361e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
57 deletions
+63
-57
MainActivity.java
.../main/java/com/swiftcleaner/chovey/view/MainActivity.java
+2
-18
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+5
-5
CustomScoreDialog.java
...om/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
+17
-4
AdmobHelper.kt
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
+20
-18
NonBlockingCountdown.java
app/src/main/java/com/zxdemo/utils/NonBlockingCountdown.java
+1
-1
TimeOut.java
app/src/main/java/com/zxdemo/utils/TimeOut.java
+1
-1
dialog_function_exit_item.xml
app/src/main/res/layout/dialog_function_exit_item.xml
+17
-10
No files found.
app/src/main/java/com/swiftcleaner/chovey/view/MainActivity.java
View file @
3b62acf3
...
@@ -50,23 +50,6 @@ public class MainActivity extends AppCompatActivity {
...
@@ -50,23 +50,6 @@ public class MainActivity extends AppCompatActivity {
setContentView
(
view
);
setContentView
(
view
);
initBar
();
initBar
();
initShow
();
initShow
();
FirebaseMessaging
.
getInstance
().
getToken
()
.
addOnCompleteListener
(
new
OnCompleteListener
<
String
>()
{
@Override
public
void
onComplete
(
@NonNull
Task
<
String
>
task
)
{
if
(!
task
.
isSuccessful
())
{
Log
.
w
(
"TAG"
,
"Fetching FCM registration token failed"
,
task
.
getException
());
return
;
}
// Get new FCM registration token
String
token
=
task
.
getResult
();
// Log and toast
Log
.
d
(
"TAG"
,
token
);
Toast
.
makeText
(
MainActivity
.
this
,
token
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
}
}
private
void
initShow
()
{
private
void
initShow
()
{
...
@@ -283,7 +266,8 @@ public class MainActivity extends AppCompatActivity {
...
@@ -283,7 +266,8 @@ public class MainActivity extends AppCompatActivity {
Intent
intent
=
new
Intent
(
this
,
CleanJunkActivity
.
class
);
Intent
intent
=
new
Intent
(
this
,
CleanJunkActivity
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
}
}
private
void
initSetting
(){
private
void
initSetting
()
{
Intent
intent
=
new
Intent
(
this
,
SettingActivity
.
class
);
Intent
intent
=
new
Intent
(
this
,
SettingActivity
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
}
}
...
...
app/src/main/java/com/swiftcleaner/chovey/view/activity/StartActivity.java
View file @
3b62acf3
...
@@ -193,7 +193,7 @@ public class StartActivity extends AppCompatActivity {
...
@@ -193,7 +193,7 @@ public class StartActivity extends AppCompatActivity {
private
void
showOpenAd
()
{
private
void
showOpenAd
()
{
AdmobHelper
.
INSTANCE
.
showAppOpenAd
(
this
,
AdmobHelper
.
INSTANCE
.
showAppOpenAd
(
this
,
()
->
{
()
->
{
jumpNext
();
jumpNext
(
"showAppOpenAd 1"
);
return
null
;
return
null
;
},
},
()
->
{
()
->
{
...
@@ -202,7 +202,7 @@ public class StartActivity extends AppCompatActivity {
...
@@ -202,7 +202,7 @@ public class StartActivity extends AppCompatActivity {
return
null
;
return
null
;
},
},
()
->
{
()
->
{
jumpNext
();
jumpNext
(
"showAppOpenAd 2"
);
return
null
;
return
null
;
}
}
...
@@ -226,11 +226,11 @@ public class StartActivity extends AppCompatActivity {
...
@@ -226,11 +226,11 @@ public class StartActivity extends AppCompatActivity {
protected
void
onNewIntent
(
Intent
intent
)
{
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
super
.
onNewIntent
(
intent
);
Log
.
e
(
"jumpNext"
,
"onNewIntent jumped="
+
jumped
.
get
());
Log
.
e
(
"jumpNext"
,
"onNewIntent jumped="
+
jumped
.
get
());
jumpNext
();
jumpNext
(
"onNewIntent"
);
}
}
private
void
jumpNext
()
{
private
void
jumpNext
(
String
where
)
{
Log
.
e
(
"jumpNext"
,
"jumped="
+
jumped
.
get
());
Log
.
e
(
"jumpNext"
,
"jumped="
+
jumped
.
get
()
+
" where="
+
where
);
if
(
jumped
.
get
())
return
;
if
(
jumped
.
get
())
return
;
jumped
.
set
(
true
);
jumped
.
set
(
true
);
String
actionId
=
getIntent
().
getExtras
()
!=
null
?
getIntent
().
getExtras
().
getString
(
"actionId"
)
:
""
;
String
actionId
=
getIntent
().
getExtras
()
!=
null
?
getIntent
().
getExtras
().
getString
(
"actionId"
)
:
""
;
...
...
app/src/main/java/com/swiftcleaner/chovey/view/dialog/CustomScoreDialog.java
View file @
3b62acf3
package
com
.
swiftcleaner
.
chovey
.
view
.
dialog
;
package
com
.
swiftcleaner
.
chovey
.
view
.
dialog
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.graphics.Color
;
...
@@ -8,24 +9,36 @@ import androidx.appcompat.widget.AppCompatButton;
...
@@ -8,24 +9,36 @@ import androidx.appcompat.widget.AppCompatButton;
import
androidx.cardview.widget.CardView
;
import
androidx.cardview.widget.CardView
;
import
com.swiftcleaner.chovey.R
;
import
com.swiftcleaner.chovey.R
;
import
com.tool.zxdemo.utils.NativeView
;
import
com.zxdemo.admob.AdmobHelper
;
public
class
CustomScoreDialog
extends
Dialog
{
public
class
CustomScoreDialog
extends
Dialog
{
private
Context
context
;
private
Activity
activity
;
private
OnDialogClickListener
listener
;
private
OnDialogClickListener
listener
;
public
interface
OnDialogClickListener
{
public
interface
OnDialogClickListener
{
void
onCancel
();
void
onCancel
();
void
onSubmit
();
void
onSubmit
();
}
}
public
CustomScoreDialog
(
Context
context
)
{
super
(
context
,
R
.
style
.
TransparentDialogTheme
);
public
CustomScoreDialog
(
Activity
activity
)
{
this
.
context
=
context
;
super
(
activity
,
R
.
style
.
TransparentDialogTheme
);
this
.
activity
=
activity
;
setContentView
(
R
.
layout
.
dialog_function_exit_item
);
setContentView
(
R
.
layout
.
dialog_function_exit_item
);
AppCompatButton
dialog_cancel
=
findViewById
(
R
.
id
.
dialog_cancel
);
AppCompatButton
dialog_cancel
=
findViewById
(
R
.
id
.
dialog_cancel
);
AppCompatButton
dialog_ok
=
findViewById
(
R
.
id
.
dialog_ok
);
AppCompatButton
dialog_ok
=
findViewById
(
R
.
id
.
dialog_ok
);
CardView
cardView
=
findViewById
(
R
.
id
.
cardview
);
CardView
cardView
=
findViewById
(
R
.
id
.
cardview
);
cardView
.
setCardBackgroundColor
(
Color
.
TRANSPARENT
);
cardView
.
setCardBackgroundColor
(
Color
.
TRANSPARENT
);
NativeView
nativeView
=
findViewById
(
R
.
id
.
fl_ad
);
AdmobHelper
.
INSTANCE
.
showNativeAd
(
activity
,
(
nativeAd
)
->
{
nativeView
.
setNativeAd
(
nativeAd
,
R
.
layout
.
layout_ad_native
);
return
null
;
},
null
,
null
);
dialog_cancel
.
setOnClickListener
(
v
->
{
dialog_cancel
.
setOnClickListener
(
v
->
{
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
...
...
app/src/main/java/com/zxdemo/admob/AdmobHelper.kt
View file @
3b62acf3
...
@@ -150,14 +150,14 @@ object AdmobHelper {
...
@@ -150,14 +150,14 @@ object AdmobHelper {
loaded
:
(()
->
Unit
?)?
=
null
,
loaded
:
(()
->
Unit
?)?
=
null
,
failed
:
(()
->
Unit
?)?
=
null
,
failed
:
(()
->
Unit
?)?
=
null
,
)
{
)
{
if
(!
checkAvailable
(
APP_OPEN_AD_UNIT
,
true
))
{
//
if (!checkAvailable(APP_OPEN_AD_UNIT, true)) {
failed
?.
invoke
()
//
failed?.invoke()
return
//
return
}
//
}
if
(
isLoadingAppOpenAd
)
{
//
if (isLoadingAppOpenAd) {
failed
?.
invoke
()
//
failed?.invoke()
return
//
return
}
//
}
isLoadingAppOpenAd
=
true
isLoadingAppOpenAd
=
true
Log
.
d
(
TAG
,
"app open Ad load."
)
Log
.
d
(
TAG
,
"app open Ad load."
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
...
@@ -170,7 +170,7 @@ object AdmobHelper {
...
@@ -170,7 +170,7 @@ object AdmobHelper {
adRequest
,
adRequest
,
object
:
AppOpenAd
.
AppOpenAdLoadCallback
()
{
object
:
AppOpenAd
.
AppOpenAdLoadCallback
()
{
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
override
fun
onAdFailedToLoad
(
loadAdError
:
LoadAdError
)
{
Log
.
d
(
TAG
,
"app open failed to load: ${loadAdError.message}"
)
Log
.
e
(
TAG
,
"app open failed to load: ${loadAdError.message}"
)
failed
?.
invoke
()
failed
?.
invoke
()
ReportAdUtils
.
pullAd
(
ReportAdUtils
.
pullAd
(
loadAdError
.
responseInfo
,
loadAdError
.
responseInfo
,
...
@@ -182,7 +182,7 @@ object AdmobHelper {
...
@@ -182,7 +182,7 @@ object AdmobHelper {
}
}
override
fun
onAdLoaded
(
ad
:
AppOpenAd
)
{
override
fun
onAdLoaded
(
ad
:
AppOpenAd
)
{
Log
.
d
(
TAG
,
"app open Ad was loaded."
)
Log
.
e
(
TAG
,
"app open Ad was loaded."
)
appOpenAd
=
ad
appOpenAd
=
ad
appOpenAdLoadTime
=
System
.
currentTimeMillis
()
appOpenAdLoadTime
=
System
.
currentTimeMillis
()
loaded
?.
invoke
()
loaded
?.
invoke
()
...
@@ -243,10 +243,10 @@ object AdmobHelper {
...
@@ -243,10 +243,10 @@ object AdmobHelper {
failed
?.
invoke
()
failed
?.
invoke
()
return
return
}
}
if
(
isLoadingInterstitialAd
)
{
//
if (isLoadingInterstitialAd) {
failed
?.
invoke
()
//
failed?.invoke()
return
//
return
}
//
}
isLoadingInterstitialAd
=
true
isLoadingInterstitialAd
=
true
Log
.
d
(
TAG
,
"interstitial Ad load."
)
Log
.
d
(
TAG
,
"interstitial Ad load."
)
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
reqId
=
UUID
.
randomUUID
().
toString
()
...
@@ -334,10 +334,10 @@ object AdmobHelper {
...
@@ -334,10 +334,10 @@ object AdmobHelper {
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
return
if
(
activity
.
isFinishing
||
activity
.
isDestroyed
)
return
ReportAdUtils
.
showPrepareAd
(
APP_OPEN_AD_UNIT
)
ReportAdUtils
.
showPrepareAd
(
APP_OPEN_AD_UNIT
)
if
(!
checkAvailable
(
APP_OPEN_AD_UNIT
))
{
//
if (!checkAvailable(APP_OPEN_AD_UNIT)) {
failed
?.
invoke
()
//
failed?.invoke()
return
//
return
}
//
}
if
(!
isAppOpenAdAvailable
())
{
if
(!
isAppOpenAdAvailable
())
{
Log
.
d
(
TAG
,
"The app open ad is not ready yet."
)
Log
.
d
(
TAG
,
"The app open ad is not ready yet."
)
...
@@ -468,6 +468,8 @@ object AdmobHelper {
...
@@ -468,6 +468,8 @@ object AdmobHelper {
override
fun
onAdFailedToShowFullScreenContent
(
adError
:
AdError
)
{
override
fun
onAdFailedToShowFullScreenContent
(
adError
:
AdError
)
{
Log
.
d
(
TAG
,
"interstitial Ad failed to show: ${adError.message}"
)
Log
.
d
(
TAG
,
"interstitial Ad failed to show: ${adError.message}"
)
adDialog
?.
dismiss
()
adDialog
=
null
interstitialAd
=
null
interstitialAd
=
null
loadInterstitialAd
(
activity
)
loadInterstitialAd
(
activity
)
failed
?.
invoke
()
failed
?.
invoke
()
...
...
app/src/main/java/com/zxdemo/utils/NonBlockingCountdown.java
View file @
3b62acf3
...
@@ -23,7 +23,7 @@ public class NonBlockingCountdown {
...
@@ -23,7 +23,7 @@ public class NonBlockingCountdown {
}
else
{
}
else
{
// 倒计时结束,可以在这里做一些操作,比如通知用户
// 倒计时结束,可以在这里做一些操作,比如通知用户
handler
.
removeCallbacks
(
this
);
handler
.
removeCallbacks
(
this
);
timeOut
.
timeOut
();
timeOut
.
timeOut
(
"timeOut"
);
Log
.
e
(
"NonBlockingCountdown"
,
"timeOut"
);
Log
.
e
(
"NonBlockingCountdown"
,
"timeOut"
);
}
}
}
}
...
...
app/src/main/java/com/zxdemo/utils/TimeOut.java
View file @
3b62acf3
package
com
.
zxdemo
.
utils
;
package
com
.
zxdemo
.
utils
;
public
interface
TimeOut
{
public
interface
TimeOut
{
abstract
void
timeOut
();
abstract
void
timeOut
(
String
where
);
}
}
\ No newline at end of file
app/src/main/res/layout/dialog_function_exit_item.xml
View file @
3b62acf3
...
@@ -34,14 +34,14 @@
...
@@ -34,14 +34,14 @@
<TextView
<TextView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Exit Junk Cleaner? Unremoved junk files may be taking up space."
android:textSize=
"17sp"
android:layout_marginTop=
"23dp"
android:layout_marginHorizontal=
"29dp"
android:layout_marginHorizontal=
"29dp"
android:layout_marginTop=
"23dp"
android:ellipsize=
"end"
android:gravity=
"center"
android:gravity=
"center"
android:maxLines=
"2"
android:maxLines=
"2"
android:ellipsize=
"end"
android:text=
"Exit Junk Cleaner? Unremoved junk files may be taking up space."
android:textColor=
"#666666"
/>
android:textColor=
"#666666"
android:textSize=
"17sp"
/>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -80,13 +80,20 @@
...
@@ -80,13 +80,20 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
<com.tool.zxdemo.utils.NativeView
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_height=
"150dp"
android:src=
"@mipmap/qidongyelogo"
android:layout_marginHorizontal=
"10dp"
android:scaleType=
"centerCrop"
android:layout_marginTop=
"31dp"
>
android:layout_marginTop=
"31dp"
android:layout_marginHorizontal=
"10dp"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:scaleType=
"centerCrop"
android:src=
"@mipmap/qidongyelogo"
/>
</com.tool.zxdemo.utils.NativeView>
</LinearLayout>
</LinearLayout>
...
...
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