mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01:00
feat(mobile): Transparent bottom Android navigation bar (#1953)
* transparent system overlay * immersive view to gallery viewer, as well * comments
This commit is contained in:
parent
a4c215751e
commit
950989a85e
2 changed files with 150 additions and 133 deletions
|
@ -211,6 +211,9 @@ class ImmichAppState extends ConsumerState<ImmichApp>
|
|||
ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo();
|
||||
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent),
|
||||
);
|
||||
|
||||
return MaterialApp(
|
||||
localizationsDelegates: context.localizationDelegates,
|
||||
|
|
|
@ -247,6 +247,13 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||
(showAppBar.value && !isZoomed.value)) &&
|
||||
!isPlayingVideo.value;
|
||||
|
||||
// Change to and from immersive mode, hiding navigation and app bar
|
||||
if (show) {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
} else {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||
}
|
||||
|
||||
return AnimatedOpacity(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
opacity: show ? 1.0 : 0.0,
|
||||
|
@ -291,7 +298,13 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: Stack(
|
||||
body: WillPopScope(
|
||||
onWillPop: () async {
|
||||
// Change immersive mode back to normal "edgeToEdge" mode
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
return true;
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
PhotoViewGallery.builder(
|
||||
scaleStateChangedCallback: (state) {
|
||||
|
@ -431,6 +444,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue