Package-level declarations

Types

Link copied to clipboard
class ImagePreviewerState(var scope: CoroutineScope = MainScope(), var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, val galleryState: ImageGalleryState, var itemStateMap: ItemStateMap) : PreviewerVerticalDragState

预览组件的状态

Link copied to clipboard
class PreviewerLayerScope(var viewerContainer: @Composable (page: Int, viewerState: ImageViewerState, viewer: @Composable () -> Unit) -> Unit = { _, _, viewer -> viewer() }, var background: @Composable (page: Int) -> Unit = { _ -> defaultPreviewBackground() }, var foreground: @Composable (page: Int) -> Unit = { _ -> }, var placeholder: PreviewerPlaceholder = PreviewerPlaceholder())

预览图层对象

Link copied to clipboard
open class PreviewerPagerState(val galleryState: ImageGalleryState)
Link copied to clipboard
class PreviewerPlaceholder(var enterTransition: EnterTransition = DEFAULT_PLACEHOLDER_ENTER_TRANSITION, var exitTransition: ExitTransition = DEFAULT_PLACEHOLDER_EXIT_TRANSITION, var content: @Composable () -> Unit = DEFAULT_PREVIEWER_PLACEHOLDER_CONTENT)
Link copied to clipboard
open class PreviewerTransformState(var scope: CoroutineScope = MainScope(), var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, val galleryState: ImageGalleryState, var itemStateMap: ItemStateMap) : PreviewerPagerState
Link copied to clipboard
open class PreviewerVerticalDragState(var scope: CoroutineScope = MainScope(), var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, verticalDragType: VerticalDragType = VerticalDragType.None, scaleToCloseMinValue: Float = DEFAULT_SCALE_TO_CLOSE_MIN_VALUE, val galleryState: ImageGalleryState, var itemStateMap: ItemStateMap) : PreviewerTransformState

增加垂直方向拖拽的能力

Link copied to clipboard
class TransformContentState(var scope: CoroutineScope = MainScope(), var defaultAnimationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, var itemStateMap: ItemStateMap)

Functions

Link copied to clipboard
fun ImagePreviewer(modifier: Modifier = Modifier, state: ImagePreviewerState, imageLoader: @Composable (Int) -> Any?, itemSpacing: Dp = DEFAULT_ITEM_SPACE, enter: EnterTransition = DEFAULT_PREVIEWER_ENTER_TRANSITION, exit: ExitTransition = DEFAULT_PREVIEWER_EXIT_TRANSITION, detectGesture: GalleryGestureScope.() -> Unit = {}, previewerLayer: PreviewerLayerScope.() -> Unit = {})

图片预览组件

Link copied to clipboard
fun rememberPreviewerState(scope: CoroutineScope = rememberCoroutineScope(), animationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC, verticalDragType: VerticalDragType = VerticalDragType.None, @IntRange(from = 0) initialPage: Int = 0, pageCount: () -> Int, getKey: (Int) -> Any? = null): ImagePreviewerState

记录预览组件状态

Link copied to clipboard
fun rememberTransformContentState(scope: CoroutineScope = rememberCoroutineScope(), animationSpec: AnimationSpec<Float> = DEFAULT_SOFT_ANIMATION_SPEC): TransformContentState
Link copied to clipboard
fun TransformContentView(transformContentState: TransformContentState = rememberTransformContentState())
Link copied to clipboard
fun TransformImageView(modifier: Modifier = Modifier, bitmap: ImageBitmap, key: Any, itemState: TransformItemState = rememberTransformItemState(), previewerState: ImagePreviewerState)
fun TransformImageView(modifier: Modifier = Modifier, painter: Painter, key: Any, itemState: TransformItemState = rememberTransformItemState(), previewerState: ImagePreviewerState)
fun TransformImageView(modifier: Modifier = Modifier, imageVector: ImageVector, key: Any, itemState: TransformItemState = rememberTransformItemState(), previewerState: ImagePreviewerState)
fun TransformImageView(modifier: Modifier = Modifier, key: Any, itemState: TransformItemState = rememberTransformItemState(), previewerState: ImagePreviewerState, content: @Composable (Any) -> Unit)
fun TransformImageView(modifier: Modifier = Modifier, key: Any, itemState: TransformItemState = rememberTransformItemState(), contentState: TransformContentState? = rememberTransformContentState(), content: @Composable (Any) -> Unit)
Link copied to clipboard
fun TransformItemView(modifier: Modifier = Modifier, key: Any, itemState: TransformItemState = rememberTransformItemState(), contentState: TransformContentState?, content: @Composable (Any) -> Unit)