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
3db097ea
Commit
3db097ea
authored
Dec 20, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
04c18e15
5f658044
Pipeline
#1379
canceled with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
31 deletions
+88
-31
Global.java
.../main/java/com/swiftcleaner/chovey/model/bean/Global.java
+8
-0
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+37
-4
PermanentNotifyService.kt
...rc/main/java/com/zxdemo/service/PermanentNotifyService.kt
+31
-15
notifi_stay_small.xml
app/src/main/res/layout/notifi_stay_small.xml
+6
-6
notify_stay_big.xml
app/src/main/res/layout/notify_stay_big.xml
+6
-6
No files found.
app/src/main/java/com/swiftcleaner/chovey/model/bean/Global.java
0 → 100644
View file @
3db097ea
package
com
.
swiftcleaner
.
chovey
.
model
.
bean
;
public
class
Global
{
public
static
String
FUNCTION_CLEAN
=
"function_clean"
;
public
static
String
FUNCTION_APP_MANAGER
=
"function_app_manager"
;
public
static
String
FUNCTION_BATTERY
=
"function_battery"
;
public
static
String
FUNCTION_LARGE_FILE
=
"function_large_file"
;
}
app/src/main/java/com/swiftcleaner/chovey/view/activity/StartActivity.java
View file @
3db097ea
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
package
com
.
swiftcleaner
.
chovey
.
view
.
activity
;
import
static
com
.
swiftcleaner
.
chovey
.
model
.
bean
.
Global
.
FUNCTION_APP_MANAGER
;
import
static
com
.
swiftcleaner
.
chovey
.
model
.
bean
.
Global
.
FUNCTION_BATTERY
;
import
static
com
.
swiftcleaner
.
chovey
.
model
.
bean
.
Global
.
FUNCTION_CLEAN
;
import
static
com
.
swiftcleaner
.
chovey
.
model
.
bean
.
Global
.
FUNCTION_LARGE_FILE
;
import
androidx.activity.result.ActivityResultLauncher
;
import
androidx.activity.result.ActivityResultLauncher
;
import
androidx.activity.result.contract.ActivityResultContracts
;
import
androidx.activity.result.contract.ActivityResultContracts
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -12,6 +17,7 @@ import android.content.SharedPreferences;
...
@@ -12,6 +17,7 @@ import android.content.SharedPreferences;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
com.gyf.immersionbar.ImmersionBar
;
import
com.gyf.immersionbar.ImmersionBar
;
...
@@ -22,6 +28,7 @@ import com.swiftcleaner.chovey.view.MainActivity;
...
@@ -22,6 +28,7 @@ import com.swiftcleaner.chovey.view.MainActivity;
import
com.zxdemo.admob.AdmobHelper
;
import
com.zxdemo.admob.AdmobHelper
;
import
com.zxdemo.utils.NonBlockingCountdown
;
import
com.zxdemo.utils.NonBlockingCountdown
;
import
java.util.Objects
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicBoolean
;
...
@@ -34,6 +41,7 @@ public class StartActivity extends AppCompatActivity {
...
@@ -34,6 +41,7 @@ public class StartActivity extends AppCompatActivity {
private
boolean
adShowing
=
false
;
private
boolean
adShowing
=
false
;
private
NonBlockingCountdown
nonBlockingCountdown
=
new
NonBlockingCountdown
(
this
::
jumpNext
);
private
NonBlockingCountdown
nonBlockingCountdown
=
new
NonBlockingCountdown
(
this
::
jumpNext
);
private
int
outJumpTime
=
15
;
private
int
outJumpTime
=
15
;
public
AtomicBoolean
jumped
=
new
AtomicBoolean
(
false
);
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -202,14 +210,39 @@ public class StartActivity extends AppCompatActivity {
...
@@ -202,14 +210,39 @@ public class StartActivity extends AppCompatActivity {
}
}
public
AtomicBoolean
jumped
=
new
AtomicBoolean
(
false
);
private
void
jumpNext
()
{
private
void
jumpNext
()
{
Log
.
e
(
"jumpNext"
,
"jumped="
+
jumped
.
get
());
if
(
jumped
.
get
())
return
;
if
(
jumped
.
get
())
return
;
jumped
.
set
(
true
);
jumped
.
set
(
true
);
Intent
intent
=
new
Intent
(
this
,
MainActivity
.
class
);
String
actionId
=
getIntent
().
getExtras
()
!=
null
?
getIntent
().
getExtras
().
getString
(
"actionId"
)
:
""
;
startActivity
(
intent
);
Log
.
e
(
"jumpNext"
,
"actionId="
+
actionId
);
if
(
Objects
.
equals
(
actionId
,
FUNCTION_CLEAN
))
{
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
return
;
}
if
(
Objects
.
equals
(
actionId
,
FUNCTION_APP_MANAGER
))
{
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
return
;
}
if
(
Objects
.
equals
(
actionId
,
FUNCTION_BATTERY
))
{
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
return
;
}
if
(
Objects
.
equals
(
actionId
,
FUNCTION_LARGE_FILE
))
{
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
return
;
}
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
finish
();
}
}
@Override
@Override
...
...
app/src/main/java/com/zxdemo/service/PermanentNotifyService.kt
View file @
3db097ea
...
@@ -15,7 +15,13 @@ import android.os.IBinder
...
@@ -15,7 +15,13 @@ import android.os.IBinder
import
android.widget.RemoteViews
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.app.NotificationCompat
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.R
import
com.swiftcleaner.chovey.model.bean.Global
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.MainActivity
import
com.swiftcleaner.chovey.view.activity.StartActivity
class
PermanentNotifyService
:
Service
()
{
class
PermanentNotifyService
:
Service
()
{
...
@@ -78,28 +84,35 @@ class PermanentNotifyService : Service() {
...
@@ -78,28 +84,35 @@ class PermanentNotifyService : Service() {
val
cleanIntent
=
PendingIntent
.
getActivity
(
val
cleanIntent
=
PendingIntent
.
getActivity
(
context
,
// context
context
,
// context
0
,
// request code
0
,
// request code
Intent
(
"CleanJunkActivity"
,
null
,
context
,
MainActivity
::
class
.
java
),
// intent
Intent
(
"CleanJunkActivity"
,
null
,
context
,
StartActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
FUNCTION_CLEAN
)
},
// intent
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
)
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv
_clean
,
cleanIntent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll
_clean
,
cleanIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv
_clean
,
cleanIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll
_clean
,
cleanIntent
)
val
appIntent
=
PendingIntent
.
getActivity
(
val
appIntent
=
PendingIntent
.
getActivity
(
context
,
// context
context
,
// context
0
,
// request code
0
,
// request code
Intent
(
"AppManagerActivity"
,
null
,
context
,
MainActivity
::
class
.
java
),
// intent
Intent
(
"AppManagerActivity"
,
null
,
context
,
StartActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
FUNCTION_APP_MANAGER
)
},
// intent
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
)
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_app
,
appIntent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_app_manager
,
appIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_app
,
appIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_app_manager
,
appIntent
)
val
whatsIntent
=
PendingIntent
.
getActivity
(
val
batteryIntent
=
PendingIntent
.
getActivity
(
context
,
// context
context
,
// context
0
,
// request code
0
,
// request code
Intent
(
"CleanerActivity"
,
null
,
context
,
MainActivity
::
class
.
java
),
// intent
Intent
(
"CleanerActivity"
,
null
,
context
,
StartActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
FUNCTION_BATTERY
)
},
// intent
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
)
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_whatsapp
,
whats
Intent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_battery
,
battery
Intent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_whatsapp
,
whats
Intent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_battery
,
battery
Intent
)
val
largeIntent
=
PendingIntent
.
getActivity
(
val
largeIntent
=
PendingIntent
.
getActivity
(
context
,
// context
context
,
// context
...
@@ -108,13 +121,16 @@ class PermanentNotifyService : Service() {
...
@@ -108,13 +121,16 @@ class PermanentNotifyService : Service() {
"LargeFileCleanActivity"
,
"LargeFileCleanActivity"
,
null
,
null
,
context
,
context
,
MainActivity
::
class
.
java
StartActivity
::
class
.
java
),
// intent
).
apply
{
putExtra
(
"actionId"
,
FUNCTION_LARGE_FILE
)
},
// intent
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
)
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_large
,
largeIntent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_large_file
,
largeIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_large
,
largeIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_large_file
,
largeIntent
)
val
nfIntent
=
Intent
(
context
,
MainActivity
::
class
.
java
)
val
nfIntent
=
Intent
(
context
,
StartActivity
::
class
.
java
)
val
pendingIntent
=
val
pendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
nfIntent
,
PendingIntent
.
FLAG_IMMUTABLE
)
PendingIntent
.
getActivity
(
context
,
0
,
nfIntent
,
PendingIntent
.
FLAG_IMMUTABLE
)
val
builder
=
NotificationCompat
.
Builder
(
context
,
channelId
)
val
builder
=
NotificationCompat
.
Builder
(
context
,
channelId
)
...
...
app/src/main/res/layout/notifi_stay_small.xml
View file @
3db097ea
...
@@ -48,9 +48,9 @@
...
@@ -48,9 +48,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复照片
-->
<!--
app管理
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_photos
"
android:id=
"@+id/id_
app_manager
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -76,9 +76,9 @@
...
@@ -76,9 +76,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复视频
-->
<!--
电池
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_videos
"
android:id=
"@+id/id_
battery
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -104,9 +104,9 @@
...
@@ -104,9 +104,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复文档
-->
<!--
大文件
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_documents
"
android:id=
"@+id/id_
large_file
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
...
app/src/main/res/layout/notify_stay_big.xml
View file @
3db097ea
...
@@ -47,9 +47,9 @@
...
@@ -47,9 +47,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复照片
-->
<!--
app管理
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_photos
"
android:id=
"@+id/id_
app_manager
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -73,9 +73,9 @@
...
@@ -73,9 +73,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复视频
-->
<!--
电池
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_videos
"
android:id=
"@+id/id_
battery
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -99,9 +99,9 @@
...
@@ -99,9 +99,9 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<!--
恢复文档
-->
<!--
大文件
-->
<LinearLayout
<LinearLayout
android:id=
"@+id/id_
recovery_documents
"
android:id=
"@+id/id_
large_file
"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
...
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