PreviewerState

class PreviewerState(scope: CoroutineScope, var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, verticalDragType: VerticalDragType = VerticalDragType.None, scaleToCloseMinValue: Float = DEFAULT_SCALE_TO_CLOSE_MIN_VALUE, val pagerState: SupportedPagerState, itemStateMap: ItemStateMap, val getKey: (Int) -> Any) : DraggablePreviewerState

图片预览的状态与控制对象

Parameters

scope

协程作用域

defaultAnimationSpec

默认动画窗格

verticalDragType

垂直手势类型

scaleToCloseMinValue

下拉关闭的缩小的阈值

pagerState

预览状态

itemStateMap

用于获取transformItemState

getKey

获取当前key的方法

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope, defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, verticalDragType: VerticalDragType = VerticalDragType.None, scaleToCloseMinValue: Float = DEFAULT_SCALE_TO_CLOSE_MIN_VALUE, pagerState: SupportedPagerState, itemStateMap: ItemStateMap, getKey: (Int) -> Any)

Properties

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 getKey: (Int) -> Any

根据下标获取唯一标识的方法

Link copied to clipboard

interactionSource

Link copied to clipboard
val mountedFlow: MutableStateFlow<Boolean>
Link copied to clipboard

底层SupportedPagerState

Link copied to clipboard

目标页码

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun animateScrollToPage(@IntRange(from = 0) page: Int, @FloatRange(from = 0.0, to = 1.0) pageOffset: Float = 0.0f)

动画滚动到指定页面

Link copied to clipboard
suspend fun close(exitTransition: ExitTransition? = null)
Link copied to clipboard
open suspend fun closeAction(exitTransition: ExitTransition? = null)
Link copied to clipboard
suspend fun enterTransform(index: Int, animationSpec: AnimationSpec<Float>? = null)
Link copied to clipboard
suspend fun exitTransform(animationSpec: AnimationSpec<Float>? = null)
Link copied to clipboard
suspend fun open(index: Int = 0, enterTransition: EnterTransition? = null)
Link copied to clipboard
open suspend override fun openAction(index: Int, enterTransition: EnterTransition?)
Link copied to clipboard
suspend fun scrollToPage(@IntRange(from = 0) page: Int, @FloatRange(from = 0.0, to = 1.0) pageOffset: Float = 0.0f)

滚动到指定页面

Link copied to clipboard
suspend fun updateState(animating: Boolean, visible: Boolean, visibleTarget: Boolean?)

更新当前的标记状态

Link copied to clipboard
suspend fun verticalDrag(pointerInputScope: PointerInputScope)