Selaa lähdekoodia

redesign bottom nav bar

ashilkn 2 vuotta sitten
vanhempi
commit
ece274b9ea
4 muutettua tiedostoa jossa 22 lisäystä ja 17 poistoa
  1. 6 0
      ios/Podfile.lock
  2. 2 0
      ios/Runner.xcodeproj/project.pbxproj
  3. 0 4
      lib/ente_theme_data.dart
  4. 14 13
      lib/ui/home_widget.dart

+ 6 - 0
ios/Podfile.lock

@@ -116,6 +116,8 @@ PODS:
   - Mantle (2.2.0):
   - Mantle (2.2.0):
     - Mantle/extobjc (= 2.2.0)
     - Mantle/extobjc (= 2.2.0)
   - Mantle/extobjc (2.2.0)
   - Mantle/extobjc (2.2.0)
+  - media_extension (0.0.1):
+    - Flutter
   - motionphoto (0.0.1):
   - motionphoto (0.0.1):
     - Flutter
     - Flutter
   - move_to_background (0.0.1):
   - move_to_background (0.0.1):
@@ -192,6 +194,7 @@ DEPENDENCIES:
   - image_editor (from `.symlinks/plugins/image_editor/ios`)
   - image_editor (from `.symlinks/plugins/image_editor/ios`)
   - in_app_purchase_storekit (from `.symlinks/plugins/in_app_purchase_storekit/ios`)
   - in_app_purchase_storekit (from `.symlinks/plugins/in_app_purchase_storekit/ios`)
   - local_auth (from `.symlinks/plugins/local_auth/ios`)
   - local_auth (from `.symlinks/plugins/local_auth/ios`)
+  - media_extension (from `.symlinks/plugins/media_extension/ios`)
   - motionphoto (from `.symlinks/plugins/motionphoto/ios`)
   - motionphoto (from `.symlinks/plugins/motionphoto/ios`)
   - move_to_background (from `.symlinks/plugins/move_to_background/ios`)
   - move_to_background (from `.symlinks/plugins/move_to_background/ios`)
   - open_mail_app (from `.symlinks/plugins/open_mail_app/ios`)
   - open_mail_app (from `.symlinks/plugins/open_mail_app/ios`)
@@ -270,6 +273,8 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/in_app_purchase_storekit/ios"
     :path: ".symlinks/plugins/in_app_purchase_storekit/ios"
   local_auth:
   local_auth:
     :path: ".symlinks/plugins/local_auth/ios"
     :path: ".symlinks/plugins/local_auth/ios"
+  media_extension:
+    :path: ".symlinks/plugins/media_extension/ios"
   motionphoto:
   motionphoto:
     :path: ".symlinks/plugins/motionphoto/ios"
     :path: ".symlinks/plugins/motionphoto/ios"
   move_to_background:
   move_to_background:
@@ -334,6 +339,7 @@ SPEC CHECKSUMS:
   libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
   libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
   local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c
   local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c
   Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
   Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
+  media_extension: 6d30dc1431ebaa63f43c397c37917b1a0a597a4c
   motionphoto: d4a432b8c8f22fb3ad966258597c0103c9c5ff16
   motionphoto: d4a432b8c8f22fb3ad966258597c0103c9c5ff16
   move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d
   move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d
   nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
   nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431

+ 2 - 0
ios/Runner.xcodeproj/project.pbxproj

@@ -289,6 +289,7 @@
 				"${BUILT_PRODUCTS_DIR}/in_app_purchase_storekit/in_app_purchase_storekit.framework",
 				"${BUILT_PRODUCTS_DIR}/in_app_purchase_storekit/in_app_purchase_storekit.framework",
 				"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
 				"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
 				"${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework",
 				"${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework",
+				"${BUILT_PRODUCTS_DIR}/media_extension/media_extension.framework",
 				"${BUILT_PRODUCTS_DIR}/motionphoto/motionphoto.framework",
 				"${BUILT_PRODUCTS_DIR}/motionphoto/motionphoto.framework",
 				"${BUILT_PRODUCTS_DIR}/move_to_background/move_to_background.framework",
 				"${BUILT_PRODUCTS_DIR}/move_to_background/move_to_background.framework",
 				"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
 				"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
@@ -342,6 +343,7 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/in_app_purchase_storekit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/in_app_purchase_storekit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/media_extension.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/motionphoto.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/motionphoto.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/move_to_background.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/move_to_background.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",

+ 0 - 4
lib/ente_theme_data.dart

@@ -293,10 +293,6 @@ extension CustomColorScheme on ColorScheme {
       ? const Color.fromRGBO(196, 196, 196, 0.6)
       ? const Color.fromRGBO(196, 196, 196, 0.6)
       : const Color.fromRGBO(255, 255, 255, 0.7);
       : const Color.fromRGBO(255, 255, 255, 0.7);
 
 
-  Color get gNavBackgroundColor => brightness == Brightness.light
-      ? const Color.fromRGBO(196, 196, 196, 0.6)
-      : const Color.fromRGBO(40, 40, 40, 0.6);
-
   Color get gNavBarActiveColor => brightness == Brightness.light
   Color get gNavBarActiveColor => brightness == Brightness.light
       ? const Color.fromRGBO(255, 255, 255, 0.6)
       ? const Color.fromRGBO(255, 255, 255, 0.6)
       : const Color.fromRGBO(255, 255, 255, 0.9);
       : const Color.fromRGBO(255, 255, 255, 0.9);

+ 14 - 13
lib/ui/home_widget.dart

@@ -33,6 +33,7 @@ import 'package:photos/services/local_sync_service.dart';
 import 'package:photos/services/update_service.dart';
 import 'package:photos/services/update_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/services/user_service.dart';
 import 'package:photos/states/user_details_state.dart';
 import 'package:photos/states/user_details_state.dart';
+import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
 import 'package:photos/ui/backup_folder_selection_page.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
 import 'package:photos/ui/common/bottom_shadow.dart';
 import 'package:photos/ui/common/bottom_shadow.dart';
@@ -298,6 +299,8 @@ class _HomeWidgetState extends State<HomeWidget> {
       return CreateCollectionPage(null, _sharedFiles);
       return CreateCollectionPage(null, _sharedFiles);
     }
     }
 
 
+    final isBottomInsetPresent = MediaQuery.of(context).viewPadding.bottom != 0;
+
     final bool showBackupFolderHook =
     final bool showBackupFolderHook =
         !Configuration.instance.hasSelectedAnyBackupFolder() &&
         !Configuration.instance.hasSelectedAnyBackupFolder() &&
             !LocalSyncService.instance.hasGrantedLimitedPermissions() &&
             !LocalSyncService.instance.hasGrantedLimitedPermissions() &&
@@ -334,8 +337,8 @@ class _HomeWidgetState extends State<HomeWidget> {
         ),
         ),
         Align(
         Align(
           alignment: Alignment.bottomCenter,
           alignment: Alignment.bottomCenter,
-          child: SafeArea(
-            minimum: const EdgeInsets.only(bottom: 8),
+          child: Padding(
+            padding: EdgeInsets.only(bottom: isBottomInsetPresent ? 32 : 8),
             child: HomeBottomNavigationBar(
             child: HomeBottomNavigationBar(
               _selectedFiles,
               _selectedFiles,
               selectedTabIndex: _selectedTabIndex,
               selectedTabIndex: _selectedTabIndex,
@@ -612,7 +615,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
     return AnimatedContainer(
     return AnimatedContainer(
       duration: const Duration(milliseconds: 300),
       duration: const Duration(milliseconds: 300),
       curve: Curves.easeInOut,
       curve: Curves.easeInOut,
-      height: filesAreSelected ? 0 : 52,
+      height: filesAreSelected ? 0 : 56,
       child: AnimatedOpacity(
       child: AnimatedOpacity(
         duration: const Duration(milliseconds: 100),
         duration: const Duration(milliseconds: 100),
         opacity: filesAreSelected ? 0.0 : 1.0,
         opacity: filesAreSelected ? 0.0 : 1.0,
@@ -626,19 +629,17 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                 mainAxisAlignment: MainAxisAlignment.center,
                 mainAxisAlignment: MainAxisAlignment.center,
                 children: [
                 children: [
                   ClipRRect(
                   ClipRRect(
-                    borderRadius: BorderRadius.circular(36),
+                    borderRadius: BorderRadius.circular(32),
                     child: Container(
                     child: Container(
                       alignment: Alignment.bottomCenter,
                       alignment: Alignment.bottomCenter,
-                      height: 52,
-                      width: 180,
+                      height: 56,
                       child: ClipRect(
                       child: ClipRect(
                         child: BackdropFilter(
                         child: BackdropFilter(
-                          filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
+                          filter: ImageFilter.blur(sigmaX: 96, sigmaY: 96),
                           child: GNav(
                           child: GNav(
                             curve: Curves.easeOutExpo,
                             curve: Curves.easeOutExpo,
-                            backgroundColor: Theme.of(context)
-                                .colorScheme
-                                .gNavBackgroundColor,
+                            backgroundColor:
+                                getEnteColorScheme(context).fillMuted,
                             mainAxisAlignment: MainAxisAlignment.center,
                             mainAxisAlignment: MainAxisAlignment.center,
                             rippleColor: Colors.white.withOpacity(0.1),
                             rippleColor: Colors.white.withOpacity(0.1),
                             activeColor: Theme.of(context)
                             activeColor: Theme.of(context)
@@ -655,7 +656,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                             haptic: false,
                             haptic: false,
                             tabs: [
                             tabs: [
                               GButton(
                               GButton(
-                                margin: const EdgeInsets.fromLTRB(6, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(12, 8, 6, 8),
                                 icon: Icons.home,
                                 icon: Icons.home,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -670,7 +671,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                                 },
                               ),
                               ),
                               GButton(
                               GButton(
-                                margin: const EdgeInsets.fromLTRB(0, 6, 0, 6),
+                                margin: const EdgeInsets.fromLTRB(6, 8, 6, 8),
                                 icon: Icons.photo_library,
                                 icon: Icons.photo_library,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,
@@ -685,7 +686,7 @@ class _HomeBottomNavigationBarState extends State<HomeBottomNavigationBar> {
                                 },
                                 },
                               ),
                               ),
                               GButton(
                               GButton(
-                                margin: const EdgeInsets.fromLTRB(0, 6, 6, 6),
+                                margin: const EdgeInsets.fromLTRB(6, 8, 12, 8),
                                 icon: Icons.folder_shared,
                                 icon: Icons.folder_shared,
                                 iconColor:
                                 iconColor:
                                     Theme.of(context).colorScheme.gNavIconColor,
                                     Theme.of(context).colorScheme.gNavIconColor,