diff --git a/lib/core/constants.dart b/lib/core/constants.dart index 2386ac5d804234e2a58b8cd5046553decb42049f..6678521fc8b8a1958aa58ee717b8c5a694788f37 100644 --- a/lib/core/constants.dart +++ b/lib/core/constants.dart @@ -18,8 +18,7 @@ const int batchSize = 1000; const photoGridSizeDefault = 4; const photoGridSizeMin = 2; const photoGridSizeMax = 6; -const subGalleryLimitDefault = 80; -const subGalleryLimitMin = 40; +const subGalleryMultiplier = 10; // used to identify which ente file are available in app cache // todo: 6Jun22: delete old media identifier after 3 months diff --git a/lib/ui/huge_listview/lazy_loading_gallery.dart b/lib/ui/huge_listview/lazy_loading_gallery.dart index 9e4007f42533425ecfbd101e40f233c8871450a4..73ed59f0591cd22f71b7a6814ac7d1fc48e49239 100644 --- a/lib/ui/huge_listview/lazy_loading_gallery.dart +++ b/lib/ui/huge_listview/lazy_loading_gallery.dart @@ -32,7 +32,7 @@ class LazyLoadingGallery extends StatefulWidget { final String tag; final String? logTag; final Stream currentIndexStream; - final int? photoGirdSize; + final int photoGirdSize; LazyLoadingGallery( this.files, @@ -190,7 +190,7 @@ class _LazyLoadingGalleryState extends State { getDayWidget( context, _files[0].creationTime!, - widget.photoGirdSize!, + widget.photoGirdSize, ), ValueListenableBuilder( valueListenable: _showSelectAllButton, @@ -234,7 +234,7 @@ class _LazyLoadingGalleryState extends State { ? _getGallery() : PlaceHolderWidget( _files.length, - widget.photoGirdSize!, + widget.photoGirdSize, ), ], ); @@ -242,9 +242,7 @@ class _LazyLoadingGalleryState extends State { Widget _getGallery() { final List childGalleries = []; - final subGalleryItemLimit = widget.photoGirdSize! < photoGridSizeDefault - ? subGalleryLimitMin - : subGalleryLimitDefault; + final subGalleryItemLimit = widget.photoGirdSize * subGalleryMultiplier; for (int index = 0; index < _files.length; index += subGalleryItemLimit) { childGalleries.add( LazyLoadingGridView(