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
0ff462a9
Commit
0ff462a9
authored
Aug 31, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.0 开发 11 切换app支付
parent
05738987
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
25 deletions
+30
-25
app/src/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
...rc/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
+0
-1
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
...com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
+5
-0
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
.../com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
+22
-21
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
...n/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
+1
-1
buildSrc/src/main/kotlin/Helpers.kt
buildSrc/src/main/kotlin/Helpers.kt
+2
-2
No files found.
app/src/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
View file @
0ff462a9
...
@@ -99,7 +99,6 @@ class MainActivity() : XPageActivity() {
...
@@ -99,7 +99,6 @@ class MainActivity() : XPageActivity() {
DataRePortUtils
.
report
(
"start_app"
)
DataRePortUtils
.
report
(
"start_app"
)
SettingSPUtils
.
lastAPPOpenReportTime
=
System
.
currentTimeMillis
()
SettingSPUtils
.
lastAPPOpenReportTime
=
System
.
currentTimeMillis
()
}
}
DataRePortUtils
.
report
(
"st_app_open"
)
PermissionUtils
.
permission
(
PermissionUtils
.
permission
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/gameList/GameListFragment.kt
View file @
0ff462a9
...
@@ -76,6 +76,7 @@ class GameListFragment : XPageFragment() {
...
@@ -76,6 +76,7 @@ class GameListFragment : XPageFragment() {
dataList
.
clear
()
dataList
.
clear
()
}
}
}
}
DataRePortUtils
.
report
(
"st_app_open"
)
gameListModel
.
gameModel
.
observe
(
this
)
{
gameListModel
.
gameModel
.
observe
(
this
)
{
total
=
it
.
total
total
=
it
.
total
it
.
list
?.
let
{
it1
->
dataList
.
addAll
(
it1
)
}
it
.
list
?.
let
{
it1
->
dataList
.
addAll
(
it1
)
}
...
@@ -323,6 +324,7 @@ class GameListFragment : XPageFragment() {
...
@@ -323,6 +324,7 @@ 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
)
...
@@ -349,6 +351,7 @@ class GameListFragment : XPageFragment() {
...
@@ -349,6 +351,7 @@ 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
))
startAccBtn
(
it
)
startAccBtn
(
it
)
}
}
}
}
...
@@ -357,9 +360,11 @@ class GameListFragment : XPageFragment() {
...
@@ -357,9 +360,11 @@ 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
{
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"4"
))
context
?.
let
{
it1
->
context
?.
let
{
it1
->
LoginUtils
.
login
(
it1
)
{
LoginUtils
.
login
(
it1
)
{
if
(
it
)
{
if
(
it
)
{
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/AcceleratorFragment.kt
View file @
0ff462a9
...
@@ -213,6 +213,25 @@ class AcceleratorFragment : XPageFragment() {
...
@@ -213,6 +213,25 @@ class AcceleratorFragment : XPageFragment() {
}
}
}
}
binding
.
btnQuick
.
setOnClickListener
{
binding
.
btnQuick
.
setOnClickListener
{
AcceleratorUtils
.
state
.
let
{
if
(
it
.
canStop
)
{
context
?.
let
{
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
.
setContent
(
"停止加速可能会导致游戏断线,是否确认停止?"
)
.
setBtnLeft
(
"取消"
,
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
}).
setBtnRight
(
"停止加速"
,
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
AcceleratorUtils
.
stopAccelerator
({})
}).
show
<
CommonDialog
>()
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
DataRePortUtils
.
report
(
"st_speed_stop_clk"
)
return
@setOnClickListener
}
else
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
,
mapOf
(
"scene"
to
2
))
}
}
startBtnClick
()
startBtnClick
()
}
}
...
@@ -246,30 +265,12 @@ class AcceleratorFragment : XPageFragment() {
...
@@ -246,30 +265,12 @@ class AcceleratorFragment : XPageFragment() {
}
}
if
(
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Stopping
)
{
if
(
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Connected
&&
AcceleratorUtils
.
state
!=
BaseService
.
State
.
Stopping
)
{
binding
.
btnQuick
.
perform
Click
()
startBtn
Click
()
}
}
}
}
fun
startBtnClick
()
{
fun
startBtnClick
()
{
AcceleratorUtils
.
state
.
let
{
if
(
it
.
canStop
)
{
context
?.
let
{
CommonDialog
(
it
).
setTitle
(
"加速停止确认"
)
.
setContent
(
"停止加速可能会导致游戏断线,是否确认停止?"
)
.
setBtnLeft
(
"取消"
,
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_cancel_clk"
)
}).
setBtnRight
(
"停止加速"
,
{
DataRePortUtils
.
report
(
"st_speed_stop_pop_ok_clk"
)
AcceleratorUtils
.
stopAccelerator
({})
}).
show
<
CommonDialog
>()
DataRePortUtils
.
report
(
"st_speed_stop_pop_show"
)
}
DataRePortUtils
.
report
(
"st_speed_stop_clk"
)
return
}
else
{
DataRePortUtils
.
report
(
"st_speed_start_clk"
)
}
}
gameInfo
?.
let
{
AcceleratorUtils
.
setGameInfo
(
it
)
}
gameInfo
?.
let
{
AcceleratorUtils
.
setGameInfo
(
it
)
}
context
?.
let
{
it1
->
AcceleratorUtils
.
openLocation
(
it1
)
}
context
?.
let
{
it1
->
AcceleratorUtils
.
openLocation
(
it1
)
}
if
(!
LoginUtils
.
hasToken
())
{
if
(!
LoginUtils
.
hasToken
())
{
...
@@ -278,7 +279,7 @@ class AcceleratorFragment : XPageFragment() {
...
@@ -278,7 +279,7 @@ class AcceleratorFragment : XPageFragment() {
})
})
}
}
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"
3
"
))
DataRePortUtils
.
report
(
"st_speed_result"
,
mapOf
(
"result"
to
0
,
"cause"
to
"
4
"
))
return
return
}
}
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
View file @
0ff462a9
...
@@ -21,7 +21,7 @@ class NewsViewModel : ViewModel() {
...
@@ -21,7 +21,7 @@ class NewsViewModel : ViewModel() {
fun
getNotice
(
gameId
:
Int
)
{
fun
getNotice
(
gameId
:
Int
)
{
viewModelScope
.
launch
(
Dispatchers
.
IO
)
{
viewModelScope
.
launch
(
Dispatchers
.
IO
)
{
val
res
=
val
res
=
HttpGo
.
getSync
<
NoticeList
>(
"/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}&addrType=
1
"
)
HttpGo
.
getSync
<
NoticeList
>(
"/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}&addrType=
2
"
)
res
?.
let
{
res
?.
let
{
if
(
it
.
code
==
200
)
{
if
(
it
.
code
==
200
)
{
it
.
data
?.
list
?.
let
{
it
.
data
?.
list
?.
let
{
...
...
buildSrc/src/main/kotlin/Helpers.kt
View file @
0ff462a9
...
@@ -56,8 +56,8 @@ fun Project.setupCore() {
...
@@ -56,8 +56,8 @@ fun Project.setupCore() {
setupCommon
()
setupCommon
()
android
.
apply
{
android
.
apply
{
defaultConfig
{
defaultConfig
{
versionCode
=
1
versionCode
=
4
versionName
=
"1.
0
.0"
versionName
=
"1.
1
.0"
}
}
compileOptions
.
isCoreLibraryDesugaringEnabled
=
true
compileOptions
.
isCoreLibraryDesugaringEnabled
=
true
lintOptions
{
lintOptions
{
...
...
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