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
7577d189
Commit
7577d189
authored
Mar 17, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公告点击事件
parent
1bdd68a7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
41 deletions
+57
-41
app/src/main/java/com/ccwangluo/accelerator/model/Notice.kt
app/src/main/java/com/ccwangluo/accelerator/model/Notice.kt
+2
-1
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
...in/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
+47
-34
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
...n/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
+4
-2
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
+4
-4
No files found.
app/src/main/java/com/ccwangluo/accelerator/model/Notice.kt
View file @
7577d189
...
@@ -6,5 +6,6 @@ data class Notice(
...
@@ -6,5 +6,6 @@ data class Notice(
val
createdDate
:
String
?,
val
createdDate
:
String
?,
val
gameId
:
Int
?,
val
gameId
:
Int
?,
val
id
:
Int
?,
val
id
:
Int
?,
val
title
:
String
?
val
title
:
String
?,
val
url
:
String
)
)
\ No newline at end of file
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsFragment.kt
View file @
7577d189
...
@@ -19,8 +19,10 @@ import com.ccwangluo.accelerator.model.Plugin
...
@@ -19,8 +19,10 @@ import com.ccwangluo.accelerator.model.Plugin
import
com.ccwangluo.accelerator.ui.news.NewsCollectionAdapter
import
com.ccwangluo.accelerator.ui.news.NewsCollectionAdapter
import
com.ccwangluo.accelerator.ui.web.CommonWebViewFragment
import
com.ccwangluo.accelerator.ui.web.CommonWebViewFragment
import
com.ccwangluo.accelerator.utils.AcceleratorUtils
import
com.ccwangluo.accelerator.utils.AcceleratorUtils
import
com.ccwangluo.accelerator.utils.LoginUtils
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.SysUtils
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.github.shadowsocks.http.HttpConfig
import
com.google.android.material.appbar.AppBarLayout
import
com.google.android.material.appbar.AppBarLayout
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayout
import
com.google.android.material.tabs.TabLayoutMediator
import
com.google.android.material.tabs.TabLayoutMediator
...
@@ -48,13 +50,20 @@ class NewsFragment : XPageFragment() {
...
@@ -48,13 +50,20 @@ class NewsFragment : XPageFragment() {
val
titles
=
arrayOf
(
"全部"
,
"攻略"
,
"视频"
,
"评价"
,
"问答"
)
val
titles
=
arrayOf
(
"全部"
,
"攻略"
,
"视频"
,
"评价"
,
"问答"
)
var
adapter
:
NewsCollectionAdapter
?
=
null
var
adapter
:
NewsCollectionAdapter
?
=
null
override
fun
initViews
()
{
override
fun
initViews
()
{
newsViewModel
.
notice
.
observe
(
this
,
{
newsViewModel
.
notice
.
observe
(
this
)
{
it1
->
binding
.
newsNotice
.
visibility
=
View
.
VISIBLE
binding
.
newsNotice
.
visibility
=
View
.
VISIBLE
it
.
forEach
{
binding
.
tvMarquee
.
addDisplayString
(
it1
.
title
)
binding
.
tvMarquee
.
addDisplayString
(
it
.
title
)
}
binding
.
tvMarquee
.
startRoll
()
binding
.
tvMarquee
.
startRoll
()
})
binding
.
newsNotice
.
setOnClickListener
{
DataRePortUtils
.
report
(
"st_msg_annoucement_clk"
)
val
params
=
Bundle
()
params
.
putString
(
CommonWebViewFragment
.
WEBVIEW_URL_KEY
,
it1
.
url
)
openPage
(
CommonWebViewFragment
::
class
.
java
,
params
)
}
}
newsViewModel
.
isRefresh
.
observe
(
this
,
Observer
{
newsViewModel
.
isRefresh
.
observe
(
this
,
Observer
{
binding
.
refreshNews
.
isRefreshing
=
false
binding
.
refreshNews
.
isRefreshing
=
false
...
@@ -87,6 +96,9 @@ class NewsFragment : XPageFragment() {
...
@@ -87,6 +96,9 @@ class NewsFragment : XPageFragment() {
}
}
itemView
.
findViewById
<
TextView
>(
R
.
id
.
plugin_name
).
setText
(
itemData
.
name
)
itemView
.
findViewById
<
TextView
>(
R
.
id
.
plugin_name
).
setText
(
itemData
.
name
)
itemView
.
setOnClickListener
{
itemView
.
setOnClickListener
{
if
(
itemData
.
type
==
3
)
{
DataRePortUtils
.
report
(
"st_game_down_clk"
,
mapOf
(
"scene"
to
"3"
))
}
if
(!
itemData
.
isOpen
)
{
if
(!
itemData
.
isOpen
)
{
ToastUtils
.
show
(
"暂不支持${itemData.name}"
)
ToastUtils
.
show
(
"暂不支持${itemData.name}"
)
return
@setOnClickListener
return
@setOnClickListener
...
@@ -108,6 +120,7 @@ class NewsFragment : XPageFragment() {
...
@@ -108,6 +120,7 @@ class NewsFragment : XPageFragment() {
if
(
itemData
.
type
==
3
)
{
if
(
itemData
.
type
==
3
)
{
itemData
.
url
?.
let
{
itemData
.
url
?.
let
{
DataRePortUtils
.
report
(
"st_game_down_clk"
,
mapOf
(
"scene"
to
"3"
))
context
?.
let
{
it1
->
context
?.
let
{
it1
->
SysUtils
.
downloadFile
(
it1
,
it
)
SysUtils
.
downloadFile
(
it1
,
it
)
ToastUtils
.
show
(
"开始下载"
)
ToastUtils
.
show
(
"开始下载"
)
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/home/NewsViewModel.kt
View file @
7577d189
...
@@ -15,7 +15,7 @@ class NewsViewModel : ViewModel() {
...
@@ -15,7 +15,7 @@ class NewsViewModel : ViewModel() {
val
isRefresh
=
MutableLiveData
<
Boolean
>()
val
isRefresh
=
MutableLiveData
<
Boolean
>()
val
notice
=
MutableLiveData
<
List
<
Notice
>
>()
val
notice
=
MutableLiveData
<
Notice
>()
val
pluginList
=
MutableLiveData
<
List
<
Plugin
>>()
val
pluginList
=
MutableLiveData
<
List
<
Plugin
>>()
...
@@ -26,7 +26,9 @@ class NewsViewModel : ViewModel() {
...
@@ -26,7 +26,9 @@ class NewsViewModel : ViewModel() {
res
?.
let
{
res
?.
let
{
if
(
it
.
code
==
200
)
{
if
(
it
.
code
==
200
)
{
it
.
data
?.
list
?.
let
{
it
.
data
?.
list
?.
let
{
notice
.
postValue
(
it
)
if
(
it
.
size
>
0
)
{
notice
.
postValue
(
it
.
get
(
0
))
}
}
}
}
}
}
}
...
...
core/src/main/java/com/github/shadowsocks/http/HttpConfig.kt
View file @
7577d189
...
@@ -4,16 +4,16 @@ object HttpConfig {
...
@@ -4,16 +4,16 @@ object HttpConfig {
//app后端
//app后端
//val baseUrl = "http://10.16.1.98:9002"
//val baseUrl = "http://10.16.1.98:9002"
//
val baseUrl = "https://test-cc-tt-api.orangenet.org.cn" //测试
val
baseUrl
=
"https://test-cc-tt-api.orangenet.org.cn"
//测试
val
baseUrl
=
"https://cc-tt-front.srccwl.com"
//生产
//
val baseUrl = "https://cc-tt-front.srccwl.com" //生产
/**
/**
* 主页h5
* 主页h5
*/
*/
//
val UI_MAIN_URL = "https://test-cc-tt-front.orangenet.org.cn/#" //测试
val
UI_MAIN_URL
=
"https://test-cc-tt-front.orangenet.org.cn/#"
//测试
// val UI_MAIN_URL = "http://10.3.64.200:8080/#"
// val UI_MAIN_URL = "http://10.3.64.200:8080/#"
val
UI_MAIN_URL
=
"https://cc-tt-front.srccwl.com/#"
//生产
//
val UI_MAIN_URL = "https://cc-tt-front.srccwl.com/#" //生产
//隐私协议地址
//隐私协议地址
val
HTML_HOST_PRIVACY
=
"https://sdk-static.srccwl.com/tt_html/"
val
HTML_HOST_PRIVACY
=
"https://sdk-static.srccwl.com/tt_html/"
...
...
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