fun UltraSwipeRefresh(state: UltraSwipeRefreshState, onRefresh: () -> Unit, onLoadMore: () -> Unit, modifier: Modifier = Modifier, headerScrollMode: NestedScrollMode = UltraSwipeRefreshTheme.config.headerScrollMode, footerScrollMode: NestedScrollMode = UltraSwipeRefreshTheme.config.footerScrollMode, refreshEnabled: Boolean = UltraSwipeRefreshTheme.config.refreshEnabled, loadMoreEnabled: Boolean = UltraSwipeRefreshTheme.config.loadMoreEnabled, @FloatRange(from = 0.0, fromInclusive = false) refreshTriggerRate: Float = UltraSwipeRefreshTheme.config.refreshTriggerRate, @FloatRange(from = 0.0, fromInclusive = false) loadMoreTriggerRate: Float = UltraSwipeRefreshTheme.config.loadMoreTriggerRate, @FloatRange(from = 1.0) headerMaxOffsetRate: Float = UltraSwipeRefreshTheme.config.headerMaxOffsetRate, @FloatRange(from = 1.0) footerMaxOffsetRate: Float = UltraSwipeRefreshTheme.config.footerMaxOffsetRate, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) dragMultiplier: Float = UltraSwipeRefreshTheme.config.dragMultiplier, @IntRange(from = 0, to = 2000) finishDelayMillis: Long = UltraSwipeRefreshTheme.config.finishDelayMillis, vibrateEnabled: Boolean = UltraSwipeRefreshTheme.config.vibrateEnabled, alwaysScrollable: Boolean = UltraSwipeRefreshTheme.config.alwaysScrollable, headerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = UltraSwipeRefreshTheme.config.headerIndicator, footerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = UltraSwipeRefreshTheme.config.footerIndicator, contentContainer: @Composable (@Composable () -> Unit) -> Unit = UltraSwipeRefreshTheme.config.contentContainer, content: @Composable () -> Unit) UltraSwipeRefresh:一个可带来极致体验的Compose刷新组件;支持下拉刷新和上拉加载,可完美替代官方的SwipeRefresh;并且支持的功能更多,可扩展性更强。
Author
Jenly
Follow me
Parameters
修饰符:用于装饰或添加Compose UI元素的行为。具体更详细的说明可查看Modifier
触发下拉刷新或上拉加载时的阻力系数;值越小,阻力越大;默认为:0.5
是否启用振动,如果启用则当滑动偏移量满足触发刷新或触发加载更多时,会有振动效果;默认为:false
是否始终可以滚动;当为true时,则会忽略刷新中或加载中的状态限制,始终可以进行滚动;默认为:false
fun UltraSwipeRefresh(isRefreshing: Boolean, isLoading: Boolean, onRefresh: () -> Unit, onLoadMore: () -> Unit, modifier: Modifier = Modifier, headerScrollMode: NestedScrollMode = UltraSwipeRefreshTheme.config.headerScrollMode, footerScrollMode: NestedScrollMode = UltraSwipeRefreshTheme.config.footerScrollMode, refreshEnabled: Boolean = UltraSwipeRefreshTheme.config.refreshEnabled, loadMoreEnabled: Boolean = UltraSwipeRefreshTheme.config.loadMoreEnabled, @FloatRange(from = 0.0, fromInclusive = false) refreshTriggerRate: Float = UltraSwipeRefreshTheme.config.refreshTriggerRate, @FloatRange(from = 0.0, fromInclusive = false) loadMoreTriggerRate: Float = UltraSwipeRefreshTheme.config.loadMoreTriggerRate, @FloatRange(from = 1.0) headerMaxOffsetRate: Float = UltraSwipeRefreshTheme.config.headerMaxOffsetRate, @FloatRange(from = 1.0) footerMaxOffsetRate: Float = UltraSwipeRefreshTheme.config.footerMaxOffsetRate, @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) dragMultiplier: Float = UltraSwipeRefreshTheme.config.dragMultiplier, @IntRange(from = 0, to = 2000) finishDelayMillis: Long = UltraSwipeRefreshTheme.config.finishDelayMillis, vibrateEnabled: Boolean = UltraSwipeRefreshTheme.config.vibrateEnabled, alwaysScrollable: Boolean = UltraSwipeRefreshTheme.config.alwaysScrollable, headerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = UltraSwipeRefreshTheme.config.headerIndicator, footerIndicator: @Composable (UltraSwipeRefreshState) -> Unit = UltraSwipeRefreshTheme.config.footerIndicator, contentContainer: @Composable (@Composable () -> Unit) -> Unit = UltraSwipeRefreshTheme.config.contentContainer, content: @Composable () -> Unit) UltraSwipeRefresh:一个可带来极致体验的Compose刷新组件;支持下拉刷新和上拉加载,可完美替代官方的SwipeRefresh;并且支持的功能更多,可扩展性更强。
Parameters
修饰符:用于装饰或添加Compose UI元素的行为。具体更详细的说明可查看Modifier
触发下拉刷新或上拉加载时的阻力系数;值越小,阻力越大;默认为:0.5
是否启用振动,如果启用则当滑动偏移量满足触发刷新或触发加载更多时,会有振动效果;默认为:false
是否始终可以滚动;当为true时,则会忽略刷新中或加载中的状态限制,始终可以进行滚动;默认为:false