diff --git a/lib/pages/chat/chat_app_bar_title.dart b/lib/pages/chat/chat_app_bar_title.dart index 68c5681b..1cb84b48 100644 --- a/lib/pages/chat/chat_app_bar_title.dart +++ b/lib/pages/chat/chat_app_bar_title.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:go_router/go_router.dart'; +import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/pages/chat/chat.dart'; import 'package:fluffychat/utils/date_time_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart'; @@ -41,33 +42,43 @@ class ChatAppBarTitle extends StatelessWidget { ), const SizedBox(width: 12), Expanded( - child: ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)), - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontSize: 16, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 16, + ), ), - ), - subtitle: PresenceBuilder( - userId: room.directChatMatrixID, - builder: (context, presence) { - final lastActiveTimestamp = presence?.lastActiveTimestamp; - if (presence?.currentlyActive == true) { - return Text(L10n.of(context)!.currentlyActive); - } - if (lastActiveTimestamp != null) { - return Text( - L10n.of(context)!.lastActiveAgo( - lastActiveTimestamp.localizedTimeShort(context), - ), - ); - } - return const SizedBox.shrink(); - }, - ), + AnimatedSize( + duration: FluffyThemes.animationDuration, + child: PresenceBuilder( + userId: room.directChatMatrixID, + builder: (context, presence) { + final lastActiveTimestamp = presence?.lastActiveTimestamp; + final style = Theme.of(context).textTheme.bodySmall; + if (presence?.currentlyActive == true) { + return Text( + L10n.of(context)!.currentlyActive, + style: style, + ); + } + if (lastActiveTimestamp != null) { + return Text( + L10n.of(context)!.lastActiveAgo( + lastActiveTimestamp.localizedTimeShort(context), + ), + style: style, + ); + } + return const SizedBox.shrink(); + }, + ), + ), + ], ), ), ], diff --git a/lib/pages/chat/seen_by_row.dart b/lib/pages/chat/seen_by_row.dart index 293be1bb..faac0db4 100644 --- a/lib/pages/chat/seen_by_row.dart +++ b/lib/pages/chat/seen_by_row.dart @@ -43,7 +43,6 @@ class SeenByRow extends StatelessWidget { name: user.calcDisplayname(), size: 16, fontSize: 9, - presenceUserId: user.stateKey, ), ), if (seenByUsers.length > maxAvatars) 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 c0d9dedd..fb4b9d56 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart @@ -32,46 +32,52 @@ class UserBottomSheetView extends StatelessWidget { leading: CloseButton( onPressed: Navigator.of(context, rootNavigator: false).pop, ), - title: ListTile( - contentPadding: EdgeInsets.zero, - title: Text(displayname.trim().split(' ').first), - subtitle: PresenceBuilder( - userId: userId, - client: client, - builder: (context, presence) { - if (presence == null) return const SizedBox.shrink(); + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(displayname), + PresenceBuilder( + userId: userId, + client: client, + builder: (context, presence) { + if (presence == null) return const SizedBox.shrink(); - final dotColor = presence.presence.isOnline - ? Colors.green - : presence.presence.isUnavailable - ? Colors.orange - : Colors.red; + final dotColor = presence.presence.isOnline + ? Colors.green + : presence.presence.isUnavailable + ? Colors.red + : Colors.grey; - final lastActiveTimestamp = presence.lastActiveTimestamp; + final lastActiveTimestamp = presence.lastActiveTimestamp; - return Row( - children: [ - Container( - width: 8, - height: 8, - margin: const EdgeInsets.only(right: 8), - decoration: BoxDecoration( - color: dotColor, - borderRadius: BorderRadius.circular(16), - ), - ), - if (presence.currentlyActive == true) - Text(L10n.of(context)!.currentlyActive), - if (lastActiveTimestamp != null) - Text( - L10n.of(context)!.lastActiveAgo( - lastActiveTimestamp.localizedTimeShort(context), + return Row( + children: [ + Container( + width: 8, + height: 8, + margin: const EdgeInsets.only(right: 8), + decoration: BoxDecoration( + color: dotColor, + borderRadius: BorderRadius.circular(16), ), ), - ], - ); - }, - ), + if (presence.currentlyActive == true) + Text( + L10n.of(context)!.currentlyActive, + style: Theme.of(context).textTheme.bodySmall, + ), + if (lastActiveTimestamp != null) + Text( + L10n.of(context)!.lastActiveAgo( + lastActiveTimestamp.localizedTimeShort(context), + ), + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ); + }, + ), + ], ), actions: [ if (userId != client.userID && diff --git a/lib/widgets/avatar.dart b/lib/widgets/avatar.dart index ed43e13d..a388823b 100644 --- a/lib/widgets/avatar.dart +++ b/lib/widgets/avatar.dart @@ -84,8 +84,8 @@ class Avatar extends StatelessWidget { final dotColor = presence.presence.isOnline ? Colors.green : presence.presence.isUnavailable - ? Colors.orange - : Colors.red; + ? Colors.red + : Colors.grey; return Positioned( bottom: -4, right: -4,