Browse Source

175 Fixed issue back button android return to login page (#193)

* Back button is no longer return to login page

* Update to material 3

* Update to material 3

* Up version for deployment

* Added F-droid changelog
Alex 3 years ago
parent
commit
a3b45d62b6

+ 2 - 0
mobile/android/fastlane/metadata/android/en-US/changelogs/16.txt

@@ -0,0 +1,2 @@
+* Update to Material Design 3
+* Fixed back button navigation - no longer return back to the home page

+ 1 - 1
mobile/ios/fastlane/Fastfile

@@ -19,7 +19,7 @@ platform :ios do
   desc "iOS Beta"
   lane :beta do
     increment_version_number(
-      version_number: "1.10.0"
+      version_number: "1.10.1"
     )
     increment_build_number(
       build_number: latest_testflight_build_number + 1,

+ 1 - 0
mobile/lib/main.dart

@@ -103,6 +103,7 @@ class _ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserv
             title: 'Immich',
             debugShowCheckedModeBanner: false,
             theme: ThemeData(
+              useMaterial3: true,
               brightness: Brightness.light,
               primarySwatch: Colors.indigo,
               fontFamily: 'WorkSans',

+ 21 - 1
mobile/lib/modules/backup/views/backup_controller_page.dart

@@ -96,6 +96,12 @@ class BackupControllerPage extends HookConsumerWidget {
               Padding(
                 padding: const EdgeInsets.only(top: 8.0),
                 child: OutlinedButton(
+                  style: OutlinedButton.styleFrom(
+                    side: const BorderSide(
+                      width: 1,
+                      color: Color.fromARGB(255, 220, 220, 220),
+                    ),
+                  ),
                   onPressed: () {
                     isAutoBackup
                         ? ref.watch(authenticationProvider.notifier).setAutoBackup(false)
@@ -191,6 +197,13 @@ class BackupControllerPage extends HookConsumerWidget {
             ),
           ),
           trailing: OutlinedButton(
+            style: OutlinedButton.styleFrom(
+              enableFeedback: true,
+              side: const BorderSide(
+                width: 1,
+                color: Color.fromARGB(255, 220, 220, 220),
+              ),
+            ),
             onPressed: () {
               AutoRouter.of(context).push(const BackupAlbumSelectionRoute());
             },
@@ -278,13 +291,20 @@ class BackupControllerPage extends HookConsumerWidget {
               child: Container(
                 child: backupState.backupProgress == BackUpProgressEnum.inProgress
                     ? ElevatedButton(
-                        style: ElevatedButton.styleFrom(primary: Colors.red[300]),
+                        style: ElevatedButton.styleFrom(
+                          primary: Colors.red[300],
+                          onPrimary: Colors.grey[50],
+                        ),
                         onPressed: () {
                           ref.read(backupProvider.notifier).cancelBackup();
                         },
                         child: const Text("Cancel"),
                       )
                     : ElevatedButton(
+                        style: ElevatedButton.styleFrom(
+                          primary: Theme.of(context).primaryColor,
+                          onPrimary: Colors.grey[50],
+                        ),
                         onPressed: shouldBackup
                             ? () {
                                 ref.read(backupProvider.notifier).startBackupProcess();

+ 1 - 2
mobile/lib/modules/home/ui/immich_sliver_appbar.dart

@@ -109,7 +109,7 @@ class ImmichSliverAppBar extends ConsumerWidget {
                   ? const Icon(Icons.backup_rounded)
                   : Badge(
                       padding: const EdgeInsets.all(4),
-                      elevation: 1,
+                      elevation: 2,
                       position: BadgePosition.bottomEnd(bottom: -4, end: -4),
                       badgeColor: Colors.white,
                       badgeContent: const Icon(
@@ -117,7 +117,6 @@ class ImmichSliverAppBar extends ConsumerWidget {
                         size: 8,
                       ),
                       child: const Icon(Icons.backup_rounded)),
-              tooltip: 'Backup Controller',
               onPressed: () async {
                 var onPop = await AutoRouter.of(context).push(const BackupControllerRoute());
 

+ 3 - 7
mobile/lib/modules/home/ui/profile_drawer.dart

@@ -153,7 +153,6 @@ class ProfileDrawer extends HookConsumerWidget {
                         ),
                       ],
                     ),
-                    const Padding(padding: EdgeInsets.all(8)),
                     Text(
                       "${_authState.firstName} ${_authState.lastName}",
                       style: TextStyle(
@@ -162,12 +161,9 @@ class ProfileDrawer extends HookConsumerWidget {
                         fontSize: 24,
                       ),
                     ),
-                    Padding(
-                      padding: const EdgeInsets.only(top: 4.0),
-                      child: Text(
-                        _authState.userEmail,
-                        style: TextStyle(color: Colors.grey[800], fontSize: 12),
-                      ),
+                    Text(
+                      _authState.userEmail,
+                      style: TextStyle(color: Colors.grey[800], fontSize: 12),
                     )
                   ],
                 ),

+ 5 - 2
mobile/lib/modules/login/ui/login_form.dart

@@ -153,9 +153,12 @@ class LoginButton extends ConsumerWidget {
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     return ElevatedButton(
-        style: ButtonStyle(
+        style: ElevatedButton.styleFrom(
           visualDensity: VisualDensity.standard,
-          padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.symmetric(vertical: 10, horizontal: 25)),
+          primary: Theme.of(context).primaryColor,
+          onPrimary: Colors.grey[50],
+          elevation: 2,
+          padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 25),
         ),
         onPressed: () async {
           // This will remove current cache asset state of previous user login.

+ 7 - 7
mobile/lib/modules/search/views/search_result_page.dart

@@ -79,14 +79,14 @@ class SearchResultPage extends HookConsumerWidget {
       return Chip(
         label: Wrap(
           spacing: 5,
+          runAlignment: WrapAlignment.center,
+          crossAxisAlignment: WrapCrossAlignment.center,
+          alignment: WrapAlignment.center,
           children: [
-            Padding(
-              padding: const EdgeInsets.only(top: 2.0),
-              child: Text(
-                currentSearchTerm.value,
-                style: TextStyle(color: Theme.of(context).primaryColor),
-                maxLines: 1,
-              ),
+            Text(
+              currentSearchTerm.value,
+              style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 13, fontWeight: FontWeight.bold),
+              maxLines: 1,
             ),
             Icon(
               Icons.close_rounded,

+ 7 - 8
mobile/lib/modules/sharing/ui/album_action_outlined_button.dart

@@ -13,15 +13,14 @@ class AlbumActionOutlinedButton extends StatelessWidget {
     return Padding(
       padding: const EdgeInsets.only(right: 8.0),
       child: OutlinedButton.icon(
-        style: ButtonStyle(
-          padding: MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.symmetric(vertical: 0, horizontal: 10)),
-          shape: MaterialStateProperty.resolveWith<OutlinedBorder>(
-            (_) => RoundedRectangleBorder(
-              borderRadius: BorderRadius.circular(25),
-            ),
+        style: OutlinedButton.styleFrom(
+          padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
+          shape: RoundedRectangleBorder(
+            borderRadius: BorderRadius.circular(25),
           ),
-          side: MaterialStateProperty.resolveWith<BorderSide>(
-            (_) => const BorderSide(width: 1, color: Color.fromARGB(255, 158, 158, 158)),
+          side: const BorderSide(
+            width: 1,
+            color: Color.fromARGB(255, 215, 215, 215),
           ),
         ),
         icon: Icon(iconData, size: 15),

+ 5 - 5
mobile/lib/modules/sharing/views/create_shared_album_page.dart

@@ -82,11 +82,11 @@ class CreateSharedAlbumPage extends HookConsumerWidget {
           child: Padding(
             padding: const EdgeInsets.only(top: 16, left: 18, right: 18),
             child: OutlinedButton.icon(
-              style: ButtonStyle(
-                alignment: Alignment.centerLeft,
-                padding:
-                    MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.symmetric(vertical: 22, horizontal: 16)),
-              ),
+              style: OutlinedButton.styleFrom(
+                  alignment: Alignment.centerLeft,
+                  padding: const EdgeInsets.symmetric(vertical: 22, horizontal: 16),
+                  side: const BorderSide(color: Color.fromARGB(255, 206, 206, 206)),
+                  shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
               onPressed: _onSelectPhotosButtonPressed,
               icon: const Icon(Icons.add_rounded),
               label: Padding(

+ 25 - 19
mobile/lib/shared/views/tab_controller_page.dart

@@ -19,26 +19,32 @@ class TabControllerPage extends ConsumerWidget {
       ],
       builder: (context, child, animation) {
         final tabsRouter = AutoTabsRouter.of(context);
-        return Scaffold(
-          body: FadeTransition(
-            opacity: animation,
-            child: child,
+        return WillPopScope(
+          onWillPop: () async {
+            tabsRouter.setActiveIndex(0);
+            return false;
+          },
+          child: Scaffold(
+            body: FadeTransition(
+              opacity: animation,
+              child: child,
+            ),
+            bottomNavigationBar: isMultiSelectEnable
+                ? null
+                : BottomNavigationBar(
+                    selectedLabelStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600),
+                    unselectedLabelStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600),
+                    currentIndex: tabsRouter.activeIndex,
+                    onTap: (index) {
+                      tabsRouter.setActiveIndex(index);
+                    },
+                    items: const [
+                      BottomNavigationBarItem(label: 'Photos', icon: Icon(Icons.photo)),
+                      BottomNavigationBarItem(label: 'Search', icon: Icon(Icons.search)),
+                      BottomNavigationBarItem(label: 'Sharing', icon: Icon(Icons.group_outlined)),
+                    ],
+                  ),
           ),
-          bottomNavigationBar: isMultiSelectEnable
-              ? null
-              : BottomNavigationBar(
-                  selectedLabelStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600),
-                  unselectedLabelStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600),
-                  currentIndex: tabsRouter.activeIndex,
-                  onTap: (index) {
-                    tabsRouter.setActiveIndex(index);
-                  },
-                  items: const [
-                    BottomNavigationBarItem(label: 'Photos', icon: Icon(Icons.photo)),
-                    BottomNavigationBarItem(label: 'Search', icon: Icon(Icons.search)),
-                    BottomNavigationBarItem(label: 'Sharing', icon: Icon(Icons.group_outlined)),
-                  ],
-                ),
         );
       },
     );

+ 1 - 1
mobile/pubspec.yaml

@@ -2,7 +2,7 @@ name: immich_mobile
 description: Immich - selfhosted backup media file on mobile phone
 
 publish_to: "none"
-version: 1.10.0+15
+version: 1.10.1+16
 
 environment:
   sdk: ">=2.15.1 <3.0.0"