Selaa lähdekoodia

mobile: wrap thumbnail image with renderboundary

shalong-tanwen 1 vuosi sitten
vanhempi
commit
9e63554889

+ 20 - 18
mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart

@@ -142,24 +142,26 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
   ) {
   ) {
     return isScrolling
     return isScrolling
         ? _getPlaceholder(asset)
         ? _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,
+            ),
           );
           );
   }
   }
 
 

+ 2 - 2
mobile/lib/shared/ui/immich_image.dart

@@ -123,8 +123,8 @@ class ImmichImage extends StatelessWidget {
         cacheKey: getThumbnailCacheKey(asset, type: type),
         cacheKey: getThumbnailCacheKey(asset, type: type),
       ),
       ),
       fit: fit,
       fit: fit,
-      duration: const Duration(milliseconds: 500),
-      syncDuration: const Duration(milliseconds: 500),
+      duration: const Duration(milliseconds: 300),
+      syncDuration: const Duration(milliseconds: 300),
       placeholder: placeholderWidget,
       placeholder: placeholderWidget,
       errorBuilder: (context, error) {
       errorBuilder: (context, error) {
         if (error is HttpExceptionWithStatus &&
         if (error is HttpExceptionWithStatus &&