Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
scanqrwhitecopy
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
scanqrwhitecopy
Commits
0718d745
Commit
0718d745
authored
Jan 20, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
92e402ed
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
80 deletions
+44
-80
MyNotificationManager.kt
...ase/scanqrclear/fcm/notification/MyNotificationManager.kt
+1
-1
AppProcessActivity.kt
...main/java/com/base/scanqrclear/luma/AppProcessActivity.kt
+8
-1
BaseActivity2.kt
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
+31
-51
DialogHelps.kt
app/src/main/java/com/base/scanqrclear/luma/DialogHelps.kt
+2
-21
ExitType.kt
app/src/main/java/com/base/scanqrclear/utils/ExitType.kt
+1
-4
strings.xml
app/src/main/res/values/strings.xml
+1
-2
No files found.
app/src/main/java/com/base/scanqrclear/fcm/notification/MyNotificationManager.kt
View file @
0718d745
...
...
@@ -71,7 +71,7 @@ object MyNotificationManager {
val
next
=
actionIdList
[
0
]
actionIdList
.
removeAt
(
0
)
if
(
BuildConfig
.
DEBUG
)
{
return
ACTION_ID_
WEATHER
return
ACTION_ID_
APP_PROCESS
}
return
next
}
...
...
app/src/main/java/com/base/scanqrclear/luma/AppProcessActivity.kt
View file @
0718d745
...
...
@@ -15,6 +15,7 @@ import androidx.lifecycle.lifecycleScope
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.base.scanqrclear.R
import
com.base.scanqrclear.databinding.ActivityAppProcessBinding
import
com.base.scanqrclear.luma.DialogHelps.showExitDialog
import
com.base.scanqrclear.utils.AnimationHelps
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -58,12 +59,18 @@ class AppProcessActivity : BaseActivity2() {
colorEndIndex
,
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
)
showExitDialog
(
title
,
spannableString
)
showExitDialog
(
this
@AppProcessActivity
,
title
,
spannableString
)
{
backAdJump
()
}
}
}
private
fun
initView
()
{
onBackPressedDispatcher
.
addCallback
{
handleBackPressed
(
this
@AppProcessActivity
)
}
adapter
=
AppProcessAdapter
()
adapter
.
callback
=
object
:
BaseAdapter
.
OnClickCallback
<
AppInfoBean
>
{
override
fun
onClicked
(
view
:
View
,
position
:
Int
,
item
:
AppInfoBean
)
{
...
...
app/src/main/java/com/base/scanqrclear/luma/BaseActivity2.kt
View file @
0718d745
...
...
@@ -16,8 +16,12 @@ import androidx.constraintlayout.widget.ConstraintLayout
import
androidx.lifecycle.lifecycleScope
import
com.airbnb.lottie.LottieAnimationView
import
com.base.scanqrclear.R
import
com.base.scanqrclear.ads.AdsMgr
import
com.base.scanqrclear.ads.AdsShowCallBack
import
com.base.scanqrclear.bean.config.AdConfigBean
import
com.base.scanqrclear.helper.EventUtils
import
com.base.scanqrclear.luma.AdmobHelps.KEY_CLEANUP_SIZE
import
com.base.scanqrclear.luma.DialogHelps.showExitDialog
import
com.base.scanqrclear.ui.main.MainActivity
import
com.base.scanqrclear.utils.ActivityLauncher
import
com.base.scanqrclear.utils.ExitType
...
...
@@ -33,7 +37,6 @@ open class BaseActivity2 : AppCompatActivity() {
protected
var
loadingDialog
:
Dialog
?
=
null
protected
var
isDisableBack
=
false
protected
var
isExit
=
false
private
var
isShowAdInterstitial
=
false
private
var
isPause
=
false
...
...
@@ -44,8 +47,6 @@ open class BaseActivity2 : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
launcher
=
ActivityLauncher
(
this
)
immersive
()
//todo 返回
// addBackPressedCallback()
ActivityManagerHelps
.
add
(
this
)
EventUtils
.
event
(
"${javaClass.simpleName}_show"
)
}
...
...
@@ -69,7 +70,6 @@ open class BaseActivity2 : AppCompatActivity() {
override
fun
onDestroy
()
{
super
.
onDestroy
()
ActivityManagerHelps
.
remove
(
this
)
isExit
=
false
lottieType
=
null
complete
=
null
}
...
...
@@ -104,14 +104,6 @@ open class BaseActivity2 : AppCompatActivity() {
// }
}
// protected fun startAdInterstitial() {
// if (this is SplashActivity || this is MainActivity) return
// isShowAdInterstitial = true
// if (!isPause) {
// val animationView = findViewById<ConstraintLayout>(R.id.animation)
// showAdInterstitial(animationView, complete)
// }
// }
protected
fun
showAdInterstitial
(
isShow
:
Boolean
,
complete
:
(()
->
Unit
?)?
=
null
)
{
if
(
this
.
isFinishing
||
this
.
isDestroyed
||
isShowAdInterstitial
)
return
...
...
@@ -221,18 +213,15 @@ open class BaseActivity2 : AppCompatActivity() {
onBackPressedDispatcher
.
onBackPressed
()
}
protected
open
fun
handleBackPressed
(
activity
:
Activity
)
{
fun
handleBackPressed
(
activity
:
Activity
)
{
when
(
activity
)
{
is
MainActivity
->
logout
()
// is AppManagerActivity -> exit(ExitType.APP_MANAGER)
// is BatteryInfoActivity -> exit(ExitType.BATTERY_INFO)
// is CleanJunkActivity -> exit(ExitType.CLEAN)
// is LargeFileCleanActivity -> exit(ExitType.LARGE_FILE)
// is com.base.scanqrclear.luma.ScreenshotCleanActivity -> exit(ExitType.SCREENSHOT)
// is com.base.scanqrclear.luma.SimilarPhotosActivity -> exit(ExitType.SIMILAR_PHOTOS)
// is com.base.scanqrclear.luma.WhatsappCleanActivity -> exit(ExitType.WHATSAPP)
// is PhotoCompressionActivity -> exit(ExitType.PHOTO_COMPRESSION)
// else -> finishOrToMain()
is
CleanJunkActivity
->
exit
(
ExitType
.
CLEAN
)
is
ScreenshotCleanActivity
->
exit
(
ExitType
.
SCREENSHOT
)
is
SimilarPhotosActivity
->
exit
(
ExitType
.
SIMILAR_PHOTOS
)
is
WhatsappCleanActivity
->
exit
(
ExitType
.
WHATSAPP
)
is
AppProcessActivity
->
exit
(
ExitType
.
APP_PROCESS
)
else
->
finishToMainTop
()
}
}
...
...
@@ -245,40 +234,31 @@ open class BaseActivity2 : AppCompatActivity() {
})
}
protected
fun
showExitDialog
(
title
:
String
,
content
:
CharSequence
)
{
if
(
isExit
)
return
isExit
=
true
DialogHelps
.
showExitDialog
(
this
,
title
,
content
,
{
showAdInterstitial
(
AdmobHelps
.
isShowAdBackInter
())
{
finishOrToMain
()
}
},
{
isExit
=
false
}
)
}
private
fun
exit
(
exit
:
ExitType
)
{
showExitDialog
(
getString
(
exit
.
title
),
getString
(
exit
.
content
))
}
private
fun
addBackPressedCallback
(
activity
:
Activity
)
{
onBackPressedDispatcher
.
addCallback
{
if
(
isDisableBack
)
{
Toast
.
makeText
(
applicationContext
,
getString
(
R
.
string
.
wait_a_moment
),
Toast
.
LENGTH_SHORT
).
show
()
}
else
{
if
(
isShowAdInterstitial
)
return
@addCallback
handleBackPressed
(
activity
)
}
showExitDialog
(
this
,
getString
(
exit
.
title
),
getString
(
exit
.
content
))
{
backAdJump
()
}
}
protected
fun
finishOrToMain
()
{
// if (this !is MainActivity
// && !ActivityManagerHelps.isActivityInStack(MainActivity::class.java)
// ) {
// MainActivity.start(this)
// }
// finish()
fun
backAdJump
()
{
if
(
AdConfigBean
.
adsConfigBean
.
functionBackShowAd
)
{
AdsMgr
.
showInsert
(
this
,
false
,
object
:
AdsShowCallBack
()
{
override
fun
close
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
failed
(
where
:
Int
)
{
finishToMainTop
()
}
override
fun
googleFailed
(
where
:
Int
)
{
finishToMainTop
()
}
})
}
else
{
finishToMainTop
()
}
}
fun
finishToMainTop
()
{
...
...
app/src/main/java/com/base/scanqrclear/luma/DialogHelps.kt
View file @
0718d745
...
...
@@ -18,7 +18,6 @@ import com.base.scanqrclear.databinding.DialogNotificationBinding
import
com.base.scanqrclear.databinding.DialogPermissionBinding
import
com.base.scanqrclear.databinding.DialogScoreBinding
import
com.base.scanqrclear.luma.AdmobHelps.KEY_SCORE
import
com.base.scanqrclear.utils.ExitType
import
com.google.android.material.bottomsheet.BottomSheetDialog
object
DialogHelps
{
...
...
@@ -151,28 +150,12 @@ object DialogHelps {
return
binding
}
fun
showConfirmDialog
(
context
:
Context
,
view
:
View
,
confirm
:
(()
->
Unit
?)?)
{
val
binding
=
showDeleteDialog
(
context
,
view
,
confirm
)
binding
.
tvTitle
.
text
=
context
.
getString
(
R
.
string
.
confirm
)
binding
.
tvContent
.
text
=
context
.
getString
(
R
.
string
.
confirm_content
)
binding
.
tvDelete
.
text
=
context
.
getString
(
R
.
string
.
compress
)
}
fun
showExitDialog
(
context
:
Activity
,
exit
:
ExitType
,
confirm
:
()
->
Unit
,
dismiss
:
()
->
Unit
)
{
showExitDialog
(
context
,
context
.
getString
(
exit
.
title
),
context
.
getString
(
exit
.
content
),
confirm
,
dismiss
)
}
fun
showExitDialog
(
context
:
Activity
,
title
:
String
,
content
:
CharSequence
,
content
:
Any
,
confirm
:
()
->
Unit
,
dismiss
:
()
->
Unit
)
{
val
binding
=
DialogExitBinding
.
inflate
(
LayoutInflater
.
from
(
context
))
val
dialog
=
Dialog
(
context
,
R
.
style
.
CustomDialogStyle
).
apply
{
...
...
@@ -182,14 +165,12 @@ object DialogHelps {
show
()
}
binding
.
tvTitle
.
text
=
title
binding
.
tvContent
.
text
=
content
binding
.
tvContent
.
text
=
content
.
toString
()
binding
.
ivCancel
.
setOnClickListener
{
dialog
.
dismiss
()
dismiss
.
invoke
()
}
binding
.
tvCancel
.
setOnClickListener
{
dialog
.
dismiss
()
dismiss
.
invoke
()
}
binding
.
tvSure
.
setOnClickListener
{
it
.
isEnabled
=
false
...
...
app/src/main/java/com/base/scanqrclear/utils/ExitType.kt
View file @
0718d745
...
...
@@ -3,10 +3,7 @@ package com.base.scanqrclear.utils
import
com.base.scanqrclear.R
enum
class
ExitType
(
val
title
:
Int
,
val
content
:
Int
)
{
APP_MANAGER
(
R
.
string
.
exit_app_manager
,
R
.
string
.
exit_app_manager_content
),
BATTERY_INFO
(
R
.
string
.
exit_battery_info
,
R
.
string
.
exit_battery_info_content
),
LARGE_FILE
(
R
.
string
.
exit_large_file_clean
,
R
.
string
.
exit_large_file_clean_content
),
PHOTO_COMPRESSION
(
R
.
string
.
exit_photo_compression
,
R
.
string
.
exit_photo_compression_content
),
APP_PROCESS
(
R
.
string
.
exit_app_process
,
R
.
string
.
exit_app_process_content1
),
SCREENSHOT
(
R
.
string
.
exit_screenshot_cleaner
,
R
.
string
.
exit_screenshot_cleaner_content
),
SIMILAR_PHOTOS
(
R
.
string
.
exit_similar_photos
,
R
.
string
.
exit_similar_photos_content
),
WHATSAPP
(
R
.
string
.
exit_whatsapp_clean
,
R
.
string
.
exit_whatsapp_clean_content
),
...
...
app/src/main/res/values/strings.xml
View file @
0718d745
...
...
@@ -181,7 +181,7 @@
<string
name=
"charging_lower"
>
charging
</string>
<string
name=
"exit_clean_junk"
>
Exit Junk Scan
</string>
<string
name=
"exit_clean_junk_content"
>
Exit Junk Scan? Uncleared junk files might be taking up space.
</string>
<string
name=
"exit_app_
manager"
>
Exit App Manager
</string>
<string
name=
"exit_app_
process"
>
Exit App Process
</string>
<string
name=
"exit_app_manager_content"
>
Exit App manager? Unused applications may occupy phone memory.
</string>
<string
name=
"exit_battery_info"
>
Exit Battery Info
</string>
<string
name=
"exit_battery_info_content"
>
Exit Battery Info? Continuing to use it can help you better understand the battery condition.
</string>
...
...
@@ -189,7 +189,6 @@
<string
name=
"exit_whatsapp_clean_content"
>
Exit WhatsApp Clean? Possible WhatsApp junk files may be using space.
</string>
<string
name=
"exit_large_file_clean"
>
Exit Large Files
</string>
<string
name=
"exit_large_file_clean_content"
>
Exit Large Files? Undeleted large files may be occupying valuable space.
</string>
<string
name=
"exit_app_process"
>
Exit App Process
</string>
<string
name=
"exit_app_process_content1"
>
Exit App Process?
</string>
<string
name=
"exit_app_process_content2"
>
background processes are still running.
</string>
<string
name=
"exit_photo_compression"
>
Exit Image Compression
</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