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
e502bfc9
Commit
e502bfc9
authored
Sep 09, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.0 开发 增加打点
parent
0ff462a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
9 deletions
+42
-9
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
...a/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
+5
-2
app/src/main/java/com/ccwangluo/accelerator/ui/BottomNavigationFragment.kt
.../com/ccwangluo/accelerator/ui/BottomNavigationFragment.kt
+2
-2
app/src/main/java/com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
...com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
+4
-0
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
...com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
+29
-3
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
.../com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
+1
-1
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
...in/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
+1
-1
No files found.
app/src/main/java/com/ccwangluo/accelerator/manager/GameDownLoadManger.kt
View file @
e502bfc9
...
@@ -9,6 +9,7 @@ import android.os.Environment
...
@@ -9,6 +9,7 @@ import android.os.Environment
import
android.webkit.MimeTypeMap
import
android.webkit.MimeTypeMap
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.hjq.toast.ToastUtils
import
com.hjq.toast.ToastUtils
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xutil.system.PermissionUtils
import
com.xuexiang.xutil.system.PermissionUtils
...
@@ -81,16 +82,17 @@ object GameDownLoadManger {
...
@@ -81,16 +82,17 @@ object GameDownLoadManger {
var
downloadId
=
downloadManager
!!
.
enqueue
(
request
)
//加入队列,会返回一个唯一下载id
var
downloadId
=
downloadManager
!!
.
enqueue
(
request
)
//加入队列,会返回一个唯一下载id
downloadMap
.
put
(
downloadId
,
gameInfo
)
downloadMap
.
put
(
downloadId
,
gameInfo
)
gameDownloadListener
?.
onStart
(
gameInfo
)
gameDownloadListener
?.
onStart
(
gameInfo
)
show
(
activity
,
downloadId
)
show
(
activity
,
downloadId
,
gameInfo
)
}
}
fun
show
(
activity
:
XPageFragment
,
downloadId
:
Long
)
{
fun
show
(
activity
:
XPageFragment
,
downloadId
:
Long
,
gameInfo
:
GameInfo
)
{
activity
.
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
activity
.
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
var
progress
=
0F
var
progress
=
0F
while
(
progress
<
100F
)
{
while
(
progress
<
100F
)
{
progress
=
getDownloadProgress
(
downloadId
)
progress
=
getDownloadProgress
(
downloadId
)
delay
(
1000
)
delay
(
1000
)
}
}
DataRePortUtils
.
report
(
"st_pop_dld_result"
,
mapOf
(
"gameid"
to
gameInfo
.
id
.
toString
(),
"result"
to
1
))
withContext
(
Dispatchers
.
Main
)
{
withContext
(
Dispatchers
.
Main
)
{
gameDownloadListener
?.
onFinish
(
downloadMap
.
get
(
downloadId
))
gameDownloadListener
?.
onFinish
(
downloadMap
.
get
(
downloadId
))
downloadMap
.
remove
(
downloadId
)
downloadMap
.
remove
(
downloadId
)
...
@@ -116,6 +118,7 @@ object GameDownLoadManger {
...
@@ -116,6 +118,7 @@ object GameDownLoadManger {
downloadManager
?.
remove
(
it
)
downloadManager
?.
remove
(
it
)
gameDownloadListener
?.
onFinish
(
gameInfo
)
gameDownloadListener
?.
onFinish
(
gameInfo
)
downloadMap
.
remove
(
it
)
downloadMap
.
remove
(
it
)
DataRePortUtils
.
report
(
"st_pop_dld_result"
,
mapOf
(
"gameid"
to
gameInfo
.
id
.
toString
(),
"result"
to
0
))
}
}
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/BottomNavigationFragment.kt
View file @
e502bfc9
...
@@ -100,8 +100,8 @@ class BottomNavigationFragment : XPageFragment(), ViewPager.OnPageChangeListener
...
@@ -100,8 +100,8 @@ class BottomNavigationFragment : XPageFragment(), ViewPager.OnPageChangeListener
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
binding
.
viewPager
.
setCurrentItem
(
index
,
true
)
binding
.
viewPager
.
setCurrentItem
(
index
,
true
)
when
(
index
){
when
(
index
){
0
->
DataRePortUtils
.
report
(
"st_speed_tab_clk"
)
//
0 -> DataRePortUtils.report("st_speed_tab_clk")
1
->
DataRePortUtils
.
report
(
"st_msg_tab_clk"
)
1
->
DataRePortUtils
.
report
(
"st_msg_tab_cl
ic
k"
)
}
}
return
true
return
true
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/dialog/GameDownloadDialog.kt
View file @
e502bfc9
...
@@ -9,6 +9,7 @@ import com.ccwangluo.accelerator.R
...
@@ -9,6 +9,7 @@ import com.ccwangluo.accelerator.R
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.manager.GameDownLoadManger
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.model.GameInfo
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.umeng.socialize.utils.DeviceConfigInternal.context
import
com.umeng.socialize.utils.DeviceConfigInternal.context
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xpage.base.XPageFragment
import
com.xuexiang.xui.widget.dialog.materialdialog.CustomMaterialDialog
import
com.xuexiang.xui.widget.dialog.materialdialog.CustomMaterialDialog
...
@@ -50,6 +51,7 @@ class GameDownloadDialog(
...
@@ -50,6 +51,7 @@ class GameDownloadDialog(
appVersion
.
setText
(
"版本号:${version}"
)
appVersion
.
setText
(
"版本号:${version}"
)
val
btnLeft
=
findViewById
<
TextView
>(
R
.
id
.
btn_left
)
val
btnLeft
=
findViewById
<
TextView
>(
R
.
id
.
btn_left
)
btnLeft
.
setOnClickListener
{
btnLeft
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_pop_dld_cancel"
,
mapOf
(
"gameid"
to
gameInfo
.
id
.
toString
()))
dismiss
<
GameDownloadDialog
>()
dismiss
<
GameDownloadDialog
>()
}
}
...
@@ -59,6 +61,7 @@ class GameDownloadDialog(
...
@@ -59,6 +61,7 @@ class GameDownloadDialog(
val
btnRight
=
findViewById
<
TextView
>(
R
.
id
.
btn_right
)
val
btnRight
=
findViewById
<
TextView
>(
R
.
id
.
btn_right
)
btnRight
.
setOnClickListener
{
btnRight
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_pop_dld_clk"
,
mapOf
(
"gameid"
to
gameInfo
.
id
.
toString
()))
//流量下载提示
//流量下载提示
if
(
SysUtils
.
isMobileNet
())
{
if
(
SysUtils
.
isMobileNet
())
{
if
(
context
!=
null
)
{
if
(
context
!=
null
)
{
...
@@ -68,6 +71,7 @@ class GameDownloadDialog(
...
@@ -68,6 +71,7 @@ class GameDownloadDialog(
"将产生${gameInfo.size}的流量,是否继续?"
"将产生${gameInfo.size}的流量,是否继续?"
)
)
.
setBtnLeft
(
"取消"
)
{
.
setBtnLeft
(
"取消"
)
{
}.
setBtnRight
(
"继续"
)
{
}.
setBtnRight
(
"继续"
)
{
GameDownLoadManger
.
download
(
fragment
,
gameInfo
,
url
)
GameDownLoadManger
.
download
(
fragment
,
gameInfo
,
url
)
}.
show
<
CommonDialog
>()
}.
show
<
CommonDialog
>()
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
View file @
e502bfc9
...
@@ -121,12 +121,20 @@ class GameListFragment : XPageFragment() {
...
@@ -121,12 +121,20 @@ class GameListFragment : XPageFragment() {
game_notice_area_1
.
visibility
=
View
.
VISIBLE
game_notice_area_1
.
visibility
=
View
.
VISIBLE
game_notice_1_1
.
setText
(
announcement1
.
get
(
0
).
title
)
game_notice_1_1
.
setText
(
announcement1
.
get
(
0
).
title
)
game_notice_1_1
.
setOnClickListener
{
game_notice_1_1
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_loc_one_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
(),
"scene"
to
1
)
)
openNoticePage
(
itemData
,
announcement1
.
get
(
0
))
openNoticePage
(
itemData
,
announcement1
.
get
(
0
))
}
}
if
(
announcement1
.
size
>
1
)
{
if
(
announcement1
.
size
>
1
)
{
game_notice_1_2
.
visibility
=
View
.
VISIBLE
game_notice_1_2
.
visibility
=
View
.
VISIBLE
game_notice_1_2
.
setText
(
announcement1
.
get
(
1
).
title
)
game_notice_1_2
.
setText
(
announcement1
.
get
(
1
).
title
)
game_notice_1_2
.
setOnClickListener
{
game_notice_1_2
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_loc_one_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
(),
"scene"
to
2
)
)
openNoticePage
(
itemData
,
announcement1
.
get
(
1
))
openNoticePage
(
itemData
,
announcement1
.
get
(
1
))
}
}
}
else
{
}
else
{
...
@@ -136,6 +144,10 @@ class GameListFragment : XPageFragment() {
...
@@ -136,6 +144,10 @@ class GameListFragment : XPageFragment() {
game_notice_1_3
.
visibility
=
View
.
VISIBLE
game_notice_1_3
.
visibility
=
View
.
VISIBLE
game_notice_1_3
.
setText
(
announcement1
.
get
(
2
).
title
)
game_notice_1_3
.
setText
(
announcement1
.
get
(
2
).
title
)
game_notice_1_3
.
setOnClickListener
{
game_notice_1_3
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_loc_one_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
(),
"scene"
to
3
)
)
openNoticePage
(
itemData
,
announcement1
.
get
(
2
))
openNoticePage
(
itemData
,
announcement1
.
get
(
2
))
}
}
}
else
{
}
else
{
...
@@ -152,6 +164,10 @@ class GameListFragment : XPageFragment() {
...
@@ -152,6 +164,10 @@ class GameListFragment : XPageFragment() {
game_notice_area_2
.
visibility
=
View
.
VISIBLE
game_notice_area_2
.
visibility
=
View
.
VISIBLE
game_notice_2_1
.
setText
(
HtmlUtil
.
getTextFromHtml
(
announcement2
.
get
(
0
).
content
))
game_notice_2_1
.
setText
(
HtmlUtil
.
getTextFromHtml
(
announcement2
.
get
(
0
).
content
))
game_notice_area_2
.
setOnClickListener
{
game_notice_area_2
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_loc_two_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
())
)
openNoticePage
(
itemData
,
announcement2
.
get
(
0
))
openNoticePage
(
itemData
,
announcement2
.
get
(
0
))
}
}
}
}
...
@@ -239,6 +255,10 @@ class GameListFragment : XPageFragment() {
...
@@ -239,6 +255,10 @@ class GameListFragment : XPageFragment() {
}
}
btn_uninstall
.
setOnClickListener
{
btn_uninstall
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_ic_noinstl_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
())
)
download
(
itemData
)
download
(
itemData
)
}
}
...
@@ -248,6 +268,10 @@ class GameListFragment : XPageFragment() {
...
@@ -248,6 +268,10 @@ class GameListFragment : XPageFragment() {
}
}
btn_acc
.
setOnClickListener
{
btn_acc
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
"1"
,
"gameid"
to
itemData
.
id
.
toString
())
)
startAccBtn
(
itemData
)
startAccBtn
(
itemData
)
}
}
...
@@ -324,7 +348,6 @@ class GameListFragment : XPageFragment() {
...
@@ -324,7 +348,6 @@ class GameListFragment : XPageFragment() {
private
val
CLICK_START_ACC_REQUEST_CODE
:
Int
=
100
;
private
val
CLICK_START_ACC_REQUEST_CODE
:
Int
=
100
;
private
fun
openWebviewForResult
(
url
:
String
,
itemData
:
GameInfo
)
{
private
fun
openWebviewForResult
(
url
:
String
,
itemData
:
GameInfo
)
{
gameInfo
=
itemData
gameInfo
=
itemData
DataRePortUtils
.
report
(
"st_ic_game_clk"
,)
PageOption
.
to
(
CommonWebViewFragment
::
class
.
java
)
PageOption
.
to
(
CommonWebViewFragment
::
class
.
java
)
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
HttpConfig
.
UI_MAIN_URL
+
url
)
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
HttpConfig
.
UI_MAIN_URL
+
url
)
.
putInt
(
CommonWebViewFragment
.
GAME_ID
,
itemData
.
id
)
.
putInt
(
CommonWebViewFragment
.
GAME_ID
,
itemData
.
id
)
...
@@ -351,7 +374,10 @@ class GameListFragment : XPageFragment() {
...
@@ -351,7 +374,10 @@ class GameListFragment : XPageFragment() {
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
}
}
else
{
}
else
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
6
))
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
"6"
,
"gameid"
to
gameInfo
?.
id
.
toString
())
)
startAccBtn
(
it
)
startAccBtn
(
it
)
}
}
}
}
...
@@ -360,7 +386,6 @@ class GameListFragment : XPageFragment() {
...
@@ -360,7 +386,6 @@ class GameListFragment : XPageFragment() {
}
}
private
fun
startAccBtn
(
itemData
:
GameInfo
)
{
private
fun
startAccBtn
(
itemData
:
GameInfo
)
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
1
))
LoginUtils
.
token
?.
let
{
LoginUtils
.
token
?.
let
{
startAccPage
(
itemData
)
startAccPage
(
itemData
)
}
?:
let
{
}
?:
let
{
...
@@ -392,6 +417,7 @@ class GameListFragment : XPageFragment() {
...
@@ -392,6 +417,7 @@ class GameListFragment : XPageFragment() {
}
}
}
else
{
}
else
{
DataRePortUtils
.
report
(
"st_ic_game_clk"
,
mapOf
(
"gameid"
to
itemData
.
id
.
toString
()))
AcceleratorUtils
.
setGameInfo
(
itemData
)
AcceleratorUtils
.
setGameInfo
(
itemData
)
openPage
(
AcceleratorFragment
::
class
.
java
)
openPage
(
AcceleratorFragment
::
class
.
java
)
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
View file @
e502bfc9
...
@@ -229,7 +229,7 @@ class AcceleratorFragment : XPageFragment() {
...
@@ -229,7 +229,7 @@ class AcceleratorFragment : XPageFragment() {
DataRePortUtils
.
report
(
"st_speed_stop_clk"
)
DataRePortUtils
.
report
(
"st_speed_stop_clk"
)
return
@setOnClickListener
return
@setOnClickListener
}
else
{
}
else
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
2
))
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
"2"
,
"gameid"
to
gameInfo
?.
id
.
toString
()
))
}
}
}
}
startBtnClick
()
startBtnClick
()
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
View file @
e502bfc9
...
@@ -64,7 +64,7 @@ class NewsFragment : XPageFragment() {
...
@@ -64,7 +64,7 @@ class NewsFragment : XPageFragment() {
binding
.
tvMarquee
.
addDisplayString
(
it1
.
title
)
binding
.
tvMarquee
.
addDisplayString
(
it1
.
title
)
binding
.
tvMarquee
.
startRoll
()
binding
.
tvMarquee
.
startRoll
()
binding
.
newsNotice
.
setOnClickListener
{
binding
.
newsNotice
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_msg_annoucement_clk"
)
DataRePortUtils
.
report
(
"st_msg_annoucement_clk"
,
mapOf
(
"gameid"
to
GAME_ID
.
toString
())
)
openToWebviewNative
(
"/notice?noticeId=${it1.id}"
)
openToWebviewNative
(
"/notice?noticeId=${it1.id}"
)
}
}
}
}
...
...
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