Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
60c23e3a
Commit
60c23e3a
authored
Aug 23, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.0 开发 10 下载取消
parent
acd80b21
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
15 deletions
+31
-15
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
...a/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
+0
-2
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
...com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
+22
-11
app/src/main/res/layout/item_game.xml
app/src/main/res/layout/item_game.xml
+9
-2
app/src/main/res/mipmap-xxhdpi/download_concell.png
app/src/main/res/mipmap-xxhdpi/download_concell.png
+0
-0
No files found.
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
View file @
60c23e3a
...
@@ -53,7 +53,6 @@ object GameDownLoadManger {
...
@@ -53,7 +53,6 @@ object GameDownLoadManger {
if
(
file
.
exists
())
{
if
(
file
.
exists
())
{
// activity.context?.let { DownloadUtils.install(file.absolutePath, it) }
// activity.context?.let { DownloadUtils.install(file.absolutePath, it) }
file
.
delete
()
file
.
delete
()
return
}
}
downloadManager
=
downloadManager
=
activity
.
context
?.
getSystemService
(
Context
.
DOWNLOAD_SERVICE
)
as
DownloadManager
activity
.
context
?.
getSystemService
(
Context
.
DOWNLOAD_SERVICE
)
as
DownloadManager
...
@@ -119,7 +118,6 @@ object GameDownLoadManger {
...
@@ -119,7 +118,6 @@ object GameDownLoadManger {
downloadMap
.
remove
(
it
)
downloadMap
.
remove
(
it
)
}
}
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
e
.
printStackTrace
()
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
View file @
60c23e3a
...
@@ -18,6 +18,7 @@ import com.bumptech.glide.Glide
...
@@ -18,6 +18,7 @@ import com.bumptech.glide.Glide
import
com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.adapter.KotlinDataAdapter
import
com.ccwangluo.accelerator.adapter.KotlinDataAdapter
import
com.ccwangluo.accelerator.databinding.FragmentGameListBinding
import
com.ccwangluo.accelerator.databinding.FragmentGameListBinding
import
com.ccwangluo.accelerator.manager.DownloadUtils
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.manager.GameDownLoadManger.download
import
com.ccwangluo.accelerator.manager.GameDownLoadManger.download
import
com.ccwangluo.accelerator.manager.LoginUtils
import
com.ccwangluo.accelerator.manager.LoginUtils
...
@@ -260,6 +261,16 @@ class GameListFragment : XPageFragment() {
...
@@ -260,6 +261,16 @@ class GameListFragment : XPageFragment() {
tx_game_update_notice
.
setOnClickListener
{
tx_game_update_notice
.
setOnClickListener
{
download
(
itemData
)
download
(
itemData
)
}
}
progress_download
.
setOnClickListener
{
context
?.
let
{
CommonDialog
(
it
)
.
setContent
(
"确定要关闭下载任务吗? "
)
.
setBtnLeft
(
"取消"
)
{
}.
setBtnRight
(
"关闭"
)
{
GameDownLoadManger
.
cancellDownload
(
itemData
)
}.
show
<
CommonDialog
>()
}
}
}
}
.
create
()
.
create
()
gameListModel
.
freshData
(
this
,
page
)
gameListModel
.
freshData
(
this
,
page
)
...
@@ -326,17 +337,17 @@ class GameListFragment : XPageFragment() {
...
@@ -326,17 +337,17 @@ class GameListFragment : XPageFragment() {
Handler
(
Looper
.
getMainLooper
()).
post
{
Handler
(
Looper
.
getMainLooper
()).
post
{
gameInfo
?.
let
{
gameInfo
?.
let
{
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
game
?.
id
==
it
.
id
)
{
if
(
AcceleratorUtils
.
state
==
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
game
?.
id
==
it
.
id
)
{
context
?.
let
{
context
?.
let
{
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
.
setContent
(
"停止加速可能会导致游戏断线,是否确认停止?"
)
.
setContent
(
"停止加速可能会导致游戏断线,是否确认停止?"
)
.
setBtnLeft
(
"取消"
)
{
.
setBtnLeft
(
"取消"
)
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
}.
setBtnRight
(
"停止加速"
)
{
}.
setBtnRight
(
"停止加速"
)
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
AcceleratorUtils
.
stopAccelerator
({})
AcceleratorUtils
.
stopAccelerator
({})
}.
show
<
CommonDialog
>()
}.
show
<
CommonDialog
>()
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
}
}
else
{
}
else
{
startAccBtn
(
it
)
startAccBtn
(
it
)
}
}
...
...
app/src/main/res/layout/item_game.xml
View file @
60c23e3a
...
@@ -173,12 +173,19 @@
...
@@ -173,12 +173,19 @@
android:textSize=
"12.5sp"
/>
android:textSize=
"12.5sp"
/>
</LinearLayout>
</LinearLayout>
<
Linear
Layout
<
Relative
Layout
android:id=
"@+id/btn_download_status"
android:id=
"@+id/btn_download_status"
android:layout_width=
"90dp"
android:layout_width=
"90dp"
android:layout_height=
"30dp"
android:layout_height=
"30dp"
android:gravity=
"center"
android:gravity=
"center"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<com.xuexiang.xui.widget.imageview.RadiusImageView
android:id=
"@+id/progress_bg"
android:layout_width=
"21dp"
android:layout_height=
"21dp"
android:layout_centerInParent=
"true"
android:clickable=
"true"
app:srcCompat=
"@mipmap/download_concell"
/>
<com.xuexiang.xui.widget.progress.CircleProgressView
<com.xuexiang.xui.widget.progress.CircleProgressView
android:id=
"@+id/progress_download"
android:id=
"@+id/progress_download"
...
@@ -201,7 +208,7 @@
...
@@ -201,7 +208,7 @@
app:cpv_track_color=
"@color/divide_gray"
app:cpv_track_color=
"@color/divide_gray"
app:cpv_track_width=
"1.5dp"
/>
app:cpv_track_width=
"1.5dp"
/>
</
Linear
Layout>
</
Relative
Layout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/mipmap-xxhdpi/download_concell.png
0 → 100644
View file @
60c23e3a
1.07 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