Package-level declarations
Types
Link copied to clipboard
class DraggableContainerState(var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC)
变换动画容器的状态
Link copied to clipboard
open class DraggablePreviewerState(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) : TransformPreviewerState
拖拉拽状态与控制
Link copied to clipboard
Link copied to clipboard
弹出预览状态与控制对象
Link copied to clipboard
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
图片预览的状态与控制对象
Link copied to clipboard
class TransformItemState(var key: Any = Unit, var blockCompose: @Composable (Any) -> Unit = {}, var scope: CoroutineScope, var blockPosition: Offset = Offset.Zero, var blockSize: IntSize = IntSize.Zero, var intrinsicSize: Size? = null, var checkInBound: TransformItemState.() -> Boolean? = null)
TransformItem的状态与控制对象
Link copied to clipboard
class TransformLayerScope(var previewerDecoration: @Composable (innerBox: @Composable () -> Unit) -> Unit = @Composable { innerBox -> innerBox() }, var background: @Composable () -> Unit = {}, var foreground: @Composable () -> Unit = {})
通过这个对象可以自定义预览图层
Link copied to clipboard
open class TransformPreviewerState(scope: CoroutineScope, var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, val pagerState: SupportedPagerState, itemStateMap: ItemStateMap, val getKey: (Int) -> Any) : PopupPreviewerState
用于控制转换效果图层与图片列表浏览图层
Link copied to clipboard
垂直手势的类型
Properties
Functions
Link copied to clipboard
fun DraggablePreviewer(modifier: Modifier = Modifier, state: DraggablePreviewerState, itemSpacing: Dp = DEFAULT_ITEM_SPACE, beyondViewportPageCount: Int = DEFAULT_BEYOND_VIEWPORT_ITEM_COUNT, enter: EnterTransition = DEFAULT_PREVIEWER_ENTER_TRANSITION, exit: ExitTransition = DEFAULT_PREVIEWER_EXIT_TRANSITION, debugMode: Boolean = false, detectGesture: PagerGestureScope = PagerGestureScope(), previewerLayer: TransformLayerScope = TransformLayerScope(), zoomablePolicy: @Composable PagerZoomablePolicyScope.(page: Int) -> Boolean)
可拖拽释放的弹出预览组件
Link copied to clipboard
获取一个组件在容器中完全显示时的大小
Link copied to clipboard
fun PopupPreviewer(modifier: Modifier = Modifier, state: PopupPreviewerState, itemSpacing: Dp = DEFAULT_ITEM_SPACE, beyondViewportPageCount: Int = DEFAULT_BEYOND_VIEWPORT_ITEM_COUNT, enter: EnterTransition = DEFAULT_PREVIEWER_ENTER_TRANSITION, exit: ExitTransition = DEFAULT_PREVIEWER_EXIT_TRANSITION, detectGesture: PagerGestureScope = PagerGestureScope(), previewerDecoration: @Composable (innerBox: @Composable () -> Unit) -> Unit = @Composable { innerBox -> innerBox() }, zoomablePolicy: @Composable PagerZoomablePolicyScope.(page: Int) -> Unit)
基于Pager、ZoomableView实现的弹出预览组件
Link copied to clipboard
fun Previewer(modifier: Modifier = Modifier, state: PreviewerState, itemSpacing: Dp = DEFAULT_ITEM_SPACE, beyondViewportPageCount: Int = DEFAULT_BEYOND_VIEWPORT_ITEM_COUNT, enter: EnterTransition = DEFAULT_PREVIEWER_ENTER_TRANSITION, exit: ExitTransition = DEFAULT_PREVIEWER_EXIT_TRANSITION, debugMode: Boolean = false, detectGesture: PagerGestureScope = PagerGestureScope(), previewerLayer: TransformLayerScope = TransformLayerScope(), zoomablePolicy: @Composable PagerZoomablePolicyScope.(page: Int) -> Boolean)
带转换效果的图片弹出预览组件
Link copied to clipboard
fun rememberPopupPreviewerState(@IntRange(from = 0) initialPage: Int = 0, pageCount: () -> Int): PopupPreviewerState
Compose中获取一个PopupPreviewerState的方式
Link copied to clipboard
fun rememberPreviewerState(scope: CoroutineScope = rememberCoroutineScope(), defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, @IntRange(from = 0) initialPage: Int = 0, verticalDragType: VerticalDragType = VerticalDragType.Down, transformItemStateMap: ItemStateMap = LocalTransformItemStateMap.current, pageCount: () -> Int, getKey: (Int) -> Any = {}): PreviewerState
获取一个图片预览的状态与控制对象
Link copied to clipboard
fun rememberTransformItemState(scope: CoroutineScope = rememberCoroutineScope(), checkInBound: TransformItemState.() -> Boolean? = null, intrinsicSize: Size? = null): TransformItemState
在compose中获取一个TransformItemState的方式
Link copied to clipboard
转换效果在切换到实际显示图层前的占位图层
Link copied to clipboard
转换过程中的转换动效图层
Link copied to clipboard
fun TransformItemView(modifier: Modifier = Modifier, key: Any, itemState: TransformItemState = rememberTransformItemState(), transformState: TransformPreviewerState, content: @Composable (Any) -> Unit)
fun TransformItemView(modifier: Modifier = Modifier, key: Any, itemState: TransformItemState = rememberTransformItemState(), itemStateMap: ItemStateMap = LocalTransformItemStateMap.current, itemVisible: Boolean, content: @Composable (Any) -> Unit)
用于实现Previewer变换效果的小图装载容器
Link copied to clipboard
fun TransformPreviewer(modifier: Modifier = Modifier, state: TransformPreviewerState, itemSpacing: Dp = DEFAULT_ITEM_SPACE, beyondViewportPageCount: Int = DEFAULT_BEYOND_VIEWPORT_ITEM_COUNT, enter: EnterTransition = DEFAULT_PREVIEWER_ENTER_TRANSITION, exit: ExitTransition = DEFAULT_PREVIEWER_EXIT_TRANSITION, debugMode: Boolean = false, detectGesture: PagerGestureScope = PagerGestureScope(), previewerLayer: TransformLayerScope = TransformLayerScope(), zoomablePolicy: @Composable PagerZoomablePolicyScope.(page: Int) -> Boolean)
支持弹出转换动画的图片预览组件