From c6fe9d9f30d9be630aa80db7cf615916f741a064 Mon Sep 17 00:00:00 2001 From: Saket Narayan Date: Wed, 13 Nov 2024 17:01:55 -0500 Subject: [PATCH] Prepare to release v0.14.0 --- docs/zoomable/index.md | 22 ++++++++++++---------- docs/zoomableimage/index.md | 16 +++++++++++----- gradle.properties | 2 +- mkdocs.yml | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/zoomable/index.md b/docs/zoomable/index.md index 4476fb70..5eee4734 100644 --- a/docs/zoomable/index.md +++ b/docs/zoomable/index.md @@ -1,14 +1,18 @@ # Modifier.zoomable() -A `Modifier` for handling pan & zoom gestures, designed to be shared across all your media composables so that your users can use the same familiar gestures throughout your app. It offers, +A `Modifier` for handling pan & zoom gestures, designed to be shared across all your media composables so that your users can use the same familiar gestures throughout your app. -- Pinch to zoom and flings -- Double click to zoom -- Single finger zoom (double click and hold) -- Haptic feedback for over/under zoom +**Features** + +- Gestures: + - Pinch-to-zoom and flings + - Double click to zoom + - Single finger zoom (double-tap and hold) +- Haptic feedback when reaching zoom limits - Compatibility with nested scrolling - Click listeners - [Keyboard and mouse shortcuts](#keyboard-shortcuts) +- State preservation across config changes (including screen rotations) ### Installation @@ -42,11 +46,9 @@ For preventing your content from over-zooming or over-panning, `Modifier.zoomabl For richer content such as an `Image()` whose _visual_ size may not always match its layout size, `Modifier.zoomable()` will need your assistance. ```kotlin hl_lines="5-7" -val state = rememberZoomableState() val painter = resourcePainter(R.drawable.example) - -LaunchedEffect(painter.intrinsicSize) { - state.setContentLocation( +val zoomableState = rememberZoomableState().apply { + setContentLocation( ZoomableContentLocation.scaledInsideAndCenterAligned(painter.intrinsicSize) ) } @@ -55,7 +57,7 @@ Image( modifier = Modifier .fillMaxSize() .background(Color.Orange) - .zoomable(state), + .zoomable(zoomableState), painter = painter, contentDescription = …, contentScale = ContentScale.Inside, diff --git a/docs/zoomableimage/index.md b/docs/zoomableimage/index.md index f485f4f8..e4ccb449 100644 --- a/docs/zoomableimage/index.md +++ b/docs/zoomableimage/index.md @@ -6,20 +6,26 @@ A _drop-in_ replacement for async `Image()` composables featuring support for pa **Features** -- [Sub-sampling](sub-sampling.md) of bitmaps -- Pinch to zoom and flings -- Double click to zoom -- Single finger zoom (double click and hold) -- Haptic feedback for over/under zoom +- Automatic [Sub-sampling](sub-sampling.md) of bitmaps +- Gestures: + - Pinch-to-zoom and flings + - Double click to zoom + - Single finger zoom (double-tap and hold) +- Haptic feedback when reaching zoom limits - Compatibility with nested scrolling - Click listeners - [Keyboard and mouse shortcuts](#keyboard-shortcuts) +- State preservation across config changes (including screen rotations) ### Installation === "Coil" ```groovy + // For Coil 2.x implementation("me.saket.telephoto:zoomable-image-coil:{{ versions.telephoto }}") + + // For Coil 3.x + implementation("me.saket.telephoto:zoomable-image-coil3:{{ versions.telephoto }}") ``` === "Glide" ```groovy diff --git a/gradle.properties b/gradle.properties index 364ba858..d9114b5e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ android.enableBuildConfigAsBytecode=true android.experimental.androidTest.enableEmulatorControl=true GROUP=me.saket.telephoto -VERSION_NAME=0.14.0-SNAPSHOT +VERSION_NAME=0.14.0 SONATYPE_HOST=DEFAULT RELEASE_SIGNING_ENABLED=true diff --git a/mkdocs.yml b/mkdocs.yml index e282f8aa..b81ef2aa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,7 +65,7 @@ plugins: extra: versions: - telephoto: '0.13.0' # Env var for the latest version on maven. + telephoto: '0.14.0' # Env var for the latest version on maven. nav: - 'Overview': index.md