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
07a93530
Commit
07a93530
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
9a2de72e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
39 deletions
+81
-39
Global.java
.../main/java/com/swiftcleaner/chovey/model/bean/Global.java
+8
-0
StartActivity.java
.../com/swiftcleaner/chovey/view/activity/StartActivity.java
+30
-12
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 @
07a93530
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 @
07a93530
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.contract.ActivityResultContracts
;
import
androidx.annotation.NonNull
;
...
...
@@ -211,19 +216,32 @@ public class StartActivity extends AppCompatActivity {
jumped
.
set
(
true
);
String
actionId
=
getIntent
().
getExtras
()
!=
null
?
getIntent
().
getExtras
().
getString
(
"actionId"
)
:
""
;
Log
.
e
(
"jumpNext"
,
"actionId="
+
actionId
);
switch
(
actionId
)
{
case
"aa"
:
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
break
;
case
"bb"
:
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
break
;
default
:
startActivity
(
new
Intent
(
this
,
MainActivity
.
class
));
finish
();
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
();
}
...
...
app/src/main/java/com/zxdemo/service/PermanentNotifyService.kt
View file @
07a93530
...
...
@@ -15,7 +15,13 @@ import android.os.IBinder
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
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.activity.StartActivity
class
PermanentNotifyService
:
Service
()
{
...
...
@@ -78,28 +84,35 @@ class PermanentNotifyService : Service() {
val
cleanIntent
=
PendingIntent
.
getActivity
(
context
,
// context
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
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv
_clean
,
cleanIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv
_clean
,
cleanIntent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll
_clean
,
cleanIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_ll
_clean
,
cleanIntent
)
val
appIntent
=
PendingIntent
.
getActivity
(
context
,
// context
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
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_app
,
appIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_app
,
appIntent
)
val
whatsIntent
=
PendingIntent
.
getActivity
(
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_app_manager
,
appIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_app_manager
,
appIntent
)
val
batteryIntent
=
PendingIntent
.
getActivity
(
context
,
// context
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
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_whatsapp
,
whats
Intent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_whatsapp
,
whats
Intent
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_battery
,
battery
Intent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_battery
,
battery
Intent
)
val
largeIntent
=
PendingIntent
.
getActivity
(
context
,
// context
...
...
@@ -108,13 +121,16 @@ class PermanentNotifyService : Service() {
"LargeFileCleanActivity"
,
null
,
context
,
MainActivity
::
class
.
java
),
// intent
StartActivity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
FUNCTION_LARGE_FILE
)
},
// intent
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_IMMUTABLE
// flags
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
tv_large
,
largeIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
tv_large
,
largeIntent
)
val
nfIntent
=
Intent
(
context
,
MainActivity
::
class
.
java
)
contentView
.
setOnClickPendingIntent
(
R
.
id
.
id_large_file
,
largeIntent
)
expendView
.
setOnClickPendingIntent
(
R
.
id
.
id_large_file
,
largeIntent
)
val
nfIntent
=
Intent
(
context
,
StartActivity
::
class
.
java
)
val
pendingIntent
=
PendingIntent
.
getActivity
(
context
,
0
,
nfIntent
,
PendingIntent
.
FLAG_IMMUTABLE
)
val
builder
=
NotificationCompat
.
Builder
(
context
,
channelId
)
...
...
app/src/main/res/layout/notifi_stay_small.xml
View file @
07a93530
...
...
@@ -48,9 +48,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复照片
-->
<!--
app管理
-->
<LinearLayout
android:id=
"@+id/id_
recovery_photos
"
android:id=
"@+id/id_
app_manager
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
@@ -76,9 +76,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复视频
-->
<!--
电池
-->
<LinearLayout
android:id=
"@+id/id_
recovery_videos
"
android:id=
"@+id/id_
battery
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
@@ -104,9 +104,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复文档
-->
<!--
大文件
-->
<LinearLayout
android:id=
"@+id/id_
recovery_documents
"
android:id=
"@+id/id_
large_file
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
app/src/main/res/layout/notify_stay_big.xml
View file @
07a93530
...
...
@@ -47,9 +47,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复照片
-->
<!--
app管理
-->
<LinearLayout
android:id=
"@+id/id_
recovery_photos
"
android:id=
"@+id/id_
app_manager
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
@@ -73,9 +73,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复视频
-->
<!--
电池
-->
<LinearLayout
android:id=
"@+id/id_
recovery_videos
"
android:id=
"@+id/id_
battery
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
...
...
@@ -99,9 +99,9 @@
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<!--
恢复文档
-->
<!--
大文件
-->
<LinearLayout
android:id=
"@+id/id_
recovery_documents
"
android:id=
"@+id/id_
large_file
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
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