From 4c10ef5213d710576db19260534e4754e3e9f271 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 5 Feb 2021 16:43:05 +0100 Subject: [PATCH] fix: More minor fixes --- .../list_items/contact_list_tile.dart | 3 -- lib/utils/client_presence_extension.dart | 2 ++ lib/views/home_view.dart | 33 ++++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/components/list_items/contact_list_tile.dart b/lib/components/list_items/contact_list_tile.dart index 26c84a1a..c0bd15b5 100644 --- a/lib/components/list_items/contact_list_tile.dart +++ b/lib/components/list_items/contact_list_tile.dart @@ -16,9 +16,6 @@ class ContactListTile extends StatelessWidget { var statusMsg = contact.presence?.statusMsg?.isNotEmpty ?? false ? contact.presence.statusMsg : null; - if (contact.senderId == '@jana:janian.de') { - statusMsg = 'Hallo Welt'; - } return FutureBuilder( future: Matrix.of(context).client.getProfileFromUserId(contact.senderId), diff --git a/lib/utils/client_presence_extension.dart b/lib/utils/client_presence_extension.dart index 4da4dc58..9b2cd265 100644 --- a/lib/utils/client_presence_extension.dart +++ b/lib/utils/client_presence_extension.dart @@ -26,6 +26,8 @@ extension ClientPresenceExtension on Client { (p.presence?.statusMsg?.isNotEmpty ?? false)) .toList(), ); + + contactList.sort((a, b) => a.senderId.compareTo(b.senderId)); contactList.sort((a, b) => (a.presence.lastActiveAgo?.toDouble() ?? double.infinity) .compareTo((b.presence.lastActiveAgo?.toDouble() ?? double.infinity))); diff --git a/lib/views/home_view.dart b/lib/views/home_view.dart index 20f96dbf..caf174ac 100644 --- a/lib/views/home_view.dart +++ b/lib/views/home_view.dart @@ -208,18 +208,27 @@ class _HomeViewState extends State with TickerProviderStateMixin { return Scaffold( appBar: appBar ?? AppBar( - centerTitle: false, - actions: [ - IconButton( - icon: Icon(currentIndex == 3 - ? Icons.exit_to_app_outlined - : Icons.search_outlined), - onPressed: () => _pageController.indexIsChanging - ? null - : _onAppBarButtonTap.add(currentIndex), - ), - ], - title: Text(title)), + centerTitle: false, + actions: [ + IconButton( + icon: Icon(currentIndex == 3 + ? Icons.exit_to_app_outlined + : Icons.search_outlined), + onPressed: () => _pageController.indexIsChanging + ? null + : _onAppBarButtonTap.add(currentIndex), + ), + ], + title: Text(title), + elevation: + AdaptivePageLayout.of(context).columnMode(context) ? 0 : null, + bottom: AdaptivePageLayout.of(context).columnMode(context) + ? PreferredSize( + preferredSize: Size.fromHeight(1), + child: Divider(height: 1), + ) + : null, + ), body: TabBarView( controller: _pageController, children: [