Explorar o código

Merge pull request #291 from ente-io/minor-redesign-fixes

Minor redesign fixes
Neeraj Gupta %!s(int64=3) %!d(string=hai) anos
pai
achega
f946796b81

+ 5 - 5
lib/ente_theme_data.dart

@@ -41,7 +41,7 @@ extension CustomColorScheme on ColorScheme {
       : Color(0xFF1DB954);
 
   Color get frostyBlurBackdropFilterColor => brightness == Brightness.light
-      ? Colors.white.withOpacity(0.5)
+      ? Color.fromRGBO(238, 238, 238, 0.5)
       : Color.fromRGBO(48, 48, 48, 0.5);
 
   Color get iconColor =>
@@ -84,12 +84,12 @@ extension CustomColorScheme on ColorScheme {
       : Color.fromRGBO(255, 255, 255, 0.9);
 
   Color get gNavIconColor => brightness == Brightness.light
-      ? Color.fromRGBO(0, 0, 0, 0.9)
-      : Color.fromRGBO(255, 255, 255, 1);
+      ? Color.fromRGBO(0, 0, 0, 0.8)
+      : Color.fromRGBO(255, 255, 255, 0.8);
 
   Color get gNavActiveIconColor => brightness == Brightness.light
-      ? Color.fromRGBO(0, 0, 0, 0.9)
-      : Color.fromRGBO(0, 0, 0, 1);
+      ? Color.fromRGBO(0, 0, 0, 0.8)
+      : Color.fromRGBO(0, 0, 0, 0.8);
 
   Color get galleryThumbBackgroundColor => brightness == Brightness.light
       ? Color.fromRGBO(240, 240, 240, 1)

+ 10 - 9
lib/ui/backup_folder_selection_page.dart

@@ -80,17 +80,18 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                 'Select folders for backup',
                 textAlign: TextAlign.left,
                 style: TextStyle(
-                    color: Theme.of(context).colorScheme.onSurface,
-                    fontFamily: 'Inter-Bold',
-                    fontSize: 32,
-                    fontWeight: FontWeight.bold),
+                  color: Theme.of(context).colorScheme.onSurface,
+                  fontFamily: 'Inter-Bold',
+                  fontSize: 32,
+                  fontWeight: FontWeight.bold,
+                ),
               ),
             ),
           ),
           Padding(
             padding: const EdgeInsets.only(left: 24, right: 48),
             child: Text(
-              "Selected folders will be end-to-end encrypted and backed up",
+              "Selected folders will be encrypted and backed up",
               style: Theme.of(context).textTheme.caption.copyWith(height: 1.3),
             ),
           ),
@@ -110,10 +111,10 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
                             ? "Unselect all"
                             : "Select all",
                         textAlign: TextAlign.right,
-                        style: Theme.of(context).textTheme.overline.copyWith(
-                            decoration: TextDecoration.underline,
-                            fontSize: 16,
-                            letterSpacing: 1),
+                        style: TextStyle(
+                          decoration: TextDecoration.underline,
+                          fontSize: 16,
+                        ),
                       ),
                     ),
                   ),

+ 1 - 1
lib/ui/deduplicate_page.dart

@@ -64,7 +64,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
     _duplicates =
         DeduplicationService.instance.clubDuplicatesByTime(widget.duplicates);
     _selectAllFilesButFirst();
-    showToast("long-press on an item to view in full-screen");
+    showToast("Long-press on an item to view in full-screen");
   }
 
   void _selectAllFilesButFirst() {

+ 1 - 1
lib/ui/payment/stripe_subscription_page.dart

@@ -94,7 +94,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
     try {
       await _fetchSub();
     } catch (e) {
-      showToast("failed to refresh subscription");
+      showToast("Failed to refresh subscription");
     }
     await _dialog.hide();
 

+ 1 - 1
lib/ui/recovery_key_page.dart

@@ -117,7 +117,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                       onTap: () async {
                         await Clipboard.setData(
                             ClipboardData(text: recoveryKey));
-                        showToast("recovery key copied to clipboard");
+                        showToast("Recovery key copied to clipboard");
                         setState(() {
                           _hasTriedToSave = true;
                         });

+ 2 - 2
lib/ui/recovery_page.dart

@@ -35,12 +35,12 @@ class _RecoveryPageState extends State<RecoveryPage> {
           isFormValid: _recoveryKey.text.isNotEmpty,
           buttonText: 'Recover',
           onPressedFunction: () async {
-            final dialog = createProgressDialog(context, "decrypting...");
+            final dialog = createProgressDialog(context, "Decrypting...");
             await dialog.show();
             try {
               await Configuration.instance.recover(_recoveryKey.text.trim());
               await dialog.hide();
-              showToast("recovery successful!");
+              showToast("Recovery successful!");
               Navigator.of(context).pushReplacement(
                 MaterialPageRoute(
                   builder: (BuildContext context) {

+ 1 - 1
lib/ui/set_wallpaper_dialog.dart

@@ -75,7 +75,7 @@ class _SetWallpaperDialogState extends State<SetWallpaperDialog> {
               await WallpaperManagerFlutter().setwallpaperfromFile(
                   await getFile(widget.file), _lockscreenValue);
               await dialog.hide();
-              showToast("wallpaper set successfully");
+              showToast("Wallpaper set successfully");
             } catch (e, s) {
               await dialog.hide();
               Logger("SetWallpaperDialog").severe(e, s);

+ 64 - 81
lib/ui/settings/details_section_widget.dart

@@ -10,7 +10,6 @@ import 'package:photos/services/user_service.dart';
 import 'package:photos/ui/loading_widget.dart';
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/utils/data_util.dart';
-import 'package:photos/utils/toast_util.dart';
 
 class DetailsSectionWidget extends StatefulWidget {
   DetailsSectionWidget({Key key}) : super(key: key);
@@ -71,7 +70,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
         );
       },
       child: SizedBox(
-        height: 148,
+        height: 172,
         child: _userDetails == null ? loadWidget : getContainer(),
       ),
     );
@@ -79,19 +78,21 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
 
   Container getContainer() {
     return Container(
-      width: double.infinity,
-      height: 148,
       decoration: BoxDecoration(
         color: Colors.transparent,
         borderRadius: BorderRadius.only(
-            topRight: Radius.circular(16), bottomLeft: Radius.circular(16)),
+          topRight: Radius.circular(16),
+          bottomLeft: Radius.circular(16),
+          topLeft: Radius.circular(2),
+          bottomRight: Radius.circular(2),
+        ),
         image: DecorationImage(
           fit: BoxFit.fill,
           image: AssetImage("assets/card_background.png"),
         ),
       ),
       child: Padding(
-        padding: EdgeInsets.only(top: 12, bottom: 12, left: 20, right: 0),
+        padding: EdgeInsets.only(top: 24, bottom: 24, left: 20, right: 0),
         child: Column(
           mainAxisAlignment: MainAxisAlignment.start,
           crossAxisAlignment: CrossAxisAlignment.start,
@@ -103,7 +104,7 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
                   .subtitle1
                   .copyWith(color: Colors.white.withOpacity(0.7)),
             ),
-            Padding(padding: EdgeInsets.symmetric(vertical: 2)),
+            Padding(padding: EdgeInsets.symmetric(vertical: 3)),
             Text(
               "${convertBytesToReadableFormat(_userDetails.getFreeStorage())} of ${convertBytesToReadableFormat(_userDetails.getTotalStorage())} free",
               style: Theme.of(context)
@@ -147,82 +148,64 @@ class _DetailsSectionWidgetState extends State<DetailsSectionWidget> {
               ),
             ),
             Padding(padding: EdgeInsets.symmetric(vertical: 6)),
-            GestureDetector(
-              onTap: () {
-                int totalStorage = _userDetails.isPartOfFamily()
-                    ? _userDetails.familyData.storage
-                    : _userDetails.subscription.storage;
-                String usageText = formatBytes(_userDetails.getFreeStorage()) +
-                    " / " +
-                    convertBytesToReadableFormat(totalStorage) +
-                    " free";
-                if (_userDetails.isPartOfFamily()) {
-                  usageText +=
-                      "\npersonal usage: ${convertBytesToReadableFormat(_userDetails.getPersonalUsage())}\n"
-                      "family usage: ${convertBytesToReadableFormat(_userDetails.getFamilyOrPersonalUsage() - _userDetails.getPersonalUsage())}";
-                }
-                showToast(usageText);
-              },
-              child: Row(
-                mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                children: [
-                  _userDetails.isPartOfFamily()
-                      ? Row(
-                          children: [
-                            Container(
-                              width: 10,
-                              height: 10,
-                              decoration: BoxDecoration(
-                                shape: BoxShape.circle,
-                                color: Colors.white,
-                              ),
-                            ),
-                            Padding(padding: EdgeInsets.only(right: 4)),
-                            Text(
-                              "You",
-                              style: Theme.of(context)
-                                  .textTheme
-                                  .bodyText1
-                                  .copyWith(color: Colors.white),
+            Row(
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                _userDetails.isPartOfFamily()
+                    ? Row(
+                        children: [
+                          Container(
+                            width: 10,
+                            height: 10,
+                            decoration: BoxDecoration(
+                              shape: BoxShape.circle,
+                              color: Colors.white,
                             ),
-                            Padding(padding: EdgeInsets.only(right: 12)),
-                            Container(
-                              width: 10,
-                              height: 10,
-                              decoration: BoxDecoration(
-                                shape: BoxShape.circle,
-                                color: Colors.white.withOpacity(0.75),
-                              ),
+                          ),
+                          Padding(padding: EdgeInsets.only(right: 4)),
+                          Text(
+                            "You",
+                            style: Theme.of(context)
+                                .textTheme
+                                .bodyText1
+                                .copyWith(color: Colors.white),
+                          ),
+                          Padding(padding: EdgeInsets.only(right: 12)),
+                          Container(
+                            width: 10,
+                            height: 10,
+                            decoration: BoxDecoration(
+                              shape: BoxShape.circle,
+                              color: Colors.white.withOpacity(0.75),
                             ),
-                            Padding(padding: EdgeInsets.only(right: 4)),
-                            Text(
-                              "Family",
-                              style: Theme.of(context)
-                                  .textTheme
-                                  .bodyText1
-                                  .copyWith(color: Colors.white),
-                            ),
-                          ],
-                        )
-                      : Text(
-                          "${convertBytesToReadableFormat(_userDetails.getFamilyOrPersonalUsage())} used",
-                          style: Theme.of(context).textTheme.headline5.copyWith(
-                              color: Colors.white.withOpacity(0.7),
-                              fontSize: 14),
-                        ),
-                  Padding(
-                    padding: const EdgeInsets.only(right: 24.0),
-                    child: Text(
-                      "${NumberFormat().format(_userDetails.fileCount)} Memories",
-                      style: Theme.of(context)
-                          .textTheme
-                          .headline5
-                          .copyWith(color: Colors.white, fontSize: 14),
-                    ),
-                  )
-                ],
-              ),
-            )
+                          ),
+                          Padding(padding: EdgeInsets.only(right: 4)),
+                          Text(
+                            "Family",
+                            style: Theme.of(context)
+                                .textTheme
+                                .bodyText1
+                                .copyWith(color: Colors.white),
+                          ),
+                        ],
+                      )
+                    : Text(
+                        "${convertBytesToReadableFormat(_userDetails.getFamilyOrPersonalUsage())} used",
+                        style: Theme.of(context).textTheme.headline5.copyWith(
+                            color: Colors.white.withOpacity(0.7), fontSize: 14),
+                      ),
+                Padding(
+                  padding: const EdgeInsets.only(right: 24.0),
+                  child: Text(
+                    "${NumberFormat().format(_userDetails.fileCount)} Memories",
+                    style: Theme.of(context)
+                        .textTheme
+                        .headline5
+                        .copyWith(color: Colors.white, fontSize: 14),
+                  ),
+                )
+              ],
+            ),
           ],
         ),
       ),

+ 1 - 1
lib/ui/settings/info_section_widget.dart

@@ -99,7 +99,7 @@ class InfoSectionWidget extends StatelessWidget {
                           barrierColor: Colors.black.withOpacity(0.85),
                         );
                       } else {
-                        showToast("you are on the latest version");
+                        showToast("You are on the latest version");
                       }
                     },
                     child: SettingsTextItem(

+ 1 - 1
lib/ui/settings_page.dart

@@ -58,7 +58,7 @@ class SettingsPage extends StatelessWidget {
     if (hasLoggedIn) {
       contents.addAll([
         DetailsSectionWidget(),
-        Padding(padding: EdgeInsets.only(bottom: 16)),
+        Padding(padding: EdgeInsets.only(bottom: 24)),
         BackupSectionWidget(),
         sectionDivider,
         AccountSectionWidget(),

+ 1 - 1
lib/ui/shared_collections_gallery.dart

@@ -239,7 +239,7 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
                 Color(0xFF1DB954),
               ],
               onTap: () async {
-                await showToast("select an album on ente to share",
+                await showToast("Select an album on ente to share",
                     toastLength: Toast.LENGTH_LONG);
                 Bus.instance.fire(
                     TabChangedEvent(1, TabChangedEventSource.collections_page));

+ 1 - 1
lib/ui/two_factor_setup_page.dart

@@ -129,7 +129,7 @@ class _TwoFactorSetupPageState extends State<TwoFactorSetupPage>
     return GestureDetector(
       onTap: () async {
         await Clipboard.setData(ClipboardData(text: widget.secretCode));
-        showToast("code copied to clipboard");
+        showToast("Code copied to clipboard");
       },
       child: Column(
         mainAxisAlignment: MainAxisAlignment.center,

+ 2 - 2
lib/ui/zoomable_live_image.dart

@@ -115,7 +115,7 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
     }
     _isLoadingVideoPlayer = true;
     if (_file.isRemoteFile() && !(await isFileCached(_file, liveVideo: true))) {
-      showToast("downloading...", toastLength: Toast.LENGTH_LONG);
+      showToast("Downloading...", toastLength: Toast.LENGTH_LONG);
     }
 
     var videoFile = await getFile(widget.file, liveVideo: true)
@@ -159,7 +159,7 @@ class _ZoomableLiveImageState extends State<ZoomableLiveImage>
     var _preferences = await SharedPreferences.getInstance();
     int promptTillNow = _preferences.getInt(kLivePhotoToastCounterKey) ?? 0;
     if (promptTillNow < kMaxLivePhotoToastCount) {
-      showToast("press and hold to play video");
+      showToast("Press and hold to play video");
       _preferences.setInt(kLivePhotoToastCounterKey, promptTillNow + 1);
     }
   }

+ 1 - 1
lib/utils/delete_file_util.dart

@@ -307,7 +307,7 @@ Future<bool> deleteLocalFiles(
     Bus.instance.fire(LocalPhotosUpdatedEvent(deletedFiles));
     return true;
   } else {
-    showToast("could not free up space");
+    showToast("Could not free up space");
     return false;
   }
 }