Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove thumbnail progress indicators #691

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/shared/image_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ class _ImagePreviewState extends State<ImagePreview> {
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<double>(
tween: Tween<double>(begin: blur ? startBlur : endBlur, end: blur ? endBlur : startBlur),
Expand Down
8 changes: 1 addition & 7 deletions lib/shared/image_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,7 @@ class _ImageViewerState extends State<ImageViewer> with TickerProviderStateMixin
}
},
icon: isDownloadingMedia
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
color: Colors.white.withOpacity(0.90),
),
)
? Container()
: Icon(
Icons.share_rounded,
semanticLabel: "Share",
Expand Down
15 changes: 0 additions & 15 deletions lib/shared/link_preview_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,13 @@ class LinkPreviewCard extends StatelessWidget {
link: originURL!,
showBody: false,
showTitle: false,
placeholderWidget: Container(
margin: const EdgeInsets.all(15),
child: const CircularProgressIndicator(),
),
cacheDuration: Duration.zero,
))
: LinkPreviewGenerator(
opacity: read == true ? 0.55 : 1,
link: originURL!,
showBody: false,
showTitle: false,
placeholderWidget: const Center(
child: CircularProgressIndicator(),
),
cacheDuration: Duration.zero,
),
),
Expand Down Expand Up @@ -173,21 +166,13 @@ class LinkPreviewCard extends StatelessWidget {
link: originURL!,
showBody: false,
showTitle: false,
placeholderWidget: Container(
margin: const EdgeInsets.all(15),
child: const CircularProgressIndicator(),
),
cacheDuration: Duration.zero,
))
: LinkPreviewGenerator(
opacity: read == true ? 0.55 : 1,
link: originURL!,
showBody: false,
showTitle: false,
placeholderWidget: Container(
margin: const EdgeInsets.all(15),
child: const CircularProgressIndicator(),
),
cacheDuration: Duration.zero,
),
)
Expand Down
9 changes: 1 addition & 8 deletions lib/shared/media_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,7 @@ class _MediaViewState extends State<MediaView> 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;
Expand Down
9 changes: 1 addition & 8 deletions lib/shared/preview_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,7 @@ class _PreviewImageState extends State<PreviewImage> 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;
Expand Down