Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Merge upstream main and preserve cover transitions

r4khul3f62b3ec83b2
diff --cc mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
index f57be01784,3fcf8ced5b..3fc6e46bab
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
@@@ -36,42 -28,30 +36,44 @@@ class _SearchThumbnailWidgetState exten
@override
Widget build(BuildContext context) {
final isLocation =
- searchResult?.type() == ResultType.location ||
- searchResult?.type() == ResultType.locationSuggestion;
- final hasCover = isLocation || searchResult?.type() == ResultType.magic;
+ widget.searchResult?.type() == ResultType.location ||
+ widget.searchResult?.type() == ResultType.locationSuggestion;
+ final result = widget.searchResult;
+ final isPerson =
+ result is GenericSearchResult && result.type() == ResultType.faces;
++ final hasCover =
++ isLocation || isPerson || result?.type() == ResultType.magic;
return Hero(
- tag: isLocation ? tagPrefix : tagPrefix + (file?.tag ?? ""),
+ tag: isPerson
+ ? PersonFaceWidget.coverHeroTag(
+ tagPrefix: "people_search",
+ personId: result.params[kPersonParamID],
+ clusterID: result.params[kClusterParamId],
+ )
+ : isLocation
+ ? widget.tagPrefix
+ : widget.tagPrefix + (widget.file?.tag ?? ""),
- createRectTween: isLocation || isPerson
+ createRectTween: hasCover
? (begin, end) => RectTween(begin: begin, end: end)
: null,
- transitionOnUserGestures: isLocation || isPerson,
+ transitionOnUserGestures: hasCover,
+ placeholderBuilder: isPerson ? imageHeroPlaceholderBuilder : null,
child: SizedBox(
- height: size,
- width: size,
+ key: isPerson ? _heroChildKey : null,
+ height: widget.size,
+ width: widget.size,
child: ClipRRect(
- borderRadius: BorderRadius.circular(borderRadius),
- child: file != null
- ? (searchResult != null &&
- searchResult!.type() == ResultType.faces)
+ borderRadius: BorderRadius.circular(widget.borderRadius),
+ child: widget.file != null
+ ? (widget.searchResult != null &&
+ widget.searchResult!.type() == ResultType.faces)
? PersonFaceWidget(
- personId: (searchResult as GenericSearchResult)
+ personId: (widget.searchResult as GenericSearchResult)
.params[kPersonParamID],
- clusterID: (searchResult as GenericSearchResult)
+ clusterID: (widget.searchResult as GenericSearchResult)
.params[kClusterParamId],
)
- : ThumbnailWidget(file!)
+ : ThumbnailWidget(widget.file!)
: const NoThumbnailWidget(addBorder: false),
),
),