mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 14:29:26 +03:00
chore(mobile): persist video controls visibility when swiping
At current, the controls for videos are always hidden when opening an asset from the timeline, and when swiping between assets. The latter is actually quite annoying, so it would be better UX if video controls were hidden when opening from the timeline like before, but visibility of the controls was retained when swiping between assets.
This commit is contained in:
@@ -65,13 +65,15 @@ class AssetViewer extends ConsumerStatefulWidget {
|
|||||||
|
|
||||||
static void setAsset(WidgetRef ref, BaseAsset asset) {
|
static void setAsset(WidgetRef ref, BaseAsset asset) {
|
||||||
ref.read(assetViewerProvider.notifier).reset();
|
ref.read(assetViewerProvider.notifier).reset();
|
||||||
|
|
||||||
|
// Hide controls by default for videos
|
||||||
|
if (asset.isVideo) ref.read(assetViewerProvider.notifier).setControls(false);
|
||||||
|
|
||||||
_setAsset(ref, asset);
|
_setAsset(ref, asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _setAsset(WidgetRef ref, BaseAsset asset) {
|
static void _setAsset(WidgetRef ref, BaseAsset asset) {
|
||||||
ref.read(assetViewerProvider.notifier).setAsset(asset);
|
ref.read(assetViewerProvider.notifier).setAsset(asset);
|
||||||
// Hide controls by default for videos
|
|
||||||
if (asset.isVideo) ref.read(assetViewerProvider.notifier).setControls(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user