0.17.0
Highlights
- #45, #88, #140, #150, #152, #158: Upscaled images can now be zoomed.
- #135: Zoom to a specific pixel using
ZoomFocalPoint:val imageState = rememberZoomableImageState() imageState.zoomableState.zoomTo( zoomFactor = 2f, focal = ZoomFocalPoint.moveToViewportCenter(…), // or zoomAround() )
- #141: Selectively disable zooming or panning:
ZoomableAsyncImage( model = "https://dog.ceo", contentDescription = "…", gestures = EnabledZoomGestures.ZoomOnly, // or PanOnly )
- When a small image is upscaled to fit the viewport, its starting scale can be larger than its maximum zoom limit. In such cases, the image wouldn't respond to zoom gestures.
telephotonow automatically increases the max zoom limit when this happens, ensuring the image can still be zoomed.- To disable this, pass
DynamicZoomSpec.fixed(…)torememberZoomableState(). - If you're using a custom
DoubleClickToZoomListenerlistener, review its behavior with small images.
- To disable this, pass
- The receiver of
DoubleClickToZoomListener#onDoubleClick()has changed. This API was already marked experimental. FlickToDismiss()now uses rubber banding. More on this below.
Improvements
ZoomableImage()/Modifier.zoomable- Added
DynamicZoomSpecfor lazy calculation of zoom limits using the layout info. - Improved zooming using mouse-wheel scrolls on JVM.
- Migrated to
LocalHapticFeedbackso haptics can be customized or disabled.
- Added
SubSamplingImage()- #149: Tile sizes are now consistent, making it easier to render PDFs (by @sigmabeta).
Bug fixes
- #146: Added missing
contentPaddingparam toZoomableAsyncImage()(by @xertrec). - #160: Fixed ignored overzoom effect for under-zooms (by @FooIbar).
- Fixed broken double-click zooming for images that use
ContentScale.FillBounds. zoomTo()andzoomBy()no longer crash when given invalid or out-of-bound zoom factors.
Unreleased libraries
This release also includes updates to FlickToDismiss(). While it hasn't been officially released yet, some major apps have already started using it. I plan to announce it soon, but in the meantime here are the changes:
- Improved drag physics and added a rubber banding effect. You can customize this via
rememberFlickToDismissState(). - A haptic feedback is now played when the dismiss threshold is crossed. This can customized via
LocalHapticFeedback.