The image in the photo view has no height, and is therefore entirely
unconstrained. This causes the image to take up the full height of the
viewport during the hero animation, which can make look out of sync. In
some other cases, it can stretch or resize the image to fill the entire
viewport.
* fix(android): detect supported version for special format column
* fix(android): remove unnecessary suppression for new API in special format check
* fix(android): change visibility of hasSpecialFormatColumn method to private
* feat: add playbackStyle to local asset entity and related database schema
* implement conversion function for playbackStyle in local sync service
* implement conversion function for playbackStyle in local sync service
* refactor: remove deducedPlaybackStyle from TrashedLocalAssetEntityData
* add playbackStyle column to trashed local asset entity
* make playbackStyle non-nullable across the mobile codebase
* Streamline playbackStyle backfill:
- only backfill local assets playbackStyle in flutter/dart code
- only update trashed local assets in db migration
* bump target database version to 23 and update migration logic for playbackStyle
* set playback_style to 0 in merged_asset.drift as its a getter in base asset
* run make pigeon
* Populate playbackStyle for trashed assets during native migration
* feat(mobile): add support for encoded image requests in local and remote image APIs
* fix(mobile): handle memory cleanup for cancelled image requests
* refactor(mobile): simplify memory management and response handling for encoded image requests
* fix(mobile): correct formatting in cancellation check for image requests
* Apply suggestion from @mertalev
Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
* refactor(mobile): rename 'encoded' parameter to 'preferEncoded' for clarity in image request APIs
* fix(mobile): ensure proper resource cleanup for cancelled image requests
* refactor(mobile): streamline codec handling by removing unnecessary descriptor disposal in loadCodec request
---------
Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
* feat(mobile): add playbackStyle to native sync API
Adds a `playbackStyle` field to `PlatformAsset` in the pigeon sync API so
native platforms can communicate the asset's playback style (image, video,
animated, livePhoto) to Flutter during sync.
- Add `playbackStyleValue` computed property to `PHAsset` extension (iOS)
- Populate `playbackStyle` in `toPlatformAsset()` and the full-sync path
- Update generated Dart/Kotlin/Swift files
* fix(tests): add playbackStyle to local asset test cases
* fix(tests): update playbackStyle to use integer values in local sync tests
* feat(mobile): extend playbackStyle enum to include videoLooping
* Update PHAssetExtensions.swift
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(playback): simplify playbackStyleValue implementation by removing iOS version check
* feat(android): implement proper playbackStyle detection
* add PlatformAssetPlaybackStyle enum
* linting
---------
Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The changes in #25952 inadvertently removed an optimisation which
prevents the video player from being recreated when the tree changed.
This happens surprisingly often, namely when the hero animation
finishes. The widget is particularly expensive, so recreating it 2-3 in
a short period not only feels sluggish, but also causes the video to
hitch and restart.
The solution is to bring the global key back for the native video
player. Unlike before, we are using a custom global key which compares
the values of hero tags directly. This means we don't need to maintain a
map of hero tags to global keys in the state, and also means we don't
have to pass the global key down multiple layers.
This also fixes#25981.
Asset details are prematurely hidden when a drag ends if the simulation
shows that it will close given its current velocity. It makes for a much
more responsible feeling UI. However, this behaviour conflicts with the
logic which determines whether details are showing based on the current
offset. The result is that the details are hidden, then immediately
shown again, and then hidden once it passes the min snap distance
threshold.
This can be fixed by only evaluating the position based logic when a
drag is active, and then inferring upcoming state with a simulation.