1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 03:02:44 +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:
martyfuhry 2023-03-05 23:51:18 -05:00 committed by GitHub
parent a4c215751e
commit 950989a85e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 150 additions and 133 deletions

View file

@ -211,6 +211,9 @@ class ImmichAppState extends ConsumerState<ImmichApp>
ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo(); ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent),
);
return MaterialApp( return MaterialApp(
localizationsDelegates: context.localizationDelegates, localizationsDelegates: context.localizationDelegates,

View file

@ -247,6 +247,13 @@ class GalleryViewerPage extends HookConsumerWidget {
(showAppBar.value && !isZoomed.value)) && (showAppBar.value && !isZoomed.value)) &&
!isPlayingVideo.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( return AnimatedOpacity(
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
opacity: show ? 1.0 : 0.0, opacity: show ? 1.0 : 0.0,
@ -291,7 +298,13 @@ class GalleryViewerPage extends HookConsumerWidget {
return Scaffold( return Scaffold(
backgroundColor: Colors.black, 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: [ children: [
PhotoViewGallery.builder( PhotoViewGallery.builder(
scaleStateChangedCallback: (state) { scaleStateChangedCallback: (state) {
@ -431,6 +444,7 @@ class GalleryViewerPage extends HookConsumerWidget {
), ),
], ],
), ),
),
); );
} }
} }