fix(mobile): video player disposes early (#2275)

* fix(mobile): video player disposes early

* fixed show download button based on asset state

* style icon size

* disable screensleep on video player

* better position for video

* better scroll physics on iOS
This commit is contained in:
Alex
2023-04-18 11:23:56 -05:00
committed by GitHub
parent 8a45c258c5
commit c8d3faec6d
4 changed files with 53 additions and 35 deletions

View File

@@ -301,7 +301,8 @@ class GalleryViewerPage extends HookConsumerWidget {
onFavorite: () {
toggleFavorite(assetList[indexOfAsset.value]);
},
onDownloadPressed: assetList[indexOfAsset.value].isLocal
onDownloadPressed: assetList[indexOfAsset.value].storage ==
AssetState.local
? null
: () {
ref.watch(imageViewerStateProvider.notifier).downloadAsset(
@@ -391,7 +392,7 @@ class GalleryViewerPage extends HookConsumerWidget {
scrollPhysics: isZoomed.value
? const NeverScrollableScrollPhysics() // Don't allow paging while scrolled in
: (Platform.isIOS
? const BouncingScrollPhysics() // Use bouncing physics for iOS
? const ScrollPhysics() // Use bouncing physics for iOS
: const ClampingScrollPhysics() // Use heavy physics for Android
),
itemCount: assetList.length,
@@ -516,6 +517,7 @@ class GalleryViewerPage extends HookConsumerWidget {
filterQuality: FilterQuality.high,
maxScale: 1.0,
minScale: 1.0,
basePosition: Alignment.bottomCenter,
child: SafeArea(
child: VideoViewerPage(
onPlaying: () => isPlayingVideo.value = true,