mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
Highlight active conversation
This commit is contained in:
parent
5c26626f92
commit
f4ced0324c
@ -126,6 +126,7 @@ abstract class MainController extends State<MainRoute> {
|
|||||||
/// Open a conversation
|
/// Open a conversation
|
||||||
void openConversation(int convID, {fullScreen: false}) => pushPage(PageInfo(
|
void openConversation(int convID, {fullScreen: false}) => pushPage(PageInfo(
|
||||||
type: PageType.CONVERSATION_PAGE,
|
type: PageType.CONVERSATION_PAGE,
|
||||||
|
id: convID,
|
||||||
child: ConversationRoute(conversationID: convID),
|
child: ConversationRoute(conversationID: convID),
|
||||||
hideNavBar: true,
|
hideNavBar: true,
|
||||||
));
|
));
|
||||||
|
@ -184,10 +184,17 @@ class _MembershipsPanelState extends SafeState<MembershipsPanel> {
|
|||||||
|
|
||||||
Widget _buildConversationMembership(Membership membership) {
|
Widget _buildConversationMembership(Membership membership) {
|
||||||
final conversation = membership.conversation;
|
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(
|
return Container(
|
||||||
color: conversation.isHavingCall
|
color: color,
|
||||||
? Color(0xFF815d1d)
|
|
||||||
: (conversation.sawLastMessage ? null : Color(0xFF1c443a)),
|
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
leading: Icon(Icons.message),
|
leading: Icon(Icons.message),
|
||||||
@ -195,8 +202,8 @@ class _MembershipsPanelState extends SafeState<MembershipsPanel> {
|
|||||||
ConversationsHelper.getConversationName(conversation, _usersList)),
|
ConversationsHelper.getConversationName(conversation, _usersList)),
|
||||||
subtitle: Text(diffTimeFromNowToStr(membership.lastActive) +
|
subtitle: Text(diffTimeFromNowToStr(membership.lastActive) +
|
||||||
(conversation.isHavingCall ? "\n" + tr("Ongoing call") : "")),
|
(conversation.isHavingCall ? "\n" + tr("Ongoing call") : "")),
|
||||||
onTap: () =>
|
onTap: () => MainController.of(context)
|
||||||
MainController.of(context).openConversation(conversation.id),
|
.openConversation(conversation.id, fullScreen: true),
|
||||||
trailing: conversation.isHavingCall
|
trailing: conversation.isHavingCall
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
child: Icon(Icons.call),
|
child: Icon(Icons.call),
|
||||||
|
Loading…
Reference in New Issue
Block a user