1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 06:49:22 +00:00

Highlight active conversation

This commit is contained in:
Pierre HUBERT 2020-05-11 18:12:49 +02:00
parent 5c26626f92
commit f4ced0324c
2 changed files with 13 additions and 5 deletions

View File

@ -126,6 +126,7 @@ abstract class MainController extends State<MainRoute> {
/// Open a conversation
void openConversation(int convID, {fullScreen: false}) => pushPage(PageInfo(
type: PageType.CONVERSATION_PAGE,
id: convID,
child: ConversationRoute(conversationID: convID),
hideNavBar: true,
));

View File

@ -184,10 +184,17 @@ class _MembershipsPanelState extends SafeState<MembershipsPanel> {
Widget _buildConversationMembership(Membership membership) {
final conversation = membership.conversation;
Color color;
if (conversation.isHavingCall)
color = Color(0xFF815d1d);
else if (widget.currentPage.type == PageType.CONVERSATION_PAGE &&
widget.currentPage.id == conversation.id)
color = Colors.grey.shade800;
else if (!conversation.sawLastMessage) color = Color(0xFF1c443a);
return Container(
color: conversation.isHavingCall
? Color(0xFF815d1d)
: (conversation.sawLastMessage ? null : Color(0xFF1c443a)),
color: color,
child: ListTile(
dense: true,
leading: Icon(Icons.message),
@ -195,8 +202,8 @@ class _MembershipsPanelState extends SafeState<MembershipsPanel> {
ConversationsHelper.getConversationName(conversation, _usersList)),
subtitle: Text(diffTimeFromNowToStr(membership.lastActive) +
(conversation.isHavingCall ? "\n" + tr("Ongoing call") : "")),
onTap: () =>
MainController.of(context).openConversation(conversation.id),
onTap: () => MainController.of(context)
.openConversation(conversation.id, fullScreen: true),
trailing: conversation.isHavingCall
? FloatingActionButton(
child: Icon(Icons.call),