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
d9c3bc48
Commit
d9c3bc48
authored
Aug 12, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update BaseApplication的context赋值迁移到BGeneralBusiness组件
parent
3e5af6d1
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
425 deletions
+1
-425
BGeneralBusiness.kt
...ian/shenghuoquan/bgeneralbusiness/app/BGeneralBusiness.kt
+0
-56
BGeneralBusinessApplication.kt
...oquan/bgeneralbusiness/app/BGeneralBusinessApplication.kt
+1
-0
BManagerCenter.kt
.../yidian/shenghuoquan/bmanagercenter/app/BManagerCenter.kt
+0
-368
BusinessApplication.kt
...ain/java/com/shenghuoquan/business/BusinessApplication.kt
+0
-1
No files found.
Components/BGeneralBusiness/src/main/java/com/yidian/shenghuoquan/bgeneralbusiness/app/BGeneralBusiness.kt
deleted
100644 → 0
View file @
3e5af6d1
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
import
com.yidian.shenghuoquan.bgeneralbusiness.service.ImageService
import
com.yidian.shenghuoquan.bgeneralbusiness.service.net.BNAHttpReqService
import
com.yidian.yac.core.zap.Zap
/**
* author: yinjiacheng
* date: 8/4/21 4:58 PM
* description: 非组件化方案 替代Application
*/
object
BGeneralBusiness
{
/**
* 作用同application onCreate
*/
fun
init
()
{
initService
()
initSmartRefreshLayout
()
}
private
fun
initService
()
{
Zap
.
addService
(
ZapServiceNameConstants
.
BNAHttpReq
,
BNAHttpReqService
())
Zap
.
addService
(
ZapServiceNameConstants
.
GeneralAbilityService
,
GeneralAbilityService
())
Zap
.
addService
(
ZapServiceNameConstants
.
EncryptService
,
EncryptService
())
Zap
.
addService
(
ZapServiceNameConstants
.
ImageService
,
ImageService
())
}
/**
* 设置刷新 默认的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 @
d9c3bc48
...
...
@@ -20,6 +20,7 @@ class BGeneralBusinessApplication : YdBaseApplication() {
override
fun
onCreate
()
{
super
.
onCreate
()
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
context
=
this
initService
()
initSmartRefreshLayout
()
}
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/app/BManagerCenter.kt
deleted
100644 → 0
View file @
3e5af6d1
This diff is collapsed.
Click to expand it.
app/src/main/java/com/shenghuoquan/business/BusinessApplication.kt
View file @
d9c3bc48
...
...
@@ -24,7 +24,6 @@ class BusinessApplication : YdBaseApplication() {
override
fun
onCreate
()
{
super
.
onCreate
()
if
(
ProcessUtil
.
isMainProcess
(
this
))
{
context
=
this
// 先初始化日志防止调用时报初始化异常
if
(
BuildConfig
.
DEBUG
)
{
Timber
.
plant
(
Timber
.
DebugTree
())
...
...
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