Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
68f5d8a7
Commit
68f5d8a7
authored
Aug 04, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update SmartRefreshLayout初始化迁移到BGeneralBusiness组件
parent
57d39dc6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
26 deletions
+51
-26
BGeneralBusiness.kt
...ian/shenghuoquan/bgeneralbusiness/app/BGeneralBusiness.kt
+26
-0
BGeneralBusinessApplication.kt
...oquan/bgeneralbusiness/app/BGeneralBusinessApplication.kt
+25
-0
BaseInitConfig.kt
...main/java/com/yidian/shenghuoquan/broot/BaseInitConfig.kt
+0
-26
No files found.
Components/BGeneralBusiness/src/main/java/com/yidian/shenghuoquan/bgeneralbusiness/app/BGeneralBusiness.kt
View file @
68f5d8a7
package
com.yidian.shenghuoquan.bgeneralbusiness.app
import
com.scwang.smart.refresh.footer.ClassicsFooter
import
com.scwang.smart.refresh.header.ClassicsHeader
import
com.scwang.smart.refresh.layout.SmartRefreshLayout
import
com.scwang.smart.refresh.layout.constant.SpinnerStyle
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.shenghuoquan.bgeneralbusiness.service.EncryptService
import
com.yidian.shenghuoquan.bgeneralbusiness.service.GeneralAbilityService
...
...
@@ -18,6 +22,7 @@ object BGeneralBusiness {
*/
fun
init
()
{
initService
()
initSmartRefreshLayout
()
}
private
fun
initService
()
{
...
...
@@ -25,4 +30,25 @@ object BGeneralBusiness {
Zap
.
addService
(
ZapServiceNameConstants
.
GeneralAbilityService
,
GeneralAbilityService
())
Zap
.
addService
(
ZapServiceNameConstants
.
EncryptService
,
EncryptService
())
}
/**
* 设置刷新 默认的header和footer
*/
private
fun
initSmartRefreshLayout
()
{
//设置全局的Header构建器
SmartRefreshLayout
.
setDefaultRefreshHeaderCreator
{
context
,
layout
->
layout
.
setPrimaryColorsId
(
android
.
R
.
color
.
transparent
)
//全局设置主题颜色
ClassicsHeader
(
context
)
//指定为经典Header,默认是 贝塞尔雷达Header
}
//设置全局的Footer构建器
SmartRefreshLayout
.
setDefaultRefreshFooterCreator
{
context
,
layout
->
layout
.
setEnableLoadMoreWhenContentNotFull
(
true
)
//内容不满一页时候启用加载更多
val
footer
=
ClassicsFooter
(
context
)
footer
.
setBackgroundResource
(
android
.
R
.
color
.
transparent
)
footer
.
setDrawableSize
(
20f
)
footer
.
spinnerStyle
=
SpinnerStyle
.
FixedBehind
//设置为固定在背后模式
footer
//指定为经典Footer,默认是 BallPulseFooter
}
}
}
Components/BGeneralBusiness/src/main/java/com/yidian/shenghuoquan/bgeneralbusiness/app/BGeneralBusinessApplication.kt
View file @
68f5d8a7
package
com.yidian.shenghuoquan.bgeneralbusiness.app
import
com.scwang.smart.refresh.footer.ClassicsFooter
import
com.scwang.smart.refresh.header.ClassicsHeader
import
com.scwang.smart.refresh.layout.SmartRefreshLayout
import
com.scwang.smart.refresh.layout.constant.SpinnerStyle
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.news.util.ProcessUtil
...
...
@@ -16,6 +20,7 @@ class BGeneralBusinessApplication : YdBaseApplication() {
super
.
onCreate
()
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
initService
()
initSmartRefreshLayout
()
}
}
...
...
@@ -25,4 +30,24 @@ class BGeneralBusinessApplication : YdBaseApplication() {
Zap
.
addService
(
ZapServiceNameConstants
.
EncryptService
,
EncryptService
())
}
/**
* 设置刷新 默认的header和footer
*/
private
fun
initSmartRefreshLayout
()
{
//设置全局的Header构建器
SmartRefreshLayout
.
setDefaultRefreshHeaderCreator
{
context
,
layout
->
layout
.
setPrimaryColorsId
(
android
.
R
.
color
.
transparent
)
//全局设置主题颜色
ClassicsHeader
(
context
)
//指定为经典Header,默认是 贝塞尔雷达Header
}
//设置全局的Footer构建器
SmartRefreshLayout
.
setDefaultRefreshFooterCreator
{
context
,
layout
->
layout
.
setEnableLoadMoreWhenContentNotFull
(
true
)
//内容不满一页时候启用加载更多
val
footer
=
ClassicsFooter
(
context
)
footer
.
setBackgroundResource
(
android
.
R
.
color
.
transparent
)
footer
.
setDrawableSize
(
20f
)
footer
.
spinnerStyle
=
SpinnerStyle
.
FixedBehind
//设置为固定在背后模式
footer
//指定为经典Footer,默认是 BallPulseFooter
}
}
}
Components/BRoot/src/main/java/com/yidian/shenghuoquan/broot/BaseInitConfig.kt
View file @
68f5d8a7
package
com.yidian.shenghuoquan.broot
import
android.content.Context
import
com.scwang.smart.refresh.footer.ClassicsFooter
import
com.scwang.smart.refresh.header.ClassicsHeader
import
com.scwang.smart.refresh.layout.SmartRefreshLayout
import
com.scwang.smart.refresh.layout.constant.SpinnerStyle
import
com.yidian.bcommon.BuildConfig
import
com.yidian.bcommon.constant.AppConfig
import
com.yidian.bcommon.constant.GlobalConstants
...
...
@@ -45,8 +41,6 @@ object BaseInitConfig {
initXBridManager
(
context
)
// 初始化App升级
initAppUpgrade
(
context
)
// SmartRefresh
initSmartRefreshLayout
()
// 调用延迟初始化
ZapTicket
(
ZapServiceNameConstants
.
GeneralAbilityService
).
withAction
(
ZapServiceActionConstants
.
ActionLazyInit
).
ship
()
}
...
...
@@ -136,24 +130,4 @@ object BaseInitConfig {
})
}
/**
* 设置刷新 默认的header和footer
*/
private
fun
initSmartRefreshLayout
()
{
//设置全局的Header构建器
SmartRefreshLayout
.
setDefaultRefreshHeaderCreator
{
context
,
layout
->
layout
.
setPrimaryColorsId
(
android
.
R
.
color
.
transparent
)
//全局设置主题颜色
ClassicsHeader
(
context
)
//指定为经典Header,默认是 贝塞尔雷达Header
}
//设置全局的Footer构建器
SmartRefreshLayout
.
setDefaultRefreshFooterCreator
{
context
,
layout
->
layout
.
setEnableLoadMoreWhenContentNotFull
(
true
)
//内容不满一页时候启用加载更多
val
footer
=
ClassicsFooter
(
context
)
footer
.
setBackgroundResource
(
android
.
R
.
color
.
transparent
)
footer
.
setDrawableSize
(
20f
)
footer
.
spinnerStyle
=
SpinnerStyle
.
FixedBehind
//设置为固定在背后模式
footer
//指定为经典Footer,默认是 BallPulseFooter
}
}
}
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