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
3084da4b
Commit
3084da4b
authored
Apr 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
病毒扫描
parent
48e4d96a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
57 deletions
+53
-57
AntivirusActivity.kt
...in/java/com/xm/test/myfile/antivirus/AntivirusActivity.kt
+13
-16
activity_antivirus.xml
app/src/main/res/layout/activity_antivirus.xml
+40
-41
No files found.
app/src/main/java/com/xm/test/myfile/antivirus/AntivirusActivity.kt
View file @
3084da4b
...
@@ -26,10 +26,7 @@ import com.xm.test.myfile.databinding.ActivityAntivirusBinding
...
@@ -26,10 +26,7 @@ import com.xm.test.myfile.databinding.ActivityAntivirusBinding
class
AntivirusActivity
:
AppCompatActivity
()
{
class
AntivirusActivity
:
AppCompatActivity
()
{
private
lateinit
var
mProgress
:
ProgressBar
private
lateinit
var
mProgress
:
ProgressBar
private
lateinit
var
mScaningView
:
View
private
lateinit
var
mScanSuccessView
:
View
private
lateinit
var
mScanAppNameText
:
TextView
private
lateinit
var
mScanAppNameText
:
TextView
private
var
mIntent
:
Intent
?
=
null
private
var
mTotal
=
"22"
private
var
mTotal
=
"22"
private
lateinit
var
binding
:
ActivityAntivirusBinding
private
lateinit
var
binding
:
ActivityAntivirusBinding
private
val
AGREE_VIRUS_PRIVACY_KEY
=
booleanPreferencesKey
(
"agree_virus_privacy"
)
private
val
AGREE_VIRUS_PRIVACY_KEY
=
booleanPreferencesKey
(
"agree_virus_privacy"
)
...
@@ -38,13 +35,12 @@ class AntivirusActivity : AppCompatActivity() {
...
@@ -38,13 +35,12 @@ class AntivirusActivity : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
binding
=
ActivityAntivirusBinding
.
inflate
(
layoutInflater
)
binding
=
ActivityAntivirusBinding
.
inflate
(
layoutInflater
)
setContentView
(
binding
.
root
)
setContentView
(
binding
.
root
)
mIntent
=
Intent
(
this
,
ScanResultActivity
::
class
.
java
)
initView
()
initView
()
setOnclickListener
()
setOnclickListener
()
val
isAgree
=
queryDataStoreBlock
(
AGREE_VIRUS_PRIVACY_KEY
,
false
)
val
isAgree
=
queryDataStoreBlock
(
AGREE_VIRUS_PRIVACY_KEY
,
false
)
if
(
isAgree
)
{
if
(
isAgree
)
{
binding
.
llVirusScan
.
visibility
=
View
.
VISIBL
E
binding
.
flVirusPrivacy
.
visibility
=
View
.
GON
E
startAntivirus
()
startAntivirus
()
}
else
{
}
else
{
binding
.
flVirusPrivacy
.
visibility
=
View
.
VISIBLE
binding
.
flVirusPrivacy
.
visibility
=
View
.
VISIBLE
...
@@ -73,12 +69,13 @@ class AntivirusActivity : AppCompatActivity() {
...
@@ -73,12 +69,13 @@ class AntivirusActivity : AppCompatActivity() {
private
fun
initView
()
{
private
fun
initView
()
{
mProgress
=
findViewById
(
R
.
id
.
antivirus_progress
)
mProgress
=
findViewById
(
R
.
id
.
antivirus_progress
)
mScaningView
=
findViewById
(
R
.
id
.
scan_ing_layout
)
mScanSuccessView
=
findViewById
(
R
.
id
.
antivirus_success_layout
)
mScanAppNameText
=
findViewById
(
R
.
id
.
scan_name_text
)
mScanAppNameText
=
findViewById
(
R
.
id
.
scan_name_text
)
}
}
private
fun
startAntivirus
()
{
private
fun
startAntivirus
()
{
val
mIntent
=
Intent
(
this
,
ScanResultActivity
::
class
.
java
)
MaxAdUtils
.
showMaxNativeAd
(
null
,
binding
.
flAd
)
binding
.
llScaning
.
visibility
=
View
.
VISIBLE
MyApplication
.
mCloudScan
?.
startQuickScan
(
object
:
CloudScanListener
()
{
MyApplication
.
mCloudScan
?.
startQuickScan
(
object
:
CloudScanListener
()
{
override
fun
onScanStarted
()
{
override
fun
onScanStarted
()
{
Log
.
e
(
"yanglin"
,
"onScanStarted: start"
)
Log
.
e
(
"yanglin"
,
"onScanStarted: start"
)
...
@@ -91,8 +88,8 @@ class AntivirusActivity : AppCompatActivity() {
...
@@ -91,8 +88,8 @@ class AntivirusActivity : AppCompatActivity() {
result
?.
appName
,
result
?.
appName
,
)
)
mScanAppNameText
.
text
=
result
?.
appName
mScanAppNameText
.
text
=
result
?.
appName
mIntent
?
.
putExtra
(
"curr"
,
curr
)
mIntent
.
putExtra
(
"curr"
,
curr
)
mProgress
.
setProgress
(
curr
)
mProgress
.
progress
=
curr
mTotal
=
total
.
toString
()
mTotal
=
total
.
toString
()
}
}
...
@@ -112,25 +109,25 @@ class AntivirusActivity : AppCompatActivity() {
...
@@ -112,25 +109,25 @@ class AntivirusActivity : AppCompatActivity() {
override
fun
onScanFinished
(
result
:
MutableList
<
AppInfo
>?)
{
override
fun
onScanFinished
(
result
:
MutableList
<
AppInfo
>?)
{
Log
.
e
(
"yanglin"
,
"onScanFinished: start"
+
result
!!
[
0
].
toString
())
Log
.
e
(
"yanglin"
,
"onScanFinished: start"
+
result
!!
[
0
].
toString
())
mProgress
.
setProgress
(
100
)
mProgress
.
setProgress
(
100
)
mScaningView
.
visibility
=
View
.
GONE
binding
.
llScaning
.
visibility
=
View
.
GONE
mScanSuccessView
.
visibility
=
View
.
VISIBLE
binding
.
llScanResult
.
visibility
=
View
.
VISIBLE
val
appInfos
=
ArrayList
<
AppInfo
>()
val
appInfos
=
ArrayList
<
AppInfo
>()
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
bundle
.
putSerializable
(
"result"
,
appInfos
)
bundle
.
putSerializable
(
"result"
,
appInfos
)
mIntent
?
.
putExtra
(
"total"
,
mTotal
)
mIntent
.
putExtra
(
"total"
,
mTotal
)
for
(
appInfo
in
result
)
{
for
(
appInfo
in
result
)
{
appInfos
.
add
(
appInfo
)
appInfos
.
add
(
appInfo
)
}
}
Thread
{
Thread
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
mIntent
?
.
putExtras
(
bundle
)
mIntent
.
putExtras
(
bundle
)
startActivity
(
mIntent
)
//
startActivity(mIntent)
finish
()
//
finish()
},
2000
)
},
2000
)
}.
start
()
}.
start
()
}
}
})
})
MaxAdUtils
.
showMaxNativeAd
(
null
,
binding
.
flAd
)
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_antivirus.xml
View file @
3084da4b
...
@@ -117,6 +117,7 @@
...
@@ -117,6 +117,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:text=
"Trustlook's Privacy Policy"
android:text=
"Trustlook's Privacy Policy"
android:textColor=
"@color/style_background"
android:textColor=
"@color/style_background"
android:textSize=
"19sp"
android:textSize=
"19sp"
...
@@ -142,7 +143,7 @@
...
@@ -142,7 +143,7 @@
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_marginStart=
"50dp"
android:layout_marginStart=
"50dp"
android:layout_marginEnd=
"50dp"
android:layout_marginEnd=
"50dp"
android:layout_marginBottom=
"
16
dp"
android:layout_marginBottom=
"
24
dp"
android:background=
"@drawable/bg_btn_sure_shape"
android:background=
"@drawable/bg_btn_sure_shape"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"Start scanning"
android:text=
"Start scanning"
...
@@ -160,8 +161,7 @@
...
@@ -160,8 +161,7 @@
android:id=
"@+id/ll_virus_scan"
android:id=
"@+id/ll_virus_scan"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:orientation=
"vertical"
>
android:visibility=
"gone"
>
<ImageView
<ImageView
android:id=
"@+id/iv_back_2"
android:id=
"@+id/iv_back_2"
...
@@ -174,18 +174,20 @@
...
@@ -174,18 +174,20 @@
<ScrollView
<ScrollView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_cont
ent"
>
android:layout_height=
"
match_par
ent"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<!--扫描过程UI -->
<LinearLayout
<LinearLayout
android:id=
"@+id/
scan_ing_layout
"
android:id=
"@+id/
ll_scaning
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:visibility=
"gone"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -200,9 +202,10 @@
...
@@ -200,9 +202,10 @@
<RelativeLayout
<RelativeLayout
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"389dp"
android:layout_height=
"389dp"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginHorizontal=
"16dp"
android:background=
"@mipmap/antivirus_image"
>
android:background=
"@mipmap/antivirus_image"
>
<TextView
<TextView
...
@@ -231,9 +234,8 @@
...
@@ -231,9 +234,8 @@
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"15dp"
android:layout_height=
"15dp"
android:layout_margin
Start
=
"16dp"
android:layout_margin
Horizontal
=
"16dp"
android:layout_marginTop=
"24dp"
android:layout_marginTop=
"24dp"
android:layout_marginEnd=
"16dp"
android:progress=
"20"
android:progress=
"20"
android:progressDrawable=
"@drawable/progress_bg"
/>
android:progressDrawable=
"@drawable/progress_bg"
/>
...
@@ -249,60 +251,57 @@
...
@@ -249,60 +251,57 @@
android:textStyle=
"bold"
android:textStyle=
"bold"
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/power_by_trust_look"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
android:text=
"Powered By Trustlook"
android:textColor=
"@color/style_background"
android:textSize=
"16sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
<RelativeLayout
<!--扫描结果UI-->
android:id=
"@+id/antivirus_success_layout"
<LinearLayout
android:id=
"@+id/ll_scan_result"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:visibility=
"gone"
>
android:visibility=
"gone"
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_gravity=
"center"
android:layout_marginVertical=
"150dp"
android:src=
"@mipmap/wancheng"
android:src=
"@mipmap/wancheng"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<ProgressBar
<ProgressBar
android:layout_width=
"54dp"
android:layout_width=
"54dp"
android:layout_height=
"54dp"
android:layout_height=
"54dp"
android:layout_
alignParentBottom=
"true
"
android:layout_
gravity=
"center_horizontal|bottom
"
android:layout_
centerHorizontal=
"true
"
android:layout_
marginBottom=
"25dp
"
android:progressTint=
"@color/style_background"
/>
android:progressTint=
"@color/style_background"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ad_group_layout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables,UselessParent"
>
<TextView
android:id=
"@+id/power_by_trust_look"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"16dp"
android:text=
"Powered By Trustlook"
android:textColor=
"@color/style_background"
android:textSize=
"16sp"
tools:ignore=
"HardcodedText"
/>
<FrameLayout
<FrameLayout
android:id=
"@+id/fl_ad"
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginVertical=
"8dp"
android:minHeight=
"120dp"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</ScrollView>
...
...
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