diff --git a/lib/models/messages/textmessage.dart b/lib/models/messages/textmessage.dart index 37375f8f..b4acd725 100644 --- a/lib/models/messages/textmessage.dart +++ b/lib/models/messages/textmessage.dart @@ -1,6 +1,7 @@ import 'package:cwtch/models/message.dart'; import 'package:cwtch/widgets/messagebubble.dart'; import 'package:cwtch/widgets/messagerow.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/contactrow.dart b/lib/widgets/contactrow.dart index fced6b79..0b607a14 100644 --- a/lib/widgets/contactrow.dart +++ b/lib/widgets/contactrow.dart @@ -23,10 +23,11 @@ class _ContactRowState extends State { clipBehavior: Clip.antiAlias, color: Provider.of(context).selectedConversation == contact.onion ? Provider.of(context).theme.backgroundHilightElementColor() : null, borderOnForeground: false, + margin: EdgeInsets.all(0.0), child: InkWell( child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: const EdgeInsets.all(2.0), //border size + padding: const EdgeInsets.all(6.0), //border size child: ProfileImage( badgeCount: contact.unreadMessages, badgeColor: Provider.of(context).theme.portraitContactBadgeColor(), diff --git a/lib/widgets/messagelist.dart b/lib/widgets/messagelist.dart index 0ae041e6..6038e213 100644 --- a/lib/widgets/messagelist.dart +++ b/lib/widgets/messagelist.dart @@ -39,20 +39,22 @@ class _MessageListState extends State { Visibility( visible: showMessageWarning, child: Container( - padding: EdgeInsets.all(5.0), - color: Provider.of(context).theme.defaultButtonActiveColor(), - child: showSyncing - ? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center) - : showOfflineWarning - ? Text(Provider.of(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage, - textAlign: TextAlign.center) - // Only show the ephemeral status for peer conversations, not for groups... - : (showEphemeralWarning - ? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center) - : - // We are not allowed to put null here, so put an empty text widge - Text("")), - )), + padding: EdgeInsets.all(5.0), + color: Provider.of(context).theme.defaultButtonActiveColor(), + child: DefaultTextStyle( + style: TextStyle(color: Provider.of(context).theme.defaultButtonTextColor()), + child: showSyncing + ? Text(AppLocalizations.of(context)!.serverNotSynced, textAlign: TextAlign.center) + : showOfflineWarning + ? Text(Provider.of(context).isGroup ? AppLocalizations.of(context)!.serverConnectivityDisconnected : AppLocalizations.of(context)!.peerOfflineMessage, + textAlign: TextAlign.center) + // Only show the ephemeral status for peer conversations, not for groups... + : (showEphemeralWarning + ? Text(AppLocalizations.of(context)!.chatHistoryDefault, textAlign: TextAlign.center) + : + // We are not allowed to put null here, so put an empty text widge + Text("")), + ))), Expanded( child: Scrollbar( controller: ctrlr1, diff --git a/lib/widgets/messagerow.dart b/lib/widgets/messagerow.dart index 85c7a78d..2f44b85e 100644 --- a/lib/widgets/messagerow.dart +++ b/lib/widgets/messagerow.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/models/message.dart'; @@ -144,10 +145,12 @@ class MessageRowState extends State { }, child: GestureDetector( - // Swipe to quote - onHorizontalDragEnd: (details) { - Provider.of(context, listen: false).selectedIndex = Provider.of(context, listen: false).messageIndex; - }, + // Swipe to quote on Android + onHorizontalDragEnd: Platform.isAndroid + ? (details) { + Provider.of(context, listen: false).selectedIndex = Provider.of(context, listen: false).messageIndex; + } + : null, child: Padding(padding: EdgeInsets.all(2), child: Row(mainAxisAlignment: fromMe ? MainAxisAlignment.end : MainAxisAlignment.start, children: widgetRow)))); } diff --git a/lib/widgets/profilerow.dart b/lib/widgets/profilerow.dart index de865c8e..0c987820 100644 --- a/lib/widgets/profilerow.dart +++ b/lib/widgets/profilerow.dart @@ -22,12 +22,13 @@ class _ProfileRowState extends State { var profile = Provider.of(context); return Card( clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(0.0), child: InkWell( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: const EdgeInsets.all(2.0), //border size + padding: const EdgeInsets.all(6.0), //border size child: ProfileImage( badgeCount: 0, badgeColor: Provider.of(context).theme.portraitProfileBadgeColor(), diff --git a/lib/widgets/quotedmessage.dart b/lib/widgets/quotedmessage.dart index 466325b6..6c66c354 100644 --- a/lib/widgets/quotedmessage.dart +++ b/lib/widgets/quotedmessage.dart @@ -61,13 +61,14 @@ class QuotedMessageBubbleState extends State { try { var qMessage = (snapshot.data! as Message); // Swap the background color for quoted tweets.. + var qTextColor = fromMe ? Provider.of(context).theme.messageFromOtherTextColor() : Provider.of(context).theme.messageFromMeTextColor(); return Container( margin: EdgeInsets.all(5), padding: EdgeInsets.all(5), color: fromMe ? Provider.of(context).theme.messageFromOtherBackgroundColor() : Provider.of(context).theme.messageFromMeBackgroundColor(), child: Wrap(runAlignment: WrapAlignment.spaceEvenly, alignment: WrapAlignment.spaceEvenly, runSpacing: 1.0, crossAxisAlignment: WrapCrossAlignment.center, children: [ - Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.reply, size: 32))), - Center(widthFactor: 1.0, child: qMessage.getPreviewWidget(context)) + Center(widthFactor: 1, child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.reply, size: 32, color: qTextColor))), + Center(widthFactor: 1.0, child: DefaultTextStyle(child: qMessage.getPreviewWidget(context), style: TextStyle(color: qTextColor))) ])); } catch (e) { print(e); diff --git a/quality.sh b/quality.sh new file mode 100755 index 00000000..22d2c53d --- /dev/null +++ b/quality.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +flutter format -l 200 lib