Skip to content

PAM Native 1.43.0

Choose a tag to compare

@DavidWilliamBalbino DavidWilliamBalbino released this 15 Oct 01:54
· 618 commits to main since this release

PAM Native 1.43.0 (on top of 1.42.1) makes native photo zoom behave like a photo viewer and fixes taps on zoomed content on Android.

  • Bounded photo zoom (Android and iOS). gestureNativeBounds="true" and gestureNativeContentAspect on a native-transform GestureDetector (nativeTransform(bounds:, contentAspect:)) keep the zoomed photo covering the viewport. While panning or pinching, the translation stops at the edges of the scaled content, which is either the child itself or the rectangle a resizeMode="contain" image draws inside it. Content smaller than the viewport on an axis stays centred. Reversing a drag moves the photo immediately. On release, the last bounded gesture on the surface springs it to rest. At or below 1.02x it returns to the centred identity; above that it stays inside the bounds, up to gestureNativeMaxScale. Set gestureNativeMinScale below 1 so a pinch can shrink the photo before it springs back. End events report the resting nativeScale/nativeTranslationX/Y, so a PHP commit always matches the screen. Before, a PHP clamp equal to the previous commit produced no property change, and the native view kept the unclamped translation, showing black past the photo.
  • Taps on zoomed content (Android). A gesture Pressable decides whether a touch belongs to an independent child control. It mapped the touch point with the child's translation only. Under a scaled child, it stole the touches outside the untransformed box, so double-tapping a zoomed photo to zoom out failed on most of the screen. The point now goes through the child's full matrix (scale, rotation, pivot), the same way ViewGroup hit testing works. iOS already used UIKit's transform-aware hit testing.
  • Protocol. Property keys 539 (GestureNativeBounds) and 540 (GestureNativeContentAspect) are added to PHP, Rust, Android and iOS.

Guide: docs/gestures.md ("Bounded photo zoom"). Tests: JVM PamPressableGestureTest (contain geometry and bounds), instrumented PamPressableNativeTransformInstrumentedTest (bounded pan and resting payload, zoomed tap target), XCTest testBoundedPhotoTransformKeepsTheContainedContentCoveringTheViewport (not compiled on Linux), and the PHP SDK contract.