diff --git a/lib/pages/chat_list/chat_list_body.dart b/lib/pages/chat_list/chat_list_body.dart index c2b108e3..ecab95ec 100644 --- a/lib/pages/chat_list/chat_list_body.dart +++ b/lib/pages/chat_list/chat_list_body.dart @@ -59,7 +59,6 @@ class _ChatListViewBodyState extends State { child = Column( key: const ValueKey(null), mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, children: [ Image.asset( 'assets/private_chat_wallpaper.png', @@ -76,6 +75,7 @@ class _ChatListViewBodyState extends State { ), ), ), + const SizedBox(height: 160), ], ); } else { @@ -96,7 +96,10 @@ class _ChatListViewBodyState extends State { children: [ const ConnectionStatusHeader(), if (roomSearchResult != null) ...[ - _SearchTitle(title: L10n.of(context)!.publicRooms), + _SearchTitle( + title: L10n.of(context)!.publicRooms, + icon: Icons.explore_outlined, + ), AnimatedContainer( height: roomSearchResult.chunk.isEmpty ? 0 : 106, duration: const Duration(milliseconds: 250), @@ -126,7 +129,10 @@ class _ChatListViewBodyState extends State { ), ], if (userSearchResult != null) ...[ - _SearchTitle(title: L10n.of(context)!.users), + _SearchTitle( + title: L10n.of(context)!.users, + icon: Icons.group_outlined, + ), AnimatedContainer( height: userSearchResult.results.isEmpty ? 0 : 106, duration: const Duration(milliseconds: 250), @@ -152,7 +158,10 @@ class _ChatListViewBodyState extends State { ), ], if (widget.controller.isSearchMode) - _SearchTitle(title: L10n.of(context)!.stories), + _SearchTitle( + title: L10n.of(context)!.stories, + icon: Icons.camera_alt_outlined, + ), StoriesHeader( filter: widget.controller.searchController.text, ), @@ -198,7 +207,10 @@ class _ChatListViewBodyState extends State { ), ), if (widget.controller.isSearchMode) - _SearchTitle(title: L10n.of(context)!.chats), + _SearchTitle( + title: L10n.of(context)!.chats, + icon: Icons.chat_outlined, + ), ], ); } @@ -336,7 +348,12 @@ class _ChatListViewBodyState extends State { class _SearchTitle extends StatelessWidget { final String title; - const _SearchTitle({required this.title, Key? key}) : super(key: key); + final IconData icon; + const _SearchTitle({ + required this.title, + required this.icon, + Key? key, + }) : super(key: key); @override Widget build(BuildContext context) => Container( @@ -355,13 +372,19 @@ class _SearchTitle extends StatelessWidget { horizontal: 16, vertical: 8, ), - child: Text(title, - textAlign: TextAlign.left, - style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: 12, - fontWeight: FontWeight.bold, - )), + child: Row( + children: [ + Icon(icon, size: 16), + const SizedBox(width: 16), + Text(title, + textAlign: TextAlign.left, + style: TextStyle( + color: Theme.of(context).colorScheme.onSurface, + fontSize: 12, + fontWeight: FontWeight.bold, + )), + ], + ), ), ), ); diff --git a/lib/pages/chat_list/chat_list_drawer.dart b/lib/pages/chat_list/chat_list_drawer.dart index 95602b0f..73242d4b 100644 --- a/lib/pages/chat_list/chat_list_drawer.dart +++ b/lib/pages/chat_list/chat_list_drawer.dart @@ -6,7 +6,9 @@ import 'package:vrouter/vrouter.dart'; import 'package:fluffychat/pages/chat_list/chat_list.dart'; import 'package:fluffychat/pages/chat_list/spaces_drawer.dart'; import 'package:fluffychat/utils/fluffy_share.dart'; +import 'package:fluffychat/widgets/avatar.dart'; import 'package:fluffychat/widgets/matrix.dart'; +import '../../config/app_config.dart'; class ChatListDrawer extends StatelessWidget { final ChatListController controller; @@ -17,12 +19,20 @@ class ChatListDrawer extends StatelessWidget { child: SafeArea( child: Column( children: [ + ListTile( + leading: const CircleAvatar( + radius: Avatar.defaultSize / 2, + backgroundImage: AssetImage('assets/logo.png'), + ), + title: Text(AppConfig.applicationName), + ), + const Divider(thickness: 1), Expanded( child: SpacesDrawer( controller: controller, ), ), - const Divider(), + const Divider(thickness: 1), ListTile( leading: Icon( Icons.group_add_outlined, @@ -34,6 +44,17 @@ class ChatListDrawer extends StatelessWidget { VRouter.of(context).to('/newgroup'); }, ), + ListTile( + leading: Icon( + Icons.group_work_outlined, + color: Theme.of(context).colorScheme.onBackground, + ), + title: Text(L10n.of(context)!.createNewSpace), + onTap: () { + Scaffold.of(context).closeDrawer(); + VRouter.of(context).to('/newspace'); + }, + ), ListTile( leading: Icon( Icons.adaptive.share_outlined, diff --git a/lib/pages/chat_list/chat_list_header.dart b/lib/pages/chat_list/chat_list_header.dart index f1867a0e..8e4a9597 100644 --- a/lib/pages/chat_list/chat_list_header.dart +++ b/lib/pages/chat_list/chat_list_header.dart @@ -17,7 +17,6 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget { final selectMode = controller.selectMode; return AppBar( - titleSpacing: 8, automaticallyImplyLeading: false, leading: selectMode == SelectMode.normal ? null @@ -47,7 +46,7 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget { borderRadius: BorderRadius.circular(90), borderSide: BorderSide.none, ), - hintText: L10n.of(context)!.search, + hintText: controller.activeSpacesEntry.getName(context), prefixIcon: controller.isSearchMode ? IconButton( tooltip: L10n.of(context)!.cancel, diff --git a/lib/pages/chat_list/spaces_drawer.dart b/lib/pages/chat_list/spaces_drawer.dart index 8ab385e5..c9e5d6be 100644 --- a/lib/pages/chat_list/spaces_drawer.dart +++ b/lib/pages/chat_list/spaces_drawer.dart @@ -24,15 +24,14 @@ class SpacesDrawer extends StatelessWidget { // TODO(TheOeWithTheBraid): wait for space hierarchy https://gitlab.com/famedly/company/frontend/libraries/matrix_api_lite/-/merge_requests/58 return ListView.builder( - itemCount: spaceHierarchy.length + 2, + itemCount: spaceHierarchy.length + 1, itemBuilder: (context, i) { if (i == spaceHierarchy.length) { return ListTile( leading: CircleAvatar( radius: Avatar.defaultSize / 2, - backgroundColor: Theme.of(context).colorScheme.secondaryContainer, - foregroundColor: - Theme.of(context).colorScheme.onSecondaryContainer, + backgroundColor: Theme.of(context).colorScheme.secondary, + foregroundColor: Theme.of(context).colorScheme.onSecondary, child: const Icon( Icons.archive_outlined, ), @@ -44,22 +43,6 @@ class SpacesDrawer extends StatelessWidget { }, ); } - if (i == spaceHierarchy.length + 1) { - return ListTile( - leading: CircleAvatar( - child: const Icon(Icons.group_work_outlined), - radius: Avatar.defaultSize / 2, - backgroundColor: Theme.of(context).colorScheme.secondaryContainer, - foregroundColor: - Theme.of(context).colorScheme.onSecondaryContainer, - ), - title: Text(L10n.of(context)!.createNewSpace), - onTap: () { - Scaffold.of(context).closeDrawer(); - VRouter.of(context).to('/newspace'); - }, - ); - } final space = spaceHierarchy.keys.toList()[i]; final room = space.getSpace(context); final active = currentIndex == i; @@ -69,10 +52,8 @@ class SpacesDrawer extends StatelessWidget { ? CircleAvatar( child: space.getIcon(active), radius: Avatar.defaultSize / 2, - backgroundColor: - Theme.of(context).colorScheme.secondaryContainer, - foregroundColor: - Theme.of(context).colorScheme.onSecondaryContainer, + backgroundColor: Theme.of(context).colorScheme.secondary, + foregroundColor: Theme.of(context).colorScheme.onSecondary, ) : Avatar( mxContent: room.avatar, @@ -107,7 +88,7 @@ class SpacesDrawer extends StatelessWidget { onPressed: () => controller.editSpace(context, room.id), ), ) - : null, + : const Icon(Icons.arrow_forward_ios_outlined), ); }, ); diff --git a/lib/pages/chat_list/stories_header.dart b/lib/pages/chat_list/stories_header.dart index 251bba08..66315d72 100644 --- a/lib/pages/chat_list/stories_header.dart +++ b/lib/pages/chat_list/stories_header.dart @@ -121,7 +121,7 @@ class StoriesHeader extends StatelessWidget { return SizedBox( height: 98, child: ListView.builder( - padding: const EdgeInsets.symmetric(horizontal: 2), + padding: const EdgeInsets.symmetric(horizontal: 8), scrollDirection: Axis.horizontal, itemCount: stories.length, itemBuilder: (context, i) { diff --git a/lib/pages/story/story_view.dart b/lib/pages/story/story_view.dart index ea9cfd89..38762a72 100644 --- a/lib/pages/story/story_view.dart +++ b/lib/pages/story/story_view.dart @@ -349,6 +349,7 @@ class StoryView extends StatelessWidget { onPressed: controller.replyAction, icon: const Icon(Icons.send_outlined), ), + fillColor: Theme.of(context).colorScheme.background, ), ), ), diff --git a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart index a4c04bd0..da9933e0 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart @@ -128,7 +128,9 @@ class UserBottomSheetView extends StatelessWidget { subtitle: Text(user.id), trailing: Icon(Icons.adaptive.share_outlined), onTap: () => FluffyShare.share( - user.id, controller.widget.outerContext), + user.id, + context, + ), ), if (presence != null) ListTile(