From 0cba21a37a1dc3304d87c3659e7c9f4261579f8a Mon Sep 17 00:00:00 2001 From: Micah Morrison Date: Sat, 26 Aug 2023 18:44:57 -0400 Subject: [PATCH] Remove thumbnail progress indicators --- lib/shared/image_preview.dart | 5 +++++ lib/shared/image_viewer.dart | 8 +------- lib/shared/link_preview_card.dart | 15 --------------- lib/shared/media_view.dart | 9 +-------- lib/shared/preview_image.dart | 9 +-------- 5 files changed, 8 insertions(+), 38 deletions(-) diff --git a/lib/shared/image_preview.dart b/lib/shared/image_preview.dart index 17ea2f051..3c81f8f6a 100644 --- a/lib/shared/image_preview.dart +++ b/lib/shared/image_preview.dart @@ -119,6 +119,11 @@ class _ImagePreviewState extends State { cache: true, clearMemoryCacheWhenDispose: true, cacheWidth: ((MediaQuery.of(context).size.width - 24) * View.of(context).devicePixelRatio.ceil()).toInt(), + loadStateChanged: (state) { + if (state.extendedImageLoadState == LoadState.loading) { + return Container(); + } + }, ), TweenAnimationBuilder( tween: Tween(begin: blur ? startBlur : endBlur, end: blur ? endBlur : startBlur), diff --git a/lib/shared/image_viewer.dart b/lib/shared/image_viewer.dart index d367d86a3..b3044f4f5 100644 --- a/lib/shared/image_viewer.dart +++ b/lib/shared/image_viewer.dart @@ -319,13 +319,7 @@ class _ImageViewerState extends State with TickerProviderStateMixin } }, icon: isDownloadingMedia - ? SizedBox( - height: 20, - width: 20, - child: CircularProgressIndicator( - color: Colors.white.withOpacity(0.90), - ), - ) + ? Container() : Icon( Icons.share_rounded, semanticLabel: "Share", diff --git a/lib/shared/link_preview_card.dart b/lib/shared/link_preview_card.dart index bd41f97c1..176791d9b 100644 --- a/lib/shared/link_preview_card.dart +++ b/lib/shared/link_preview_card.dart @@ -98,10 +98,6 @@ class LinkPreviewCard extends StatelessWidget { link: originURL!, showBody: false, showTitle: false, - placeholderWidget: Container( - margin: const EdgeInsets.all(15), - child: const CircularProgressIndicator(), - ), cacheDuration: Duration.zero, )) : LinkPreviewGenerator( @@ -109,9 +105,6 @@ class LinkPreviewCard extends StatelessWidget { link: originURL!, showBody: false, showTitle: false, - placeholderWidget: const Center( - child: CircularProgressIndicator(), - ), cacheDuration: Duration.zero, ), ), @@ -173,10 +166,6 @@ class LinkPreviewCard extends StatelessWidget { link: originURL!, showBody: false, showTitle: false, - placeholderWidget: Container( - margin: const EdgeInsets.all(15), - child: const CircularProgressIndicator(), - ), cacheDuration: Duration.zero, )) : LinkPreviewGenerator( @@ -184,10 +173,6 @@ class LinkPreviewCard extends StatelessWidget { link: originURL!, showBody: false, showTitle: false, - placeholderWidget: Container( - margin: const EdgeInsets.all(15), - child: const CircularProgressIndicator(), - ), cacheDuration: Duration.zero, ), ) diff --git a/lib/shared/media_view.dart b/lib/shared/media_view.dart index c5abff9df..faf6e7b51 100644 --- a/lib/shared/media_view.dart +++ b/lib/shared/media_view.dart @@ -232,14 +232,7 @@ class _MediaViewState extends State with SingleTickerProviderStateMix case LoadState.loading: _controller.reset(); - return Container( - color: theme.cardColor.darken(3), - child: SizedBox( - height: height, - width: width, - child: const Center(child: SizedBox(width: 40, height: 40, child: CircularProgressIndicator())), - ), - ); + return Container(); case LoadState.completed: if (state.wasSynchronouslyLoaded) { return state.completedWidget; diff --git a/lib/shared/preview_image.dart b/lib/shared/preview_image.dart index 0705845cb..8dd1aaded 100644 --- a/lib/shared/preview_image.dart +++ b/lib/shared/preview_image.dart @@ -66,14 +66,7 @@ class _PreviewImageState extends State with SingleTickerProviderSt switch (state.extendedImageLoadState) { case LoadState.loading: _controller.reset(); - return Container( - color: useDarkTheme ? Colors.grey.shade900 : Colors.grey.shade300, - child: SizedBox( - height: height, - width: width, - child: const Center(child: SizedBox(width: 40, height: 40, child: CircularProgressIndicator())), - ), - ); + return Container(); case LoadState.completed: if (state.wasSynchronouslyLoaded) { return state.completedWidget;