ソースを参照

changed the textstyle to normal for 'Today' in album screen

ashilkn 3 年 前
コミット
9ef0cc7651

+ 1 - 0
lib/ui/collection_page.dart

@@ -40,6 +40,7 @@ class CollectionPage extends StatelessWidget {
       tagPrefix: tagPrefix,
       selectedFiles: _selectedFiles,
       initialFiles: initialFiles,
+      smallerTodayFont: true,
     );
     return Scaffold(
       appBar: PreferredSize(

+ 3 - 0
lib/ui/gallery.dart

@@ -25,6 +25,7 @@ class Gallery extends StatefulWidget {
   final GalleryLoader asyncLoader;
   final List<File> initialFiles;
   final Stream<FilesUpdatedEvent> reloadEvent;
+  final bool smallerTodayFont;
   final List<Stream<Event>> forceReloadEvents;
   final Set<EventType> removalEventTypes;
   final SelectedFiles selectedFiles;
@@ -42,6 +43,7 @@ class Gallery extends StatefulWidget {
     this.removalEventTypes = const {},
     this.header,
     this.footer,
+    this.smallerTodayFont = false,
     Key key,
   }) : super(key: key);
 
@@ -200,6 +202,7 @@ class _GalleryState extends State<Gallery> {
               .on<GalleryIndexUpdatedEvent>()
               .where((event) => event.tag == widget.tagPrefix)
               .map((event) => event.index),
+          smallerTodayFont: widget.smallerTodayFont,
         );
         if (widget.header != null && index == 0) {
           gallery = Column(children: [widget.header, gallery]);

+ 9 - 9
lib/ui/gallery_app_bar_widget.dart

@@ -91,11 +91,10 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
             : TextButton(
                 child: Text(
                   _appBarTitle,
-                  style: TextStyle(
-                    color: Colors.white.withOpacity(0.80),
-                    fontWeight: FontWeight.bold,
-                    fontSize: 16,
-                  ),
+                  style: Theme.of(context)
+                      .textTheme
+                      .headline5
+                      .copyWith(fontSize: 16),
                 ),
                 onPressed: () => _renameAlbum(context),
               ),
@@ -158,7 +157,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
         Tooltip(
           message: "share",
           child: IconButton(
-            icon: Icon(Icons.person_add),
+            icon: Icon(Icons.adaptive.share),
             onPressed: () {
               _showShareCollectionDialog();
             },
@@ -192,11 +191,11 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
               value: 2,
               child: Row(
                 children: [
-                  Icon(isArchived ? Icons.unarchive : Icons.archive),
+                  Icon(isArchived ? Icons.visibility : Icons.visibility_off),
                   Padding(
                     padding: EdgeInsets.all(8),
                   ),
-                  Text(isArchived ? "unarchive" : "archive"),
+                  Text(isArchived ? "Unhide" : "Hide"),
                 ],
               ),
             ),
@@ -469,7 +468,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
   }
 
   void _shareSelected(BuildContext context) {
-    share(context, widget.selectedFiles.files.toList(), shareButtonKey: shareButtonKey);
+    share(context, widget.selectedFiles.files.toList(),
+        shareButtonKey: shareButtonKey);
   }
 
   void _showRemoveFromCollectionSheet(BuildContext context) {

+ 12 - 30
lib/ui/home_widget.dart

@@ -277,7 +277,7 @@ class _HomeWidgetState extends State<HomeWidget> {
                 ? _getBackupFolderSelectionHook()
                 : _getMainGalleryWidget(),
             _deviceFolderGalleryWidget,
-            //_sharedCollectionGallery,
+            _sharedCollectionGallery,
             _settingsPage,
           ],
           onPageChanged: (page) {
@@ -467,26 +467,6 @@ class _HomeWidgetState extends State<HomeWidget> {
                     }
                   },
                 ),
-                // child: button(
-                //   "start backup",
-                //   fontSize: 16,
-                //   lineHeight: 1.5,
-                //   padding: EdgeInsets.only(bottom: 4),
-                //   onPressed: () async {
-                //     if (LocalSyncService.instance
-                //         .hasGrantedLimitedPermissions()) {
-                //       PhotoManager.presentLimited();
-                //     } else {
-                //       routeToPage(
-                //         context,
-                //         BackupFolderSelectionPage(
-                //           shouldSelectAll: true,
-                //           buttonText: "Start backup",
-                //         ),
-                //       );
-                //     }
-                //   },
-                // ),
               ),
             ),
           ),
@@ -504,7 +484,7 @@ class _HomeWidgetState extends State<HomeWidget> {
         child: Container(
           alignment: Alignment.bottomCenter,
           height: 52,
-          width: 180,
+          width: 240,
           child: ClipRect(
             child: BackdropFilter(
               filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
@@ -543,14 +523,16 @@ class _HomeWidgetState extends State<HomeWidget> {
                           1); // To take care of occasional missing events
                     },
                   ),
-                  // GButton(
-                  //   icon: Icons.folder_shared_outlined,
-                  //   iconColor: Colors.black,
-                  //   text: '',
-                  //   onPressed: () {
-                  //     _onTabChange(2); // To take care of occasional missing events
-                  //   },
-                  // ),
+                  GButton(
+                    margin: EdgeInsets.fromLTRB(0, 6, 0, 6),
+                    icon: Icons.folder_shared,
+                    iconColor: Colors.black,
+                    text: '',
+                    onPressed: () {
+                      _onTabChange(
+                          2); // To take care of occasional missing events
+                    },
+                  ),
                   GButton(
                     margin: EdgeInsets.fromLTRB(0, 6, 6, 6),
                     icon: Icons.person,

+ 5 - 2
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -26,6 +26,7 @@ class LazyLoadingGallery extends StatefulWidget {
   final SelectedFiles selectedFiles;
   final String tag;
   final Stream<int> currentIndexStream;
+  final bool smallerTodayFont;
 
   LazyLoadingGallery(
     this.files,
@@ -36,6 +37,7 @@ class LazyLoadingGallery extends StatefulWidget {
     this.selectedFiles,
     this.tag,
     this.currentIndexStream, {
+    this.smallerTodayFont,
     Key key,
   }) : super(key: key ?? UniqueKey());
 
@@ -148,7 +150,8 @@ class _LazyLoadingGalleryState extends State<LazyLoadingGallery> {
       padding: const EdgeInsets.only(bottom: 12),
       child: Column(
         children: [
-          getDayWidget(context, _files[0].creationTime),
+          getDayWidget(
+              context, _files[0].creationTime, widget.smallerTodayFont),
           _shouldRender ? _getGallery() : PlaceHolderWidget(_files.length),
         ],
       ),
@@ -304,7 +307,7 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
           border: widget.selectedFiles.files.contains(file)
               ? Border.all(
                   width: 4.0,
-                  color: Theme.of(context).buttonColor,
+                  color: Theme.of(context).buttonColor, //selection
                 )
               : null,
         ),

+ 14 - 10
lib/utils/date_time_util.dart

@@ -163,17 +163,21 @@ bool isLeapYear(DateTime dateTime) {
   }
 }
 
-Widget getDayWidget(BuildContext context, int timestamp) {
+Widget getDayWidget(
+    BuildContext context, int timestamp, bool smallerTodayFont) {
   return Container(
-      padding: const EdgeInsets.fromLTRB(10, 14, 0, 12),
-      alignment: Alignment.centerLeft,
-      child: Text(getDayTitle(timestamp),
-          style: getDayTitle(timestamp) == "Today"
-              ? Theme.of(context).textTheme.headline5
-              : Theme.of(context).textTheme.caption.copyWith(
-                  fontSize: 16,
-                  fontWeight: FontWeight.w600,
-                  fontFamily: 'Inter-SemiBold')));
+    padding: const EdgeInsets.fromLTRB(10, 14, 0, 12),
+    alignment: Alignment.centerLeft,
+    child: Text(
+      getDayTitle(timestamp),
+      style: (getDayTitle(timestamp) == "Today" && !smallerTodayFont)
+          ? Theme.of(context).textTheme.headline5
+          : Theme.of(context).textTheme.caption.copyWith(
+              fontSize: 16,
+              fontWeight: FontWeight.w600,
+              fontFamily: 'Inter-SemiBold'),
+    ),
+  );
 }
 
 String getDayTitle(int timestamp) {