Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
FileManager
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
yanglin
FileManager
Commits
2f8a9c9e
Commit
2f8a9c9e
authored
Apr 16, 2024
by
yanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
杀毒页面完善_剩余完成页
parent
aedfbc72
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
226 additions
and
8 deletions
+226
-8
AndroidManifest.xml
MyDemo3/app/src/main/AndroidManifest.xml
+4
-0
ScanResultActivity.kt
...a/com/xm/test/myfilemaster/activity/ScanResultActivity.kt
+55
-2
ScanResultAdapter.kt
...ava/com/xm/test/myfilemaster/adapter/ScanResultAdapter.kt
+7
-2
AntivirusActivity.kt
...a/com/xm/test/myfilemaster/antivirus/AntivirusActivity.kt
+1
-0
CustomDialog.kt
...c/main/java/com/xm/test/myfilemaster/view/CustomDialog.kt
+6
-0
activity_scan_result.xml
MyDemo3/app/src/main/res/layout/activity_scan_result.xml
+11
-2
antivirus_success_layout.xml
MyDemo3/app/src/main/res/layout/antivirus_success_layout.xml
+140
-0
scan_result_list_item_layout.xml
.../app/src/main/res/layout/scan_result_list_item_layout.xml
+2
-2
identify.png
MyDemo3/app/src/main/res/mipmap-hdpi/identify.png
+0
-0
settle.png
MyDemo3/app/src/main/res/mipmap-hdpi/settle.png
+0
-0
identify.png
MyDemo3/app/src/main/res/mipmap-mdpi/identify.png
+0
-0
settle.png
MyDemo3/app/src/main/res/mipmap-mdpi/settle.png
+0
-0
identify.png
MyDemo3/app/src/main/res/mipmap-xhdpi/identify.png
+0
-0
settle.png
MyDemo3/app/src/main/res/mipmap-xhdpi/settle.png
+0
-0
identify.png
MyDemo3/app/src/main/res/mipmap-xxhdpi/identify.png
+0
-0
settle.png
MyDemo3/app/src/main/res/mipmap-xxhdpi/settle.png
+0
-0
identify.png
MyDemo3/app/src/main/res/mipmap-xxxhdpi/identify.png
+0
-0
settle.png
MyDemo3/app/src/main/res/mipmap-xxxhdpi/settle.png
+0
-0
No files found.
MyDemo3/app/src/main/AndroidManifest.xml
View file @
2f8a9c9e
...
...
@@ -11,6 +11,10 @@
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.DELETE_PACKAGES"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.REQUEST_DELETE_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.BATTERY_STATS"
tools:ignore=
"ProtectedPermissions"
/>
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/activity/ScanResultActivity.kt
View file @
2f8a9c9e
package
com.xm.test.myfilemaster.activity
import
android.content.Intent
import
android.content.pm.PackageManager
import
android.net.Uri
import
android.os.Bundle
import
android.view.View
import
android.widget.ImageView
...
...
@@ -20,12 +23,21 @@ class ScanResultActivity : AppCompatActivity() {
private
lateinit
var
mDeleteGroupView
:
View
private
lateinit
var
mGoItBtn
:
TextView
private
lateinit
var
mScanResultListLyout
:
View
private
lateinit
var
mAntivirusSuccessView
:
View
private
var
mScanResultAdapter
:
ScanResultAdapter
?
=
null
private
lateinit
var
mIdentifyText
:
TextView
private
lateinit
var
mSettleText
:
TextView
private
var
mCurrentAppInfo
:
AppInfo
?
=
null
private
var
mCurr
=
0
private
var
mIgnoreCount
=
0
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_scan_result
)
mResult
=
intent
.
getSerializableExtra
(
"result"
)
as
ArrayList
<
AppInfo
>
mCurr
=
intent
.
getIntExtra
(
"curr"
,
0
)
findViewById
<
TextView
>(
R
.
id
.
scan_result_secure_num_text
).
text
=
intent
.
getStringExtra
(
"total"
)
initView
()
setViewClickListener
()
...
...
@@ -37,7 +49,13 @@ class ScanResultActivity : AppCompatActivity() {
val
appIcon
=
findViewById
<
ImageView
>(
R
.
id
.
scan_app_info_icon
)
val
appName
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_name
)
val
appDate
=
findViewById
<
TextView
>(
R
.
id
.
scan_app_info_date
)
val
packageInfo
=
packageManager
.
getPackageInfo
(
mResult
!!
[
position
].
packageName
,
PackageManager
.
GET_META_DATA
)
appIcon
.
setImageDrawable
(
packageInfo
.
applicationInfo
.
loadIcon
(
packageManager
))
appName
.
text
=
mResult
!!
[
position
].
appName
mCurrentAppInfo
=
mResult
!!
[
position
]
// mResult!![position]
mAppinfoPage
.
visibility
=
View
.
VISIBLE
mDeleteGroupView
.
visibility
=
View
.
VISIBLE
...
...
@@ -50,17 +68,47 @@ class ScanResultActivity : AppCompatActivity() {
customDialog
.
setsCancel
(
View
.
OnClickListener
{
customDialog
.
dismiss
()
}).
setsConfirm
(
View
.
OnClickListener
{
Intent
(
Intent
.
ACTION_DELETE
,
Uri
.
parse
(
"package:${mCurrentAppInfo!!.packageName}"
))
startActivity
(
intent
)
mResult
?.
remove
(
mCurrentAppInfo
!!
)
}).
show
()
customDialog
.
isShowEditText
(
false
)
customDialog
.
setsTitle
(
"Delete"
)
customDialog
.
setsHint
(
"Do you want to uninstall this app?"
)
customDialog
.
setsRightDelete
(
"Delete"
)
}
findViewById
<
View
>(
R
.
id
.
scan_delete_ignore
).
setOnClickListener
{
val
customDialog
=
CustomDialog
(
this
)
customDialog
.
setsCancel
(
View
.
OnClickListener
{
customDialog
.
dismiss
()
}).
setsConfirm
(
View
.
OnClickListener
{
mIgnoreCount
++
mResult
?.
remove
(
mCurrentAppInfo
!!
)
mAppinfoPage
.
visibility
=
View
.
GONE
mDeleteGroupView
.
visibility
=
View
.
GONE
mGoItBtn
.
visibility
=
View
.
VISIBLE
mScanResultListLyout
.
visibility
=
View
.
VISIBLE
mScanResultAdapter
?.
notifyDataSetChanged
()
customDialog
.
dismiss
()
}).
show
()
customDialog
.
isShowEditText
(
false
)
// customDialog.setsTitle("Delete")
customDialog
.
setShowTitle
(
false
)
customDialog
.
setsHint
(
"Are you sure you want to ignore the app?"
)
customDialog
.
setRightBtnText
(
"Ignore"
)
}
findViewById
<
View
>(
R
.
id
.
antivirus_success_quit_btn
).
setOnClickListener
{
finish
()
}
findViewById
<
View
>(
R
.
id
.
scan_result_go_it_text
).
setOnClickListener
{
mSettleText
.
text
=
mIgnoreCount
.
toString
()
mAntivirusSuccessView
.
visibility
=
View
.
VISIBLE
}
findViewById
<
View
>(
R
.
id
.
scan_result_finish_text
).
setOnClickListener
{
finish
()
}
}
...
...
@@ -70,6 +118,11 @@ class ScanResultActivity : AppCompatActivity() {
mDeleteGroupView
=
findViewById
(
R
.
id
.
scan_result_delete_group_layout
)
mGoItBtn
=
findViewById
(
R
.
id
.
scan_result_go_it_text
)
mScanResultListLyout
=
findViewById
(
R
.
id
.
scan_result_list_layout
)
mAntivirusSuccessView
=
findViewById
(
R
.
id
.
antivirus_success_view
)
mIdentifyText
=
findViewById
(
R
.
id
.
identify_num_text
)
mSettleText
=
findViewById
(
R
.
id
.
settle_num_text
)
mIdentifyText
.
text
=
mCurr
.
toString
()
mScanResultAdapter
=
ScanResultAdapter
(
mResult
!!
,
this
)
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/adapter/ScanResultAdapter.kt
View file @
2f8a9c9e
package
com.xm.test.myfilemaster.adapter
import
android.content.Context
import
android.content.pm.PackageManager
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -48,9 +49,13 @@ class ScanResultAdapter(dataList: ArrayList<AppInfo>,
view
.
tag
=
viewHolder
}
viewHolder
.
appIcon
val
packageInfo
=
context
.
packageManager
.
getPackageInfo
(
dataList
[
position
].
packageName
,
PackageManager
.
GET_META_DATA
)
viewHolder
.
appIcon
.
setImageDrawable
(
packageInfo
.
applicationInfo
.
loadIcon
(
context
.
packageManager
))
viewHolder
.
appName
.
text
=
dataList
[
position
].
appName
viewHolder
.
appHint
.
text
=
dataList
[
position
].
virusName
viewHolder
.
appHint
.
text
=
dataList
[
position
].
virusName
.
toString
()
return
view
}
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/antivirus/AntivirusActivity.kt
View file @
2f8a9c9e
...
...
@@ -82,6 +82,7 @@ class AntivirusActivity : AppCompatActivity() {
Log
.
e
(
"yanglin"
,
"onScanProgress, "
+
"curr="
+
curr
+
" total="
+
total
+
" app name="
+
result
?.
appName
,
)
mScanAppNameText
.
text
=
result
?.
appName
mIntent
?.
putExtra
(
"curr"
,
curr
)
mProgress
.
setProgress
(
curr
)
mTotal
=
total
.
toString
()
...
...
MyDemo3/app/src/main/java/com/xm/test/myfilemaster/view/CustomDialog.kt
View file @
2f8a9c9e
...
...
@@ -63,12 +63,18 @@ class CustomDialog(context: Context?) : Dialog(context!!), View.OnClickListener{
findViewById
<
TextView
>(
R
.
id
.
dialog_hint_text
).
text
=
str
return
this
}
fun
setShowTitle
(
isShow
:
Boolean
){
mTitle
?.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
}
fun
setsRightDelete
(
str
:
String
):
CustomDialog
{
mSure
.
text
=
str
mSure
.
setTextColor
(
Color
.
RED
)
mSure
.
setBackgroundResource
(
R
.
drawable
.
bg_btn_cancel_shape
)
return
this
}
fun
setRightBtnText
(
str
:
String
){
mSure
.
text
=
str
}
fun
isShowEditText
(
isShow
:
Boolean
):
CustomDialog
{
mEdit
.
visibility
=
if
(
isShow
)
View
.
VISIBLE
else
View
.
GONE
return
this
...
...
MyDemo3/app/src/main/res/layout/activity_scan_result.xml
View file @
2f8a9c9e
...
...
@@ -90,8 +90,8 @@
<ImageView
android:id=
"@+id/scan_app_info_icon"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
60dp
"
android:layout_height=
"
60dp
"
android:src=
"@mipmap/scan_app_icon"
/>
<TextView
...
...
@@ -318,6 +318,15 @@ It is best to trust the app downloaded from the Play Store"/>
</LinearLayout>
<RelativeLayout
android:visibility=
"gone"
android:id=
"@+id/antivirus_success_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/antivirus_success_layout"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
MyDemo3/app/src/main/res/layout/antivirus_success_layout.xml
0 → 100644
View file @
2f8a9c9e
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:background=
"#F8F8F8"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/antivirus_success_quit_btn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_quit"
android:layout_margin=
"16dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_below=
"@id/antivirus_success_quit_btn"
>
<TextView
android:id=
"@+id/antivirus_scan_num_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"21dp"
android:textStyle=
"bold"
android:textColor=
"@color/black"
android:text=
"Application Scanning: 0"
/>
<RelativeLayout
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/image_1"
android:layout_width=
"wrap_content"
android:src=
"@mipmap/identify"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
/>
<TextView
android:layout_toRightOf=
"@+id/image_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Identify threats"
android:layout_marginStart=
"12dp"
android:layout_centerVertical=
"true"
android:textColor=
"#333333"
android:textSize=
"16dp"
/>
<TextView
android:id=
"@+id/identify_num_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_centerHorizontal=
"true"
android:text=
"22"
/>
</RelativeLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/black"
/>
<RelativeLayout
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/image_2"
android:layout_width=
"wrap_content"
android:src=
"@mipmap/settle"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
/>
<TextView
android:layout_toRightOf=
"@+id/image_2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"settle"
android:layout_marginStart=
"12dp"
android:layout_centerVertical=
"true"
android:textColor=
"#333333"
android:textSize=
"16dp"
/>
<TextView
android:id=
"@+id/settle_num_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_centerHorizontal=
"true"
android:text=
"0"
/>
</RelativeLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/black"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ad_group_layout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
android:layout_alignParentBottom=
"true"
>
<TextView
android:id=
"@+id/scan_result_finish_text"
android:layout_width=
"match_parent"
android:layout_height=
"34dp"
android:text=
"Finish"
android:textSize=
"19dp"
android:textStyle=
"bold"
android:gravity=
"center"
android:textColor=
"@color/white"
android:layout_marginStart=
"50dp"
android:layout_marginEnd=
"50dp"
android:layout_marginTop=
"16dp"
android:background=
"@drawable/bg_btn_sure_shape"
android:layout_marginBottom=
"16dp"
/>
<FrameLayout
android:layout_gravity=
"center_horizontal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ad"
/>
</FrameLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
MyDemo3/app/src/main/res/layout/scan_result_list_item_layout.xml
View file @
2f8a9c9e
...
...
@@ -5,8 +5,8 @@
<ImageView
android:id=
"@+id/scan_app_icon"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
60dp
"
android:layout_height=
"
60dp
"
android:src=
"@mipmap/scan_app_icon"
/>
<LinearLayout
android:layout_toRightOf=
"@+id/scan_app_icon"
...
...
MyDemo3/app/src/main/res/mipmap-hdpi/identify.png
0 → 100644
View file @
2f8a9c9e
866 Bytes
MyDemo3/app/src/main/res/mipmap-hdpi/settle.png
0 → 100644
View file @
2f8a9c9e
891 Bytes
MyDemo3/app/src/main/res/mipmap-mdpi/identify.png
0 → 100644
View file @
2f8a9c9e
491 Bytes
MyDemo3/app/src/main/res/mipmap-mdpi/settle.png
0 → 100644
View file @
2f8a9c9e
477 Bytes
MyDemo3/app/src/main/res/mipmap-xhdpi/identify.png
0 → 100644
View file @
2f8a9c9e
1.19 KB
MyDemo3/app/src/main/res/mipmap-xhdpi/settle.png
0 → 100644
View file @
2f8a9c9e
1.22 KB
MyDemo3/app/src/main/res/mipmap-xxhdpi/identify.png
0 → 100644
View file @
2f8a9c9e
2.32 KB
MyDemo3/app/src/main/res/mipmap-xxhdpi/settle.png
0 → 100644
View file @
2f8a9c9e
2.42 KB
MyDemo3/app/src/main/res/mipmap-xxxhdpi/identify.png
0 → 100644
View file @
2f8a9c9e
1.77 KB
MyDemo3/app/src/main/res/mipmap-xxxhdpi/settle.png
0 → 100644
View file @
2f8a9c9e
1.69 KB
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