Skip to content

0.17.0

Choose a tag to compare

@saket saket released this 15 Sep 05:28
· 9 commits to trunk since this release

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
    )

⚠️ Potentially breaking changes

  • 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. telephoto now automatically increases the max zoom limit when this happens, ensuring the image can still be zoomed.
    • To disable this, pass DynamicZoomSpec.fixed(…) to rememberZoomableState().
    • If you're using a custom DoubleClickToZoomListener listener, review its behavior with small images.
  • 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 DynamicZoomSpec for lazy calculation of zoom limits using the layout info.
    • Improved zooming using mouse-wheel scrolls on JVM.
    • Migrated to LocalHapticFeedback so haptics can be customized or disabled.
  • SubSamplingImage()
    • #149: Tile sizes are now consistent, making it easier to render PDFs (by @sigmabeta).

Bug fixes

  • #146: Added missing contentPadding param to ZoomableAsyncImage() (by @xertrec).
  • #160: Fixed ignored overzoom effect for under-zooms (by @FooIbar).
  • Fixed broken double-click zooming for images that use ContentScale.FillBounds.
  • zoomTo() and zoomBy() 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.