fix: fix message overflow for activity messages on mobile (#1573)

pull/1593/head
ggurdin 10 months ago committed by GitHub
parent 5f1c1887fc
commit c4b35f67c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -65,112 +65,104 @@ class ActivityPlanMessage extends StatelessWidget {
? const SizedBox(height: 0, width: double.infinity) ? const SizedBox(height: 0, width: double.infinity)
: Container( : Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Row( child: Column(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Column( AnimatedOpacity(
crossAxisAlignment: CrossAxisAlignment.end, opacity: animateIn
children: [ ? 0
AnimatedOpacity( : event.messageType == MessageTypes.BadEncrypted ||
opacity: animateIn event.status.isSending
? 0 ? 0.5
: event.messageType == : 1,
MessageTypes.BadEncrypted || duration: FluffyThemes.animationDuration,
event.status.isSending curve: FluffyThemes.animationCurve,
? 0.5 child: Container(
: 1, decoration: BoxDecoration(
duration: FluffyThemes.animationDuration, color: color,
curve: FluffyThemes.animationCurve, borderRadius: borderRadius,
),
clipBehavior: Clip.antiAlias,
child: CompositedTransformTarget(
link: MatrixState.pAnyState
.layerLinkAndKey(
event.eventId,
)
.link,
child: Container( child: Container(
key: MatrixState.pAnyState
.layerLinkAndKey(
event.eventId,
)
.key,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color, borderRadius: BorderRadius.circular(
borderRadius: borderRadius, AppConfig.borderRadius,
),
), ),
clipBehavior: Clip.antiAlias, padding: const EdgeInsets.symmetric(
child: CompositedTransformTarget( horizontal: 16,
link: MatrixState.pAnyState vertical: 8,
.layerLinkAndKey( ),
event.eventId, constraints: const BoxConstraints(
) maxWidth: FluffyThemes.columnWidth * 1.5,
.link, ),
child: Container( child: Column(
key: MatrixState.pAnyState mainAxisSize: MainAxisSize.min,
.layerLinkAndKey( crossAxisAlignment: CrossAxisAlignment.start,
event.eventId, children: <Widget>[
) MessageContent(
.key, displayEvent,
decoration: BoxDecoration( textColor: textColor,
borderRadius: BorderRadius.circular( borderRadius: borderRadius,
AppConfig.borderRadius, controller: controller,
), immersionMode: false,
),
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 1.5,
), ),
child: Column( if (event.hasAggregatedEvents(
mainAxisSize: MainAxisSize.min, timeline,
crossAxisAlignment: RelationshipTypes.edit,
CrossAxisAlignment.start, ))
children: <Widget>[ Padding(
MessageContent( padding: const EdgeInsets.only(
displayEvent, top: 4.0,
textColor: textColor,
borderRadius: borderRadius,
controller: controller,
immersionMode: false,
), ),
if (event.hasAggregatedEvents( child: Row(
timeline, mainAxisSize: MainAxisSize.min,
RelationshipTypes.edit, children: [
)) if (event.hasAggregatedEvents(
Padding( timeline,
padding: const EdgeInsets.only( RelationshipTypes.edit,
top: 4.0, )) ...[
), Icon(
child: Row( Icons.edit_outlined,
mainAxisSize: MainAxisSize.min, color: textColor.withAlpha(164),
children: [ size: 14,
if (event.hasAggregatedEvents( ),
timeline, Text(
RelationshipTypes.edit, ' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
)) ...[ style: TextStyle(
Icon( color: textColor.withAlpha(
Icons.edit_outlined, 164,
color:
textColor.withAlpha(164),
size: 14,
),
Text(
' - ${displayEvent.originServerTs.localizedTimeShort(context)}',
style: TextStyle(
color: textColor.withAlpha(
164,
),
fontSize: 12,
),
), ),
], fontSize: 12,
], ),
), ),
), ],
], ],
), ),
), ),
],
), ),
), ),
), ),
Padding( ),
padding: const EdgeInsets.only( ),
top: 4.0, Padding(
right: 4.0, padding: const EdgeInsets.only(
), top: 4.0,
child: MessageReactions(event, timeline), right: 4.0,
), ),
], child: MessageReactions(event, timeline),
), ),
], ],
), ),

@ -11,6 +11,7 @@ import 'package:fluffychat/pages/chat/chat.dart';
import 'package:fluffychat/pages/chat/events/message_reactions.dart'; import 'package:fluffychat/pages/chat/events/message_reactions.dart';
import 'package:fluffychat/pangea/common/utils/error_handler.dart'; import 'package:fluffychat/pangea/common/utils/error_handler.dart';
import 'package:fluffychat/pangea/events/event_wrappers/pangea_message_event.dart'; import 'package:fluffychat/pangea/events/event_wrappers/pangea_message_event.dart';
import 'package:fluffychat/pangea/events/extensions/pangea_event_extension.dart';
import 'package:fluffychat/pangea/events/models/pangea_token_model.dart'; import 'package:fluffychat/pangea/events/models/pangea_token_model.dart';
import 'package:fluffychat/pangea/toolbar/widgets/message_selection_overlay.dart'; import 'package:fluffychat/pangea/toolbar/widgets/message_selection_overlay.dart';
import 'package:fluffychat/pangea/toolbar/widgets/message_toolbar.dart'; import 'package:fluffychat/pangea/toolbar/widgets/message_toolbar.dart';
@ -152,8 +153,10 @@ class MessageSelectionPositionerState extends State<MessageSelectionPositioner>
_adjustedMessageHeight ?? _messageSize?.height ?? 0; _adjustedMessageHeight ?? _messageSize?.height ?? 0;
double get _messageMaxWidth { double get _messageMaxWidth {
const double messageMargin = Avatar.defaultSize + 16 + 8; final double messageMargin =
const totalMaxWidth = (FluffyThemes.columnWidth * 2.5) - messageMargin; widget.event.isActivityMessage ? 0 : Avatar.defaultSize + 16 + 8;
final double totalMaxWidth =
(FluffyThemes.columnWidth * 2.5) - messageMargin;
double? maxWidth; double? maxWidth;
if (_mediaQuery != null) { if (_mediaQuery != null) {

Loading…
Cancel
Save