Jelajahi Sumber

UI fixes for change log screen

Neeraj Gupta 2 tahun lalu
induk
melakukan
7c378eff75
2 mengubah file dengan 47 tambahan dan 33 penghapusan
  1. 3 1
      lib/ui/home_widget.dart
  2. 44 32
      lib/ui/notification/update/change_log_page.dart

+ 3 - 1
lib/ui/home_widget.dart

@@ -429,7 +429,7 @@ class _HomeWidgetState extends State<HomeWidget> {
 
 
   showChangeLog(BuildContext context) async {
   showChangeLog(BuildContext context) async {
     final bool show = await UpdateService.instance.showChangeLog();
     final bool show = await UpdateService.instance.showChangeLog();
-    if (!show) {
+    if (!show || !Configuration.instance.isLoggedIn()) {
       return;
       return;
     }
     }
     final colorScheme = getEnteColorScheme(context);
     final colorScheme = getEnteColorScheme(context);
@@ -452,5 +452,7 @@ class _HomeWidgetState extends State<HomeWidget> {
         );
         );
       },
       },
     );
     );
+    // Do not show change dialog again
+    UpdateService.instance.hideChangeLog().ignore();
   }
   }
 }
 }

+ 44 - 32
lib/ui/notification/update/change_log_page.dart

@@ -8,6 +8,7 @@ import 'package:photos/services/update_service.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/gradient_button.dart';
 import 'package:photos/ui/common/web_page.dart';
 import 'package:photos/ui/common/web_page.dart';
+import 'package:photos/ui/components/divider_widget.dart';
 import 'package:photos/ui/components/title_bar_title_widget.dart';
 import 'package:photos/ui/components/title_bar_title_widget.dart';
 import 'package:photos/ui/notification/update/change_log_entry.dart';
 import 'package:photos/ui/notification/update/change_log_entry.dart';
 
 
@@ -52,10 +53,17 @@ class _ChangeLogPageState extends State<ChangeLogPage> {
               ),
               ),
             ),
             ),
             Expanded(child: _getChangeLog()),
             Expanded(child: _getChangeLog()),
-            const SizedBox(height: 16),
+            const DividerWidget(
+              dividerType: DividerType.solid,
+            ),
             SafeArea(
             SafeArea(
               child: Padding(
               child: Padding(
-                padding: const EdgeInsets.symmetric(horizontal: 16.0),
+                padding: const EdgeInsets.only(
+                  left: 16.0,
+                  right: 16,
+                  top: 16,
+                  bottom: 8,
+                ),
                 child: Column(
                 child: Column(
                   crossAxisAlignment: CrossAxisAlignment.start,
                   crossAxisAlignment: CrossAxisAlignment.start,
                   children: [
                   children: [
@@ -69,37 +77,40 @@ class _ChangeLogPageState extends State<ChangeLogPage> {
                         text: "Let's go",
                         text: "Let's go",
                       ),
                       ),
                     ),
                     ),
-                    const SizedBox(height: 4),
-                    RichText(
-                      textAlign: TextAlign.center,
-                      text: TextSpan(
-                        children: [
-                          const TextSpan(
-                            text: "If you like ente, ",
-                          ),
-                          TextSpan(
-                            text: "let others know",
-                            style: enteTextTheme.small.copyWith(
-                              color: enteColorScheme.primary700,
-                              decoration: TextDecoration.underline,
+                    Padding(
+                      padding: const EdgeInsets.only(
+                          left: 12, top: 12, right: 12, bottom: 6),
+                      child: RichText(
+                        textAlign: TextAlign.center,
+                        text: TextSpan(
+                          children: [
+                            const TextSpan(
+                              text: "If you like ente, ",
+                            ),
+                            TextSpan(
+                              text: "let others know",
+                              style: enteTextTheme.small.copyWith(
+                                color: enteColorScheme.primary700,
+                                decoration: TextDecoration.underline,
+                              ),
+                              recognizer: TapGestureRecognizer()
+                                ..onTap = () {
+                                  // Single tapped.
+                                  Navigator.of(context).push(
+                                    MaterialPageRoute(
+                                      builder: (BuildContext context) {
+                                        return const WebPage(
+                                          "Spread the word",
+                                          "https://ente.io/share/",
+                                        );
+                                      },
+                                    ),
+                                  );
+                                },
                             ),
                             ),
-                            recognizer: TapGestureRecognizer()
-                              ..onTap = () {
-                                // Single tapped.
-                                Navigator.of(context).push(
-                                  MaterialPageRoute(
-                                    builder: (BuildContext context) {
-                                      return const WebPage(
-                                        "Spread the word",
-                                        "https://ente.io/share/",
-                                      );
-                                    },
-                                  ),
-                                );
-                              },
-                          ),
-                        ],
-                        style: enteTextTheme.small,
+                          ],
+                          style: enteTextTheme.small,
+                        ),
                       ),
                       ),
                     ),
                     ),
                     const SizedBox(height: 8),
                     const SizedBox(height: 8),
@@ -174,6 +185,7 @@ class _ChangeLogPageState extends State<ChangeLogPage> {
               child: ChangeLogEntryWidget(entry: items[index]),
               child: ChangeLogEntryWidget(entry: items[index]),
             );
             );
           },
           },
+          physics: const ClampingScrollPhysics(),
           itemCount: items.length,
           itemCount: items.length,
           shrinkWrap: true,
           shrinkWrap: true,
         ),
         ),