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
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## 使用
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指示器
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
0 commit comments