Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy Cleaner Junk
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
Easy Cleaner Junk
Commits
c1c04510
Commit
c1c04510
authored
Jul 01, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app管理
parent
312256a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
361 additions
and
329 deletions
+361
-329
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+69
-28
data.json
app/src/main/assets/easy_app_manager/data.json
+1
-0
img_0.png
app/src/main/assets/easy_app_manager/images/img_0.png
+0
-0
img_1.png
app/src/main/assets/easy_app_manager/images/img_1.png
+0
-0
img_2.png
app/src/main/assets/easy_app_manager/images/img_2.png
+0
-0
AppManagerActivity.kt
.../test/easy/easycleanerjunk/activity/AppManagerActivity.kt
+109
-0
AppUninstallAdapter.kt
.../test/easy/easycleanerjunk/adapter/AppUninstallAdapter.kt
+49
-0
AppUninstallBean.kt
...va/com/test/easy/easycleanerjunk/bean/AppUninstallBean.kt
+5
-0
bg_corners_3_4772ff.xml
app/src/main/res/drawable/bg_corners_3_4772ff.xml
+5
-0
activity_app_manager.xml
app/src/main/res/layout/activity_app_manager.xml
+65
-301
item_uninstall_app.xml
app/src/main/res/layout/item_uninstall_app.xml
+58
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
c1c04510
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
...
@@ -14,6 +16,20 @@
...
@@ -14,6 +16,20 @@
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_BOOT_COMPLETED"
/>
<uses-permission
android:name=
"android.permission.POST_NOTIFICATIONS"
/>
<uses-permission
android:name=
"android.permission.POST_NOTIFICATIONS"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<queries>
<intent>
<action
android:name=
"android.intent.action.MAIN"
/>
</intent>
<intent>
<action
android:name=
"android.intent.action.VIEW"
/>
</intent>
</queries>
<application
<application
android:name=
".MyApplication"
android:name=
".MyApplication"
...
@@ -22,8 +38,10 @@
...
@@ -22,8 +38,10 @@
android:fullBackupContent=
"@xml/backup_rules"
android:fullBackupContent=
"@xml/backup_rules"
android:icon=
"@mipmap/logo"
android:icon=
"@mipmap/logo"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:requestLegacyExternalStorage=
"true"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.SmartCleaner"
android:theme=
"@style/Theme.SmartCleaner"
android:usesCleartextTraffic=
"true"
tools:targetApi=
"31"
>
tools:targetApi=
"31"
>
<activity
<activity
...
@@ -45,6 +63,13 @@
...
@@ -45,6 +63,13 @@
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
android:name=
".activity.AppManagerActivity"
android:exported=
"false"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
<activity
android:name=
".activity.ScreenShotActivity"
android:name=
".activity.ScreenShotActivity"
android:exported=
"false"
android:exported=
"false"
...
@@ -97,7 +122,6 @@
...
@@ -97,7 +122,6 @@
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
<activity
android:name=
".activity.ResultActivity"
android:name=
".activity.ResultActivity"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
...
@@ -121,7 +145,42 @@
...
@@ -121,7 +145,42 @@
android:name=
"com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:name=
"com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED"
android:value=
"false"
/>
android:value=
"false"
/>
<!-- <service-->
<!-- android:name=".display.fcm.MyFirebaseMessagingService"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- 注册广播 -->
<!-- <receiver-->
<!-- android:name=".display.fcm.MyFirebaseMessagingReceiver"-->
<!-- android:exported="true"-->
<!-- android:permission="com.google.android.c2dm.permission.SEND">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
<!-- <action android:name="com.google.android.c2dm.intent.RECEIVE" />-->
<!-- <category android:name="com.test.fast.cleanerjunk" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- <service-->
<!-- android:name=".display.NotificationService"-->
<!-- android:permission="android.permission.FOREGROUND_SERVICE" />-->
<!-- <service-->
<!-- android:name=".notificationclean.AppNotificationListenerService"-->
<!-- android:exported="true"-->
<!-- android:label="AppNotification service"-->
<!-- android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.service.notification.NotificationListenerService" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <service-->
<!-- android:name=".service.FlashlightService"-->
<!-- android:exported="true"-->
<!-- tools:ignore="ExportedService" />-->
<activity
<activity
android:name=
".activity.photocompress.photo.StartCompressionPhotoActivity"
android:name=
".activity.photocompress.photo.StartCompressionPhotoActivity"
...
@@ -144,36 +203,18 @@
...
@@ -144,36 +203,18 @@
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<!-- <receiver-->
<!-- android:name=".display.CloseNotificationReceiver"-->
<!-- android:exported="true"-->
<!-- tools:ignore="ExportedReceiver">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.file.notification.CloseNotificationReceiver" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<meta-data
<meta-data
android:name=
"com.facebook.sdk.ApplicationId"
android:name=
"com.facebook.sdk.ApplicationId"
android:value=
"@string/facebook_app_id"
/>
android:value=
"@string/facebook_app_id"
/>
<service
android:name=
".fcm.FcmService"
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
</intent-filter>
</service>
<!-- 添加以下接收器 -->
<!-- 注册广播 -->
<receiver
android:name=
".fcm.FcmReceiver"
android:exported=
"true"
android:permission=
"com.google.android.c2dm.permission.SEND"
>
<intent-filter>
<action
android:name=
"com.google.firebase.MESSAGING_EVENT"
/>
<action
android:name=
"com.google.android.c2dm.intent.RECEIVE"
/>
<category
android:name=
"com.test.easy.cleanerjunk"
/>
</intent-filter>
</receiver>
<receiver
android:name=
".fcm.CloseNotificationReceiver"
android:exported=
"false"
>
<intent-filter>
<action
android:name=
"CANCEL_NOTIFICATION"
/>
</intent-filter>
</receiver>
</application>
</application>
...
...
app/src/main/assets/easy_app_manager/data.json
0 → 100644
View file @
c1c04510
{
"v"
:
"5.4.4"
,
"fr"
:
60
,
"ip"
:
0
,
"op"
:
240
,
"w"
:
720
,
"h"
:
1280
,
"nm"
:
"2a"
,
"ddd"
:
0
,
"assets"
:[{
"id"
:
"image_0"
,
"w"
:
498
,
"h"
:
497
,
"u"
:
"images/"
,
"p"
:
"img_0.png"
,
"e"
:
0
},{
"id"
:
"image_1"
,
"w"
:
498
,
"h"
:
251
,
"u"
:
"images/"
,
"p"
:
"img_1.png"
,
"e"
:
0
},{
"id"
:
"image_2"
,
"w"
:
512
,
"h"
:
497
,
"u"
:
"images/"
,
"p"
:
"img_2.png"
,
"e"
:
0
},{
"id"
:
"comp_0"
,
"layers"
:[{
"ddd"
:
0
,
"ind"
:
1
,
"ty"
:
2
,
"nm"
:
"scan.png"
,
"cl"
:
"png"
,
"refId"
:
"image_0"
,
"sr"
:
1
,
"ks"
:{
"o"
:{
"a"
:
1
,
"k"
:[{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
0
,
"s"
:[
30
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.833
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.167
],
"y"
:[
0
]},
"t"
:
15
,
"s"
:[
100
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.833
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.167
],
"y"
:[
0
]},
"t"
:
222
,
"s"
:[
100
],
"e"
:[
0
]},{
"t"
:
239
}],
"ix"
:
11
},
"r"
:{
"a"
:
0
,
"k"
:
0
,
"ix"
:
10
},
"p"
:{
"a"
:
0
,
"k"
:[
360
,
552
,
0
],
"ix"
:
2
},
"a"
:{
"a"
:
0
,
"k"
:[
249
,
248.5
,
0
],
"ix"
:
1
},
"s"
:{
"a"
:
1
,
"k"
:[{
"i"
:{
"x"
:[
0.667
,
0.667
,
0.667
],
"y"
:[
0.731
,
0.731
,
-28.047
]},
"o"
:{
"x"
:[
0.333
,
0.333
,
0.333
],
"y"
:[
0
,
0
,
0
]},
"t"
:
0
,
"s"
:[
0
,
0
,
100
],
"e"
:[
108
,
108
,
100
]},{
"i"
:{
"x"
:[
0.667
,
0.667
,
0.667
],
"y"
:[
0.52
,
0.52
,
3.935
]},
"o"
:{
"x"
:[
0.333
,
0.333
,
0.333
],
"y"
:[
-0.88
,
-0.88
,
10.562
]},
"t"
:
11
,
"s"
:[
108
,
108
,
100
],
"e"
:[
96
,
96
,
100
]},{
"i"
:{
"x"
:[
0.667
,
0.667
,
0.667
],
"y"
:[
1
,
1
,
1
]},
"o"
:{
"x"
:[
0.333
,
0.333
,
0.333
],
"y"
:[
-1.081
,
-1.081
,
-2.202
]},
"t"
:
15
,
"s"
:[
96
,
96
,
100
],
"e"
:[
100
,
100
,
100
]},{
"t"
:
18
}],
"ix"
:
6
}},
"ao"
:
0
,
"ip"
:
0
,
"op"
:
720
,
"st"
:
0
,
"bm"
:
0
},{
"ddd"
:
0
,
"ind"
:
2
,
"ty"
:
2
,
"nm"
:
"sm.png"
,
"cl"
:
"png"
,
"refId"
:
"image_1"
,
"sr"
:
1
,
"ks"
:{
"o"
:{
"a"
:
1
,
"k"
:[{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
17
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
32
,
"s"
:[
100
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
47
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
64
,
"s"
:[
100
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
81
,
"s"
:[
0
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
96
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
111
,
"s"
:[
100
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
126
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
143
,
"s"
:[
100
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
160
,
"s"
:[
0
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
175
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
190
,
"s"
:[
100
],
"e"
:[
0
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
205
,
"s"
:[
0
],
"e"
:[
100
]},{
"i"
:{
"x"
:[
0.667
],
"y"
:[
1
]},
"o"
:{
"x"
:[
0.333
],
"y"
:[
0
]},
"t"
:
222
,
"s"
:[
100
],
"e"
:[
0
]},{
"t"
:
239
}],
"ix"
:
11
},
"r"
:{
"a"
:
0
,
"k"
:
0
,
"ix"
:
10
},
"p"
:{
"a"
:
1
,
"k"
:[{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
17
,
"s"
:[
360
,
432
,
0
],
"e"
:[
360
,
912
,
0
],
"to"
:[
0
,
80
,
0
],
"ti"
:[
0
,
0
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
47
,
"s"
:[
360
,
912
,
0
],
"e"
:[
360
,
432
,
0
],
"to"
:[
0
,
0
,
0
],
"ti"
:[
0
,
80
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
0.667
},
"o"
:{
"x"
:
0.333
,
"y"
:
0.333
},
"t"
:
81
,
"s"
:[
360
,
432
,
0
],
"e"
:[
360
,
432
,
0
],
"to"
:[
0
,
0
,
0
],
"ti"
:[
0
,
0
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
96
,
"s"
:[
360
,
432
,
0
],
"e"
:[
360
,
912
,
0
],
"to"
:[
0
,
80
,
0
],
"ti"
:[
0
,
0
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
126
,
"s"
:[
360
,
912
,
0
],
"e"
:[
360
,
432
,
0
],
"to"
:[
0
,
0
,
0
],
"ti"
:[
0
,
80
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
0.667
},
"o"
:{
"x"
:
0.333
,
"y"
:
0.333
},
"t"
:
160
,
"s"
:[
360
,
432
,
0
],
"e"
:[
360
,
432
,
0
],
"to"
:[
0
,
0
,
0
],
"ti"
:[
0
,
0
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
175
,
"s"
:[
360
,
432
,
0
],
"e"
:[
360
,
912
,
0
],
"to"
:[
0
,
80
,
0
],
"ti"
:[
0
,
0
,
0
]},{
"i"
:{
"x"
:
0.667
,
"y"
:
1
},
"o"
:{
"x"
:
0.333
,
"y"
:
0
},
"t"
:
205
,
"s"
:[
360
,
912
,
0
],
"e"
:[
360
,
432
,
0
],
"to"
:[
0
,
0
,
0
],
"ti"
:[
0
,
80
,
0
]},{
"t"
:
239
}],
"ix"
:
2
},
"a"
:{
"a"
:
0
,
"k"
:[
249
,
125.5
,
0
],
"ix"
:
1
},
"s"
:{
"a"
:
0
,
"k"
:[
100
,
100
,
100
],
"ix"
:
6
}},
"ao"
:
0
,
"ip"
:
0
,
"op"
:
720
,
"st"
:
0
,
"bm"
:
0
}]}],
"layers"
:[{
"ddd"
:
0
,
"ind"
:
1
,
"ty"
:
0
,
"nm"
:
"scan"
,
"refId"
:
"comp_0"
,
"sr"
:
1
,
"ks"
:{
"o"
:{
"a"
:
0
,
"k"
:
100
,
"ix"
:
11
},
"r"
:{
"a"
:
0
,
"k"
:
0
,
"ix"
:
10
},
"p"
:{
"a"
:
0
,
"k"
:[
360
,
640
,
0
],
"ix"
:
2
},
"a"
:{
"a"
:
0
,
"k"
:[
360
,
640
,
0
],
"ix"
:
1
},
"s"
:{
"a"
:
0
,
"k"
:[
100
,
100
,
100
],
"ix"
:
6
}},
"ao"
:
0
,
"w"
:
720
,
"h"
:
1280
,
"ip"
:
0
,
"op"
:
720
,
"st"
:
0
,
"bm"
:
0
},{
"ddd"
:
0
,
"ind"
:
2
,
"ty"
:
2
,
"nm"
:
"2-phone.png"
,
"cl"
:
"png"
,
"refId"
:
"image_2"
,
"sr"
:
1
,
"ks"
:{
"o"
:{
"a"
:
0
,
"k"
:
100
,
"ix"
:
11
},
"r"
:{
"a"
:
0
,
"k"
:
0
,
"ix"
:
10
},
"p"
:{
"a"
:
0
,
"k"
:[
360
,
552
,
0
],
"ix"
:
2
},
"a"
:{
"a"
:
0
,
"k"
:[
256
,
248.5
,
0
],
"ix"
:
1
},
"s"
:{
"a"
:
0
,
"k"
:[
100
,
100
,
100
],
"ix"
:
6
}},
"ao"
:
0
,
"ip"
:
0
,
"op"
:
720
,
"st"
:
0
,
"bm"
:
0
}],
"markers"
:[]}
\ No newline at end of file
app/src/main/assets/easy_app_manager/images/img_0.png
0 → 100644
View file @
c1c04510
3.07 KB
app/src/main/assets/easy_app_manager/images/img_1.png
0 → 100644
View file @
c1c04510
11.1 KB
app/src/main/assets/easy_app_manager/images/img_2.png
0 → 100644
View file @
c1c04510
80.9 KB
app/src/main/java/com/test/easy/easycleanerjunk/activity/AppManagerActivity.kt
0 → 100644
View file @
c1c04510
package
com.test.easy.easycleanerjunk.activity
import
android.content.Context
import
android.content.Intent
import
android.content.pm.ApplicationInfo
import
android.content.pm.PackageInfo
import
android.graphics.Color
import
android.net.Uri
import
androidx.core.view.isVisible
import
com.test.easy.easycleanerjunk.adapter.AppUninstallAdapter
import
com.test.easy.easycleanerjunk.bean.AppUninstallBean
import
com.test.easy.easycleanerjunk.databinding.ActivityAppManagerBinding
import
com.test.easy.easycleanerjunk.helps.BaseActivity
import
com.test.easy.easycleanerjunk.helps.ads.AdmobUtils
import
com.test.easy.easycleanerjunk.utils.BarUtils
import
kotlin.random.Random
class
AppManagerActivity
:
BaseActivity
<
ActivityAppManagerBinding
>()
{
private
lateinit
var
adapter
:
AppUninstallAdapter
override
val
binding
:
ActivityAppManagerBinding
by
lazy
{
ActivityAppManagerBinding
.
inflate
(
layoutInflater
)
}
override
fun
initView
()
{
BarUtils
.
setStatusBarLightMode
(
this
,
true
)
BarUtils
.
setStatusBarColor
(
this
,
Color
.
TRANSPARENT
)
adapter
=
AppUninstallAdapter
{
pkg
->
unInstall
(
pkg
)
}
binding
.
rv
.
adapter
=
adapter
playLottie
()
}
private
fun
playLottie
()
{
binding
.
flLottie
.
isVisible
=
true
binding
.
lottie
.
imageAssetsFolder
=
"easy_app_manager/images/"
binding
.
lottie
.
setAnimation
(
"easy_app_manager/data.json"
)
binding
.
lottie
.
playAnimation
()
binding
.
root
.
postDelayed
({
AdmobUtils
.
showInterstitialAd
(
this
)
{
binding
.
lottie
.
cancelAnimation
()
binding
.
flLottie
.
isVisible
=
false
initData
()
}
},
Random
.
nextLong
(
4000
,
6000
))
}
override
fun
initListener
()
{
binding
.
flBack
.
setOnClickListener
{
AdmobUtils
.
showInterstitialAd
(
this
)
{
finishToMain
()
}
}
}
private
fun
initData
()
{
val
pm
=
packageManager
val
packages
=
pm
.
getInstalledPackages
(
0
)
val
list
=
arrayListOf
<
AppUninstallBean
>()
packages
.
forEach
{
app
->
if
(
isLaunchApp
(
this
,
app
))
{
val
appBean
=
AppUninstallBean
(
app
.
applicationInfo
.
loadIcon
(
pm
),
app
.
applicationInfo
.
loadLabel
(
pm
).
toString
(),
app
.
applicationInfo
.
packageName
)
list
.
add
(
appBean
)
}
}
adapter
.
setData
(
list
)
}
private
fun
isLaunchApp
(
context
:
Context
,
app
:
PackageInfo
,
filterSystem
:
Boolean
=
true
):
Boolean
{
val
flagSystem
=
(
app
.
applicationInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
)
<
1
val
flag
=
if
(
filterSystem
)
flagSystem
else
true
return
flag
&&
app
.
applicationInfo
.
packageName
!=
context
.
packageName
}
private
fun
unInstall
(
pkg
:
String
)
{
val
intent
=
Intent
(
Intent
.
ACTION_DELETE
,
Uri
.
parse
(
"package:${pkg}"
))
launcher
.
launch
(
intent
)
{
if
(!
isInstalled
(
this
,
pkg
))
{
adapter
.
removeBean
(
pkg
)
}
}
}
private
fun
isInstalled
(
context
:
Context
,
pkg
:
String
,
error
:
(()
->
Unit
)?
=
null
):
Boolean
{
return
try
{
context
.
packageManager
.
getPackageInfo
(
pkg
,
0
)
true
}
catch
(
e
:
Exception
)
{
error
?.
invoke
()
false
}
}
}
\ No newline at end of file
app/src/main/java/com/test/easy/easycleanerjunk/adapter/AppUninstallAdapter.kt
0 → 100644
View file @
c1c04510
package
com.test.easy.easycleanerjunk.adapter
import
android.annotation.SuppressLint
import
android.view.View
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView.ViewHolder
import
com.test.easy.easycleanerjunk.R
import
com.test.easy.easycleanerjunk.bean.AppUninstallBean
import
com.test.easy.easycleanerjunk.databinding.ItemUninstallAppBinding
import
com.test.easy.easycleanerjunk.view.XmlEx.inflate
class
AppUninstallAdapter
(
val
unInstall
:
(
pkg
:
String
)
->
Unit
)
:
RecyclerView
.
Adapter
<
AppUninstallAdapter
.
hjh
>()
{
private
val
beanList
=
arrayListOf
<
AppUninstallBean
>()
class
hjh
(
view
:
View
)
:
ViewHolder
(
view
)
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
hjh
{
return
hjh
(
R
.
layout
.
item_uninstall_app
.
inflate
(
parent
))
}
override
fun
getItemCount
():
Int
{
return
beanList
.
size
}
override
fun
onBindViewHolder
(
holder
:
hjh
,
position
:
Int
)
{
val
binding
=
ItemUninstallAppBinding
.
bind
(
holder
.
itemView
)
val
bean
=
beanList
[
position
]
binding
.
iv
.
setImageDrawable
(
bean
.
icon
)
binding
.
tvName
.
text
=
bean
.
name
binding
.
tvUninstall
.
setOnClickListener
{
unInstall
.
invoke
(
bean
.
packageName
)
}
}
@SuppressLint
(
"NotifyDataSetChanged"
)
fun
setData
(
list
:
List
<
AppUninstallBean
>)
{
beanList
.
clear
()
beanList
.
addAll
(
list
)
notifyDataSetChanged
()
}
@SuppressLint
(
"NotifyDataSetChanged"
)
fun
removeBean
(
pkg
:
String
)
{
beanList
.
removeIf
{
it
.
packageName
==
pkg
}
notifyDataSetChanged
()
}
}
\ No newline at end of file
app/src/main/java/com/test/easy/easycleanerjunk/bean/AppUninstallBean.kt
0 → 100644
View file @
c1c04510
package
com.test.easy.easycleanerjunk.bean
import
android.graphics.drawable.Drawable
data class
AppUninstallBean
(
val
icon
:
Drawable
,
val
name
:
String
,
val
packageName
:
String
)
\ No newline at end of file
app/src/main/res/drawable/bg_corners_3_4772ff.xml
0 → 100644
View file @
c1c04510
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#4772FF"
/>
<corners
android:radius=
"3dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_app_manager.xml
View file @
c1c04510
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/item_uninstall_app.xml
0 → 100644
View file @
c1c04510
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"8dp"
android:orientation=
"horizontal"
android:paddingVertical=
"5dp"
>
<androidx.cardview.widget.CardView
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center_vertical"
app:cardCornerRadius=
"8dp"
>
<ImageView
android:id=
"@+id/iv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:ignore=
"ContentDescription"
/>
</androidx.cardview.widget.CardView>
<LinearLayout
android:id=
"@+id/ll"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"12dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:textColor=
"@color/black"
android:textSize=
"15sp"
tools:text=
"Feel Clean"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_uninstall"
android:layout_width=
"65dp"
android:layout_height=
"23dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:background=
"@drawable/bg_corners_3_4772ff"
android:gravity=
"center"
android:text=
"Uninstall"
android:textColor=
"@color/white"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
\ No newline at end of file
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