Skip to content

armgit / ente

Public Imported from GitHub
0

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

add hero animation for location section

ashilkn70ca1f1eacd3
diff --git a/lib/services/search_service.dart b/lib/services/search_service.dart
index 8257c7c782..80f930216d 100644
--- a/lib/services/search_service.dart
+++ b/lib/services/search_service.dart
@@ -708,7 +708,11 @@ class SearchService {
ctx,
LocationScreenStateProvider(
entry.key,
- const LocationScreen(),
+ LocationScreen(
+ //SearchResult.heroTag()
+ tagPrefix:
+ "${ResultType.location.toString()}_${entry.key.item.name}",
+ ),
),
);
},
diff --git a/lib/ui/viewer/location/location_screen.dart b/lib/ui/viewer/location/location_screen.dart
index 2915f94ae6..8e82a19912 100644
--- a/lib/ui/viewer/location/location_screen.dart
+++ b/lib/ui/viewer/location/location_screen.dart
@@ -28,7 +28,8 @@ import "package:photos/ui/viewer/location/edit_location_sheet.dart";
import "package:photos/utils/dialog_util.dart";
class LocationScreen extends StatelessWidget {
- const LocationScreen({super.key});
+ final String tagPrefix;
+ const LocationScreen({this.tagPrefix = "", super.key});
@override
Widget build(BuildContext context) {
@@ -49,7 +50,9 @@ class LocationScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height -
(heightOfAppBar + heightOfStatusBar),
width: double.infinity,
- child: const LocationGalleryWidget(),
+ child: LocationGalleryWidget(
+ tagPrefix: tagPrefix,
+ ),
),
],
),
@@ -126,7 +129,8 @@ class LocationScreenPopUpMenu extends StatelessWidget {
}
class LocationGalleryWidget extends StatefulWidget {
- const LocationGalleryWidget({super.key});
+ final String tagPrefix;
+ const LocationGalleryWidget({required this.tagPrefix, super.key});
@override
State<LocationGalleryWidget> createState() => _LocationGalleryWidgetState();
@@ -229,7 +233,7 @@ class _LocationGalleryWidgetState extends State<LocationGalleryWidget> {
EventType.deletedFromEverywhere,
},
selectedFiles: _selectedFiles,
- tagPrefix: "location_gallery",
+ tagPrefix: widget.tagPrefix,
),
FileSelectionOverlayBar(
GalleryType.locationTag,
diff --git a/lib/ui/viewer/search/search_section.dart b/lib/ui/viewer/search/search_section.dart
index fba84ae01b..eaeb880d13 100644
--- a/lib/ui/viewer/search/search_section.dart
+++ b/lib/ui/viewer/search/search_section.dart
@@ -194,6 +194,8 @@ class SearchExample extends StatelessWidget {
} else {
width = 85.0 + ((textScaleFactor - 1.0) * 64);
}
+ final heroTag =
+ searchResult.heroTag() + (searchResult.previewThumbnail()?.tag ?? "");
return GestureDetector(
onTap: () {
RecentSearches().add(searchResult.name());
@@ -231,8 +233,7 @@ class SearchExample extends StatelessWidget {
height: 64,
child: searchResult.previewThumbnail() != null
? Hero(
- tag: searchResult.heroTag() +
- (searchResult.previewThumbnail()?.tag ?? ""),
+ tag: heroTag,
child: ClipOval(
child: ThumbnailWidget(
searchResult.previewThumbnail()!,