mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: remove safe area from bottom bar (#20102)
* remove safe area from bottom bar * fix: video not playing in search view * stop foreground / background back on migration --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
c91382625c
commit
05d26dc683
3 changed files with 58 additions and 24 deletions
|
|
@ -27,6 +27,26 @@ import 'package:logging/logging.dart';
|
|||
import 'package:native_video_player/native_video_player.dart';
|
||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||
|
||||
bool _isCurrentAsset(
|
||||
BaseAsset asset,
|
||||
BaseAsset? currentAsset,
|
||||
) {
|
||||
if (asset is RemoteAsset) {
|
||||
return switch (currentAsset) {
|
||||
RemoteAsset remoteAsset => remoteAsset.id == asset.id,
|
||||
LocalAsset localAsset => localAsset.remoteId == asset.id,
|
||||
_ => false,
|
||||
};
|
||||
} else if (asset is LocalAsset) {
|
||||
return switch (currentAsset) {
|
||||
RemoteAsset remoteAsset => remoteAsset.localId == asset.id,
|
||||
LocalAsset localAsset => localAsset.id == asset.id,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class NativeVideoViewer extends HookConsumerWidget {
|
||||
final BaseAsset asset;
|
||||
final bool showControls;
|
||||
|
|
@ -56,7 +76,7 @@ class NativeVideoViewer extends HookConsumerWidget {
|
|||
// If the swipe is completed, `isCurrent` will be true for video B after a delay.
|
||||
// If the swipe is canceled, `currentAsset` will not have changed and video A will continue to play.
|
||||
final currentAsset = useState(ref.read(currentAssetNotifier));
|
||||
final isCurrent = currentAsset.value == asset;
|
||||
final isCurrent = _isCurrentAsset(asset, currentAsset.value);
|
||||
|
||||
// Used to show the placeholder during hero animations for remote videos to avoid a stutter
|
||||
final isVisible = useState(Platform.isIOS && asset.hasLocal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue