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
7de0d978
Commit
7de0d978
authored
Jun 22, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上拉加载下拉刷新库的经典样式
parent
81157f18
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
+36
-5
YdBaseApplication.kt
...mmon/src/main/java/com/yidian/common/YdBaseApplication.kt
+34
-5
config.gradle
config/config.gradle
+2
-0
No files found.
CommonLib/Common/src/main/java/com/yidian/common/YdBaseApplication.kt
View file @
7de0d978
...
...
@@ -2,11 +2,40 @@ package com.yidian.common
import
android.app.Activity
import
android.app.Application
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
open
class
YdBaseApplication
:
Application
()
{
companion
object
{
open
class
YdBaseApplication
:
Application
()
{
companion
object
{
lateinit
var
context
:
Application
var
activityList
=
ArrayList
<
Activity
>()
}
override
fun
onCreate
()
{
super
.
onCreate
()
initSmartRefreshLayout
()
}
/**
* 设置刷新 默认的header和footer
*/
private
fun
initSmartRefreshLayout
()
{
//设置全局的Header构建器
SmartRefreshLayout
.
setDefaultRefreshHeaderCreator
{
context
,
layout
->
layout
.
setPrimaryColorsId
(
R
.
color
.
white
)
//全局设置主题颜色
ClassicsHeader
(
context
)
//指定为经典Header,默认是 贝塞尔雷达Header
}
//设置全局的Footer构建器
SmartRefreshLayout
.
setDefaultRefreshFooterCreator
{
context
,
layout
->
layout
.
setEnableLoadMoreWhenContentNotFull
(
true
)
//内容不满一页时候启用加载更多
val
footer
=
ClassicsFooter
(
context
)
footer
.
setBackgroundResource
(
R
.
color
.
white
)
footer
.
setDrawableSize
(
20f
)
footer
.
spinnerStyle
=
SpinnerStyle
.
FixedBehind
//设置为固定在背后模式
footer
//指定为经典Footer,默认是 BallPulseFooter
}
}
}
config/config.gradle
View file @
7de0d978
...
...
@@ -27,9 +27,11 @@ ext.dependencies = [
'androidx.constraintlayout:constraintlayout:2.0.4'
,
'jp.co.cyberagent.android:gpuimage:2.1.0'
,
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
,
// 刷新
'com.scwang.smart:refresh-layout-kernel:2.0.1'
,
'com.scwang.smart:refresh-header-classics:2.0.1'
,
'com.scwang.smart:refresh-footer-classics:2.0.1'
,
"androidx.recyclerview:recyclerview:1.1.0"
,
'de.hdodenhof:circleimageview:3.1.0'
,
'com.github.chrisbanes:PhotoView:2.3.0'
,
...
...
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