From 9e635548890c1d544c5eed0e7d04df27051a57c5 Mon Sep 17 00:00:00 2001 From: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:55:10 +0530 Subject: [PATCH] mobile: wrap thumbnail image with renderboundary --- .../ui/asset_grid/immich_asset_grid_view.dart | 38 ++++++++++--------- mobile/lib/shared/ui/immich_image.dart | 4 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart b/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart index 4974a0542..f17f997e3 100644 --- a/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart +++ b/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart @@ -142,24 +142,26 @@ class ImmichAssetGridViewState extends State { ) { return isScrolling ? _getPlaceholder(asset) - : ThumbnailImage( - asset: asset, - index: index, - loadAsset: widget.renderList.loadAsset, - totalAssets: widget.renderList.totalAssets, - multiselectEnabled: widget.selectionActive, - isSelected: - widget.selectionActive && _selectedAssets.contains(asset), - onSelect: () => _selectAssets([asset]), - onDeselect: widget.canDeselect || - widget.preselectedAssets == null || - !widget.preselectedAssets!.contains(asset) - ? () => _deselectAssets([asset]) - : null, - useGrayBoxPlaceholder: true, - showStorageIndicator: widget.showStorageIndicator, - heroOffset: widget.heroOffset, - showStack: widget.showStack, + : RepaintBoundary( + child: ThumbnailImage( + asset: asset, + index: index, + loadAsset: widget.renderList.loadAsset, + totalAssets: widget.renderList.totalAssets, + multiselectEnabled: widget.selectionActive, + isSelected: + widget.selectionActive && _selectedAssets.contains(asset), + onSelect: () => _selectAssets([asset]), + onDeselect: widget.canDeselect || + widget.preselectedAssets == null || + !widget.preselectedAssets!.contains(asset) + ? () => _deselectAssets([asset]) + : null, + useGrayBoxPlaceholder: true, + showStorageIndicator: widget.showStorageIndicator, + heroOffset: widget.heroOffset, + showStack: widget.showStack, + ), ); } diff --git a/mobile/lib/shared/ui/immich_image.dart b/mobile/lib/shared/ui/immich_image.dart index 7dc7573b3..112998ea5 100644 --- a/mobile/lib/shared/ui/immich_image.dart +++ b/mobile/lib/shared/ui/immich_image.dart @@ -123,8 +123,8 @@ class ImmichImage extends StatelessWidget { cacheKey: getThumbnailCacheKey(asset, type: type), ), fit: fit, - duration: const Duration(milliseconds: 500), - syncDuration: const Duration(milliseconds: 500), + duration: const Duration(milliseconds: 300), + syncDuration: const Duration(milliseconds: 300), placeholder: placeholderWidget, errorBuilder: (context, error) { if (error is HttpExceptionWithStatus &&