Skip to content

Commit b2f4855

Browse files
committed
发布v1.4.0
1 parent 5654231 commit b2f4855

File tree

34 files changed

+298
-225
lines changed

34 files changed

+298
-225
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
android: circleci/android@0.2.0
4+
android: circleci/android@3.0.0
55

66
jobs:
77
build:
@@ -10,4 +10,4 @@ jobs:
1010
steps:
1111
- checkout
1212
- run:
13-
command: ./gradlew build
13+
command: ./gradlew build

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10+
[*.{yml,yaml}]
11+
indent_size = 2
12+
1013
[*.{kt, kts}]
1114
ij_kotlin_imports_layout = *

.github/workflows/build.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
name: Android CI
1+
name: build
22

33
on:
44
push:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
88

9+
env:
10+
JAVA_VERSION: 17
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215

1316
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up JDK 17
16-
uses: actions/setup-java@v1
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure JDK
23+
uses: actions/setup-java@v4
1724
with:
18-
java-version: 17
25+
distribution: 'zulu'
26+
java-version: ${{ env.JAVA_VERSION }}
1927
- name: Build with Gradle
20-
run: ./gradlew build
28+
run: ./gradlew build

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## 版本日志
22

3+
#### v1.4.0 :2025-7-21
4+
* 迁移发布至 **Central Portal** [相关公告](https://central.sonatype.org/pages/ossrh-eol/#logging-in-to-central-portal)
5+
* 更新compose至v1.7.0 (v1.6.0 -> v1.7.0)
6+
* 更新lottie至v6.6.0 (v6.1.0 -> v6.6.0)
7+
* 更新Gradle至v8.5
8+
* 参数名变更:将原 `vibrateEnabled` 修改为:`vibrationEnabled`
9+
* 新增参数`vibrationMillis`: 振动时长
10+
* 优化一些细节
11+
312
#### v1.3.1 :2024-12-23
413
* 修复BUG:快速滑动时,出现收起动画不执行的问题。 ([#21](https://github.com/jenly1314/UltraSwipeRefresh/issues/21)
514

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
**UltraSwipeRefresh**:一个可带来极致体验的 **Compose** 刷新组件;支持下拉刷新和上拉加载,可完美替代官方的 **SwipeRefresh**;并且支持的功能更多,可扩展性更强。
1111

12-
> **UltraSwipeRefresh** 在设计之初,主要参考了谷歌官方的[SwipeRefresh](https://github.com/google/accompanist/tree/v0.36.0/swiperefresh) 和第三方的[SmartRefreshLayout](https://github.com/scwang90/SmartRefreshLayout) ,在充分借鉴两者优秀设计理念的基础上,致力于打造一个拥有极致体验的 **Compose** 刷新组件。
12+
> **UltraSwipeRefresh** 在设计之初,主要参考了谷歌官方的 [SwipeRefresh](https://github.com/google/accompanist/tree/v0.36.0/swiperefresh) 和第三方的 [SmartRefreshLayout](https://github.com/scwang90/SmartRefreshLayout) ,在充分借鉴两者优秀设计理念的基础上,致力于打造一个拥有极致体验的 **Compose** 刷新组件。
1313
1414
## 功能特色
1515

@@ -40,14 +40,14 @@
4040
4141
```gradle
4242
// 极致体验的Compose刷新组件 (*必须)
43-
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh:1.3.1'
43+
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh:1.4.0'
4444
4545
// 经典样式的指示器 (可选)
46-
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-classic:1.3.1'
46+
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-classic:1.4.0'
4747
// Lottie动画指示器 (可选)
48-
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-lottie:1.3.1'
48+
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-lottie:1.4.0'
4949
// 进度条样式的指示器 (可选)
50-
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-progress:1.3.1'
50+
implementation 'com.github.jenly1314.UltraSwipeRefresh:refresh-indicator-progress:1.4.0'
5151
```
5252
5353
## 使用
@@ -76,7 +76,8 @@
7676
* @param footerMaxOffsetRate 向上滑动时[footerIndicator]可滑动的最大偏移比例;比例基于[footerIndicator]的高度;默认为:2
7777
* @param dragMultiplier 触发下拉刷新或上拉加载时的阻力系数;值越小,阻力越大;默认为:0.5
7878
* @param finishDelayMillis 完成时延时时间;让完成时的中间状态[UltraSwipeRefreshState.isFinishing]停留一会儿,定格的展示提示内容;默认:500毫秒
79-
* @param vibrateEnabled 是否启用振动,如果启用则当滑动偏移量满足触发刷新或触发加载更多时,会有振动效果;默认为:false
79+
* @param vibrationEnabled 是否启用振动,如果启用则当滑动偏移量满足触发刷新或触发加载更多时,会有振动效果;默认为:false
80+
* @param vibrationMillis 触发刷新或触发加载更多时的振动时长(毫秒)默认:25毫秒
8081
* @param alwaysScrollable 是否始终可以滚动;当为true时,则会忽略刷新中或加载中的状态限制,始终可以进行滚动;默认为:false
8182
* @param headerIndicator 下拉刷新时顶部显示的Header指示器
8283
* @param footerIndicator 上拉加载更多时底部显示的Footer指示器
@@ -87,7 +88,7 @@
8788

8889
#### UltraSwipeRefresh使用示例
8990

90-
比如:使用`UltraSwipeRefresh`实现一个经典样式的刷新与加载示例:
91+
使用`UltraSwipeRefresh`实现一个经典样式的刷新与加载示例:
9192

9293
```kotlin
9394

@@ -128,7 +129,7 @@ fun UltraSwipeRefreshSample() {
128129
ClassicRefreshFooter(it)
129130
}
130131
) {
131-
LazyColumn(Modifier.background(color = Color.White)) {
132+
LazyColumn(Modifier.fillMaxSize().background(color = Color.White)) {
132133
repeat(itemCount) {
133134
item {
134135
Text(
@@ -186,8 +187,7 @@ UltraSwipeRefreshTheme.config = UltraSwipeRefreshTheme.config.copy(
186187
| ProgressRefreshFooter | LottieRefreshFooter |
187188
| [进度条刷新样式示例](app/src/main/java/com/king/ultraswiperefresh/app/sample/ProgressRefreshIndicatorSample.kt) | [Lottie动画刷新样式示例](app/src/main/java/com/king/ultraswiperefresh/app/sample/LottieRefreshIndicatorSample.kt) |
188189

189-
190-
> 如果以上的指示器效果都不满足你的需求,你可以自定义去实现Header和Footer的指示器,也可以直接使用Lottie动画样式的指示器,来快速接入任何Lottie动画。
190+
> 如果以上的指示器效果都不满足你的需求,你可以自定义去实现Header和Footer对应的指示器,也可以直接使用Lottie动画样式的指示器,来快速接入任何Lottie动画。
191191
192192
更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jenly1314.github.io/UltraSwipeRefresh/api/)
193193

@@ -211,8 +211,14 @@ UltraSwipeRefreshTheme.config = UltraSwipeRefreshTheme.config.copy(
211211

212212
## 版本日志
213213

214-
#### v1.3.1 :2024-12-23
215-
* 修复BUG:快速滑动时,出现收起动画不执行的问题。 ([#21](https://github.com/jenly1314/UltraSwipeRefresh/issues/21)
214+
#### v1.4.0 :2025-7-21
215+
* 迁移发布至 **Central Portal** [相关公告](https://central.sonatype.org/pages/ossrh-eol/#logging-in-to-central-portal)
216+
* 更新compose至v1.7.0 (v1.6.0 -> v1.7.0)
217+
* 更新lottie至v6.6.0 (v6.1.0 -> v6.6.0)
218+
* 更新Gradle至v8.5
219+
* 参数名变更:将原 `vibrateEnabled` 修改为:`vibrationEnabled`
220+
* 新增参数`vibrationMillis`: 振动时长
221+
* 优化一些细节
216222

217223
#### [查看更多版本日志](CHANGELOG.md)
218224

app/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ dependencies {
6363
implementation "androidx.navigation:navigation-compose:$versions.navigation_compose"
6464
implementation "com.google.accompanist:accompanist-swiperefresh:$versions.accompanist"
6565

66-
implementation "com.airbnb.android:lottie-compose:$versions.lottie_compose"
67-
6866
testImplementation "junit:junit:$versions.junit"
6967
androidTestImplementation "androidx.test.ext:junit:$versions.android_ext_junit"
7068
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.espresso"
@@ -77,4 +75,4 @@ dependencies {
7775
implementation project(":refresh-indicator-lottie")
7876
implementation project(":refresh-indicator-progress")
7977

80-
}
78+
}

app/release/app-release.apk

676 KB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 8,
15-
"versionName": "1.3.1",
14+
"versionCode": 9,
15+
"versionName": "1.4.0",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

app/src/main/java/com/king/ultraswiperefresh/app/component/ColumnItem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fun ColumnItem(title: String, content: String, click: () -> Unit = {}) {
2626
.clickable {
2727
click()
2828
}
29-
.padding(horizontal = 16.dp, vertical = 10.dp)
29+
.padding(horizontal = 16.dp, vertical = 12.dp)
3030
) {
3131
Text(
3232
text = title,
@@ -39,4 +39,4 @@ fun ColumnItem(title: String, content: String, click: () -> Unit = {}) {
3939
fontSize = 14.sp,
4040
)
4141
}
42-
}
42+
}

app/src/main/java/com/king/ultraswiperefresh/app/sample/ClassicRefreshIndicatorSample.kt

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,33 @@ fun ClassicRefreshIndicatorSample() {
6262
}
6363
},
6464
onLoadMore = {
65-
coroutineScope.launch {
66-
state.isLoading = true
67-
// TODO 加载更多的逻辑处理,此处的延时只是为了演示效果
68-
delay(2000)
69-
itemCount += 20
70-
state.isLoading = false
65+
if (hasMoreData) {
66+
coroutineScope.launch {
67+
state.isLoading = true
68+
// TODO 加载更多的逻辑处理,此处的延时只是为了演示效果
69+
delay(2000)
70+
itemCount += 20
71+
state.isLoading = false
72+
}
7173
}
7274
},
7375
modifier = Modifier.background(color = Color(0x7FEEEEEE)),
74-
loadMoreEnabled = hasMoreData,
7576
headerIndicator = {
7677
ClassicRefreshHeader(it)
7778
},
7879
footerIndicator = {
79-
ClassicRefreshFooter(it)
80+
if (hasMoreData) {
81+
ClassicRefreshFooter(it)
82+
} else {
83+
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
84+
Text(
85+
text = "没有更多数据了",
86+
color = Color(0xFF999999),
87+
fontSize = 15.sp,
88+
modifier = Modifier.padding(vertical = 16.dp)
89+
)
90+
}
91+
}
8092
}
8193
) {
8294
LazyColumn(Modifier.background(color = Color.White)) {
@@ -91,19 +103,6 @@ fun ClassicRefreshIndicatorSample() {
91103
)
92104
}
93105
}
94-
95-
if (!hasMoreData) {
96-
item {
97-
Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
98-
Text(
99-
text = "没有更多数据了",
100-
color = Color(0xFF999999),
101-
fontSize = 15.sp,
102-
modifier = Modifier.padding(vertical = 16.dp)
103-
)
104-
}
105-
}
106-
}
107106
}
108107
}
109-
}
108+
}

0 commit comments

Comments
 (0)