UltraSwipeRefreshConfig

data class UltraSwipeRefreshConfig(val headerScrollMode: NestedScrollMode = NestedScrollMode.Translate, val footerScrollMode: NestedScrollMode = NestedScrollMode.Translate, val refreshEnabled: Boolean = true, val loadMoreEnabled: Boolean = true, @FloatRange(from = 0.0, fromInclusive = false) val refreshTriggerRate: Float = 1.0f, @FloatRange(from = 0.0, fromInclusive = false) val loadMoreTriggerRate: Float = 1.0f, @FloatRange(from = 1.0) val headerMaxOffsetRate: Float = 2.0f, @FloatRange(from = 1.0) val footerMaxOffsetRate: Float = 2.0f, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) val dragMultiplier: Float = 0.5f, @IntRange(from = 0, to = 2000) val finishDelayMillis: Long = 500, val vibrateEnabled: Boolean = false, val alwaysScrollable: Boolean = false, val headerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = { SwipeRefreshHeader(it) }, val footerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = { SwipeRefreshFooter(it) }, val contentContainer: @Composable (@Composable () -> Unit) -> Unit = { NoOverscrollEffect(it) })

UltraSwipeRefresh 的配置

Parameters

headerScrollMode

在进行滑动刷新时Header的滑动模式;具体更详细的样式说明可查看NestedScrollMode

footerScrollMode

在进行滑动加载更多时Footer的滑动模式;具体更详细的样式说明可查看NestedScrollMode

refreshEnabled

是否启用下拉刷新

loadMoreEnabled

是否启用上拉加载

refreshTriggerRate

触发滑动刷新的最小滑动比例;比例基于headerIndicator的高度;默认为:1

loadMoreTriggerRate

触发滑动加载更多最小滑动比例;比例基于footerIndicator的高度;默认为:1

headerMaxOffsetRate

向下滑动时headerIndicator可滑动的最大偏移比例;比例基于headerIndicator的高度;默认为:2

footerMaxOffsetRate

向上滑动时footerIndicator可滑动的最大偏移比例;比例基于footerIndicator的高度;默认为:2

dragMultiplier

触发下拉刷新或上拉加载时的阻力系数;值越小,阻力越大;默认为:0.5

finishDelayMillis

完成时延时时间;让完成时的中间状态UltraSwipeRefreshState.isFinishing停留一会儿,定格的展示提示内容;默认:500毫秒

vibrateEnabled

是否启用振动,如果启用则当滑动偏移量满足触发刷新或触发加载更多时,会有振动效果;默认为:false

alwaysScrollable

是否始终可以滚动;当为true时,则会忽略刷新中或加载中的状态限制,始终可以进行滚动;默认为:false

headerIndicator

下拉刷新时顶部显示的Header指示器

footerIndicator

上拉加载更多时底部显示的Footer指示器

contentContainer

内容的父容器,便于统一管理

Constructors

Link copied to clipboard
constructor(headerScrollMode: NestedScrollMode = NestedScrollMode.Translate, footerScrollMode: NestedScrollMode = NestedScrollMode.Translate, refreshEnabled: Boolean = true, loadMoreEnabled: Boolean = true, @FloatRange(from = 0.0, fromInclusive = false) refreshTriggerRate: Float = 1.0f, @FloatRange(from = 0.0, fromInclusive = false) loadMoreTriggerRate: Float = 1.0f, @FloatRange(from = 1.0) headerMaxOffsetRate: Float = 2.0f, @FloatRange(from = 1.0) footerMaxOffsetRate: Float = 2.0f, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) dragMultiplier: Float = 0.5f, @IntRange(from = 0, to = 2000) finishDelayMillis: Long = 500, vibrateEnabled: Boolean = false, alwaysScrollable: Boolean = false, headerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = { SwipeRefreshHeader(it) }, footerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = { SwipeRefreshFooter(it) }, contentContainer: @Composable (@Composable () -> Unit) -> Unit = { NoOverscrollEffect(it) })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val dragMultiplier: Float = 0.5f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val vibrateEnabled: Boolean = false